#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void *routine(void *arg) {
  setvbuf(stdout, NULL, _IONBF, 0);
  unsigned long long i, j;
  long double f1, f2;
  for (i = 0; i < 10000; i++) {
    for (j = 0; j < 100000; j++) {
      f1 = f2;
    }
  }
  while (1) {
    putc('x', stdout);
  }
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x2710,-0x10(%rbp)
jae    11a2 <routine+0x82>
movq   $0x0,-0x18(%rbp)
cmpq   $0x186a0,-0x18(%rbp)
jae    118c <routine+0x6c>
fldt   -0x40(%rbp)
fstpt  -0x30(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1167 <routine+0x47>
jmp    1191 <routine+0x71>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1151 <routine+0x31>
jmp    11a7 <routine+0x87>
mov    0x2e2a(%rip),%rax
mov    (%rax),%esi
mov    $0x78,%edi
call   1030 <putc@plt>
jmp    11a7 <routine+0x87>

x86 assembly (clang, -O2):
<routine>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
nopl   0x0(%rax)
mov    (%rbx),%esi
mov    $0x78,%edi
call   1030 <putc@plt>
jmp    1140 <routine+0x20>

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
define i8* @routine(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store i8* %0, i8** %2
%7 = load i32, i32* @stdout
%8 = load i32, i32* @_IONBF
%9 = call i32 @setvbuf(i32 %7, i32* null, i32 %8, i32 0)
store i64 0, i64* %3
br label %10
10: ; preds = %23, %1
%11 = load i64, i64* %3
%12 = icmp ult i64 %11, 10000
br i1 %12, label %13, label %26
13: ; preds = %10
store i64 0, i64* %4
br label %14
14: ; preds = %19, %13
%15 = load i64, i64* %4
%16 = icmp ult i64 %15, 100000
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load x86_fp80, x86_fp80* %6
store x86_fp80 %18, x86_fp80* %5
br label %19
19: ; preds = %17
%20 = load i64, i64* %4
%21 = add i64 %20, 1
store i64 %21, i64* %4
br label %14
22: ; preds = %14
br label %23
23: ; preds = %22
%24 = load i64, i64* %3
%25 = add i64 %24, 1
store i64 %25, i64* %3
br label %10
26: ; preds = %10
br label %27
27: ; preds = %26, %27
%28 = load i32, i32* @stdout
%29 = call i32 @putc(i8 signext 120, i32 %28)
br label %27
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
define noalias i8* @routine(i8* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = load i32, i32* @_IONBF
%4 = tail call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 0)
br label %5
5: ; preds = %1, %5
%6 = load i32, i32* @stdout
%7 = tail call i32 @putc(i8 signext 120, i32 %6)
br label %5
}