#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);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i <= 100; i++) {
    printf("!!!!!%3d%%!!!!!", i);
    fflush(stdout);
    scanf("%d", &i);
    fflush(stdin);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     11a0 <main+0x70>
mov    -0x14(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe95(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
xor    %esi,%esi
lea    0xeb2(%rip),%r14
mov    0x2e83(%rip),%r12
lea    0xeb4(%rip),%r15
lea    0xc(%rsp),%r13
mov    0x2e80(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r12),%edi
call   1040 <fflush@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
cmp    $0x64,%eax
jl     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"!!!!!%3d%%!!!!!\00"
@stdout = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %14, %5 ]
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* @stdin
%12 = call i32 @fflush(i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = icmp slt i32 %13, 100
br i1 %15, label %5, label %16
16: ; preds = %5
ret i32 0
}