#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*/ abort();
int /*<<< orphan*/ lib1foocdecl(int, int *);
int /*<<< orphan*/ lib1foofastcall(int, int *);
int /*<<< orphan*/ lib1foostdcall(int, int *);
int main() {
  int junk[3];
  lib1foofastcall(1, &junk[0]);
  lib1foostdcall(2, &junk[1]);
  lib1foocdecl(3, &junk[2]);
  if (junk[1] != 2 || junk[0] != 1 || junk[2] != 3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1040 <lib1foofastcall@plt>
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    $0x2,%edi
call   1050 <lib1foostdcall@plt>
lea    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    $0x3,%edi
call   1060 <lib1foocdecl@plt>
cmpl   $0x2,-0xc(%rbp)
jne    119f <main+0x5f>
cmpl   $0x1,-0x10(%rbp)
jne    119f <main+0x5f>
cmpl   $0x3,-0x8(%rbp)
je     11a6 <main+0x66>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rsi
mov    $0x1,%edi
call   1040 <lib1foofastcall@plt>
lea    0x10(%rsp),%rsi
mov    $0x2,%edi
call   1050 <lib1foostdcall@plt>
lea    0x14(%rsp),%rsi
mov    $0x3,%edi
call   1060 <lib1foocdecl@plt>
cmpl   $0x2,0x10(%rsp)
jne    118d <main+0x4d>
cmpl   $0x1,0xc(%rsp)
jne    118d <main+0x4d>
cmpl   $0x3,0x14(%rsp)
jne    118d <main+0x4d>
xor    %eax,%eax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%4 = call i32 @lib1foofastcall(i32 1, i32* %3)
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%6 = call i32 @lib1foostdcall(i32 2, i32* %5)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%8 = call i32 @lib1foocdecl(i32 3, i32* %7)
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 2
br i1 %11, label %20, label %12
12: ; preds = %0
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 1
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%18 = load i32, i32* %17
%19 = icmp ne i32 %18, 3
br i1 %19, label %20, label %22
20: ; preds = %16, %12, %0
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @lib1foofastcall(i32 1, i32* %3)
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%6 = call i32 @lib1foostdcall(i32 2, i32* %5)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%8 = call i32 @lib1foocdecl(i32 3, i32* %7)
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 2
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 1
%13 = select i1 %10, i1 true, i1 %12
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 3
%16 = select i1 %13, i1 true, i1 %15
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %0
ret i32 0
}