#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*/ puts(char *);
int /*<<< orphan*/ test_fastcall_espdiff();
int /*<<< orphan*/ test_fastcall_invoke();
int main() {
  int i;
  for (i = 1; i <= 10000; i++) {
    test_fastcall_espdiff();
  }
  for (i = 1; i <= 10000; i++) {
    test_fastcall_invoke();
  }
  puts("TEST OK");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jg     1168 <main+0x38>
mov    $0x0,%al
call   1050 <test_fastcall_espdiff@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
movl   $0x1,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jg     1191 <main+0x61>
mov    $0x0,%al
call   1030 <test_fastcall_invoke@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116f <main+0x3f>
lea    0xe68(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2710,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <test_fastcall_espdiff@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
mov    $0x2710,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <test_fastcall_invoke@plt>
add    $0xffffffff,%ebx
jne    1160 <main+0x30>
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"TEST OK\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @test_fastcall_espdiff()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 10001
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 1, %1 ]
%8 = tail call i32 (...) @test_fastcall_invoke()
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 10001
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}