#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 Fare_d(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  int i;
  int c;
  int f;
  c = 0;
  for (i = 0; i < 1000; i++) {
    f = Fare_d(i);
    if (c != f) {
      printf("%d=>%d ", i, f);
      c = f;
    }
  }
  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,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    1193 <main+0x73>
mov    -0x14(%rbp),%edi
call   1040 <Fare_d@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     1180 <main+0x60>
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1185 <main+0x65>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed0(%rip),%r14
xor    %r15d,%r15d
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x3e8,%ebx
je     116a <main+0x4a>
mov    %ebx,%edi
call   1040 <Fare_d@plt>
cmp    %eax,%r15d
je     1140 <main+0x20>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebp,%r15d
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d=>%d \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %6
br label %9
9: ; preds = %24, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 1000
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %6
%14 = call i32 @Fare_d(i32 %13)
store i32 %14, i32* %8
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20)
%22 = load i32, i32* %8
store i32 %22, i32* %7
br label %23
23: ; preds = %18, %12
br label %24
24: ; preds = %23
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %9
27: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d=>%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %10
%4 = phi i32 [ 0, %2 ], [ %12, %10 ]
%5 = phi i32 [ 0, %2 ], [ %11, %10 ]
%6 = tail call i32 @Fare_d(i32 %4)
%7 = icmp eq i32 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ %6, %8 ], [ %5, %3 ]
%12 = add nuw nsw i32 %4, 1
%13 = icmp eq i32 %12, 1000
br i1 %13, label %14, label %3
14: ; preds = %10
ret i32 0
}