#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void *run(void *data) {
  int i;
  for (i = 0; i < 20; i++) {
    printf("B");
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    1165 <run+0x45>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <run+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbx
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    0x2eae(%rip),%rbx
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"B\00"
@stdout = global i32 0
define i8* @run(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
br label %12
12: ; preds = %8
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@stdout = global i32 0
define noalias i8* @run(i8* nocapture readnone %0) {
%2 = tail call i32 @putchar(i32 66)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @putchar(i32 66)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 @putchar(i32 66)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = tail call i32 @putchar(i32 66)
%12 = load i32, i32* @stdout
%13 = tail call i32 @fflush(i32 %12)
%14 = tail call i32 @putchar(i32 66)
%15 = load i32, i32* @stdout
%16 = tail call i32 @fflush(i32 %15)
%17 = tail call i32 @putchar(i32 66)
%18 = load i32, i32* @stdout
%19 = tail call i32 @fflush(i32 %18)
%20 = tail call i32 @putchar(i32 66)
%21 = load i32, i32* @stdout
%22 = tail call i32 @fflush(i32 %21)
%23 = tail call i32 @putchar(i32 66)
%24 = load i32, i32* @stdout
%25 = tail call i32 @fflush(i32 %24)
%26 = tail call i32 @putchar(i32 66)
%27 = load i32, i32* @stdout
%28 = tail call i32 @fflush(i32 %27)
%29 = tail call i32 @putchar(i32 66)
%30 = load i32, i32* @stdout
%31 = tail call i32 @fflush(i32 %30)
%32 = tail call i32 @putchar(i32 66)
%33 = load i32, i32* @stdout
%34 = tail call i32 @fflush(i32 %33)
%35 = tail call i32 @putchar(i32 66)
%36 = load i32, i32* @stdout
%37 = tail call i32 @fflush(i32 %36)
%38 = tail call i32 @putchar(i32 66)
%39 = load i32, i32* @stdout
%40 = tail call i32 @fflush(i32 %39)
%41 = tail call i32 @putchar(i32 66)
%42 = load i32, i32* @stdout
%43 = tail call i32 @fflush(i32 %42)
%44 = tail call i32 @putchar(i32 66)
%45 = load i32, i32* @stdout
%46 = tail call i32 @fflush(i32 %45)
%47 = tail call i32 @putchar(i32 66)
%48 = load i32, i32* @stdout
%49 = tail call i32 @fflush(i32 %48)
%50 = tail call i32 @putchar(i32 66)
%51 = load i32, i32* @stdout
%52 = tail call i32 @fflush(i32 %51)
%53 = tail call i32 @putchar(i32 66)
%54 = load i32, i32* @stdout
%55 = tail call i32 @fflush(i32 %54)
%56 = tail call i32 @putchar(i32 66)
%57 = load i32, i32* @stdout
%58 = tail call i32 @fflush(i32 %57)
%59 = tail call i32 @putchar(i32 66)
%60 = load i32, i32* @stdout
%61 = tail call i32 @fflush(i32 %60)
ret i8* undef
}