xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sync();
int sync_test(void) {
  printf("sync():\n");
  fflush(NULL);
  sync();
  printf("\t\tret = %d\n", 0);
  printf("\tSucceeded Phase 1\n");
  fflush(NULL);
  return 0;
}


x86 assembly (clang, -O0):
<sync_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <sync@plt>
lea    0xeb0(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_test>:
push   %rax
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1050 <sync@plt>
lea    0xe9e(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"sync():\0A\00"
@.str.1 = [12 x i8] c"\09\09ret = %d\0A\00"
@.str.2 = [20 x i8] c"\09Succeeded Phase 1\0A\00"
define i32 @sync_test() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @fflush(i32* null)
%3 = call i32 (...) @sync()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @fflush(i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"\09\09ret = %d\0A\00"
@str = [8 x i8] c"sync():\00"
@str.3 = [19 x i8] c"\09Succeeded Phase 1\00"
define i32 @sync_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @fflush(i32* null)
%3 = tail call i32 (...) @sync()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @fflush(i32* null)
ret i32 0
}
int fun(void) { return 10; }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @fun() {
ret i32 10
}

LLVM IR (-O2):
define i32 @fun() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short);
int main(void) {
  unsigned short int x, y, z;
  x = 128;
  y = 255;
  z = x | y;
  printf("after or operation: %d", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x80,-0x6(%rbp)
movw   $0xff,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
lea    0xec0(%rip),%rdi
movzwl -0xa(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"after or operation: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i32 0, i32* %1
store i16 128, i16* %2
store i16 255, i16* %3
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %4
%11 = load i16, i16* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 zeroext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"after or operation: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 zeroext 255)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printa(const char *dato, int len) {
  int i;
  for (i = 0; i < len; ++i) {
    printf("%c", dato[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printa+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printa+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printa>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printa+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printa+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printa(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
float erf(int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(float);
float chi2_k1_cdf(float x) { return erf(sqrt(x / 2)); }


x86 assembly (clang, -O0):
<chi2_k1_cdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec6(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <sqrt@plt>
mov    %eax,%edi
call   1040 <erf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chi2_k1_cdf>:
push   %rax
mulss  0xed7(%rip),%xmm0
call   1030 <sqrt@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <erf@plt>

LLVM IR (-O0):
define float @chi2_k1_cdf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+00
%5 = call i32 @sqrt(float %4)
%6 = call float @erf(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @chi2_k1_cdf(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = tail call i32 @sqrt(float %2)
%4 = tail call float @erf(i32 %3)
ret float %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_uint64_t(uint64_t const k1,
                                          uint64_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_LESS_THAN_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_uint64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_uint64_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_uint64_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ function_with_leak6();
void use_function_with_leak6() { function_with_leak6(); }


x86 assembly (clang, -O0):
<use_function_with_leak6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <function_with_leak6@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_function_with_leak6>:
xor    %eax,%eax
jmp    1030 <function_with_leak6@plt>

LLVM IR (-O0):
define void @use_function_with_leak6() {
%1 = call i32 (...) @function_with_leak6()
ret void
}

LLVM IR (-O2):
define void @use_function_with_leak6() {
%1 = tail call i32 (...) @function_with_leak6()
ret void
}
int oem_pm8921_bms_get_chargecycles(void) {}


x86 assembly (clang, -O0):
<oem_pm8921_bms_get_chargecycles>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oem_pm8921_bms_get_chargecycles>:
ret

LLVM IR (-O0):
define i32 @oem_pm8921_bms_get_chargecycles() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @oem_pm8921_bms_get_chargecycles() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *BN_options(void) {
  static int init = 0;
  static char data[16];
  if (!init) {
    init++;
    sprintf(data, "bn(%d,%d)", (int)sizeof(unsigned int) * 8,
            (int)sizeof(unsigned int) * 8);
  }
  return data;
}


x86 assembly (clang, -O0):
<BN_options>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f25(%rip)
jne    114a <BN_options+0x3a>
mov    0x2f19(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f10(%rip)
lea    0x2f19(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x20,%ecx
mov    %ecx,%edx
call   1030 <sprintf@plt>
lea    0x2eff(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_options>:
push   %rax
cmpb   $0x0,0x2f28(%rip)
jne    113e <BN_options+0x2e>
movb   $0x1,0x2f1f(%rip)
lea    0x2f28(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x20,%edx
mov    $0x20,%ecx
call   1030 <sprintf@plt>
lea    0x2f0b(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@BN_options.init = internal global i32 0
@BN_options.data = internal global [16 x i8] zeroinitializer
@.str = [10 x i8] c"bn(%d,%d)\00"
define i8* @BN_options() {
%1 = load i32, i32* @BN_options.init
%2 = icmp ne i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @BN_options.init
%5 = add nsw i32 %4, 1
store i32 %5, i32* @BN_options.init
%6 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @BN_options.data, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 32, i32 32)
br label %7
7: ; preds = %3, %0
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @BN_options.data, i64 0, i64 0)
}

LLVM IR (-O2):
@BN_options.init = internal unnamed_addr global i1 false
@BN_options.data = internal global [16 x i8] zeroinitializer
@.str = [10 x i8] c"bn(%d,%d)\00"
define i8* @BN_options() {
%1 = load i1, i1* @BN_options.init
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @BN_options.init
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @BN_options.data, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 32, i32 32)
br label %4
4: ; preds = %2, %0
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @BN_options.data, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *me) {
  fprintf(stderr, "usage: %s mntpnt bindex [inum ...]\n", me);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"usage: %s mntpnt bindex [inum ...]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"usage: %s mntpnt bindex [inum ...]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ccvt_420p(int, int, unsigned char const *, unsigned char *,
                             int);
void ccvt_420p_bgr32(int width, int height, const void *src, void *dst) {
  ccvt_420p(width, height, (const unsigned char *)src, (unsigned char *)dst, 4);
}


x86 assembly (clang, -O0):
<ccvt_420p_bgr32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <ccvt_420p@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccvt_420p_bgr32>:
mov    $0x4,%r8d
jmp    1030 <ccvt_420p@plt>

LLVM IR (-O0):
define void @ccvt_420p_bgr32(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @ccvt_420p(i32 %9, i32 %10, i8* %11, i8* %12, i32 4)
ret void
}

LLVM IR (-O2):
define void @ccvt_420p_bgr32(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @ccvt_420p(i32 %0, i32 %1, i8* %2, i8* %3, i32 4)
ret void
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float randf() { return ((float)rand()) / (RAND_MAX + 1.0f); }


x86 assembly (clang, -O0):
<randf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
movss  0xed8(%rip),%xmm1
mov    0x2eb9(%rip),%rax
addss  (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
movss  (%rax),%xmm1
addss  0xed0(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @randf() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fadd float %3, 1.000000e+00
%5 = fdiv float %2, %4
ret float %5
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @randf() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fadd float %3, 1.000000e+00
%5 = fdiv float %2, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ leftShift(int, int);
int rightShift(int /*<<< orphan*/, int);
int getFunction(int instruction) {
  return rightShift(leftShift(instruction, 26), 26);
}


x86 assembly (clang, -O0):
<getFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1a,%esi
call   1040 <leftShift@plt>
mov    %eax,%edi
mov    $0x1a,%esi
call   1030 <rightShift@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFunction>:
push   %rax
mov    $0x1a,%esi
call   1040 <leftShift@plt>
mov    %eax,%edi
mov    $0x1a,%esi
pop    %rax
jmp    1030 <rightShift@plt>

LLVM IR (-O0):
define i32 @getFunction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @leftShift(i32 %3, i32 26)
%5 = call i32 @rightShift(i32 %4, i32 26)
ret i32 %5
}

LLVM IR (-O2):
define i32 @getFunction(i32 %0) {
%2 = tail call i32 @leftShift(i32 %0, i32 26)
%3 = tail call i32 @rightShift(i32 %2, i32 26)
ret i32 %3
}
/* Variables and functions */
int catdoc_main(int, char **);
int main(int argc, char **argv) { return catdoc_main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <catdoc_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <catdoc_main@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @catdoc_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @catdoc_main(i32 %0, i8** %1)
ret i32 %3
}
void read_bigEndian_ushort(unsigned short *dest, unsigned char *source) {
  *dest = (source[0] << 8);
  *dest |= source[1];
}


x86 assembly (clang, -O0):
<read_bigEndian_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edx
mov    -0x8(%rbp),%rax
movzwl (%rax),%ecx
or     %edx,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bigEndian_ushort>:
movzbl (%rsi),%eax
shl    $0x8,%eax
mov    %ax,(%rdi)
movzbl 0x1(%rsi),%ecx
or     %eax,%ecx
mov    %cx,(%rdi)
ret

LLVM IR (-O0):
define void @read_bigEndian_ushort(i16* %0, i8* %1) {
%3 = alloca i16*
%4 = alloca i8*
store i16* %0, i16** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = trunc i32 %9 to i16
%11 = load i16*, i16** %3
store i16 %10, i16* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i16*, i16** %3
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = or i32 %18, %15
%20 = trunc i32 %19 to i16
store i16 %20, i16* %16
ret void
}

LLVM IR (-O2):
define void @read_bigEndian_ushort(i16* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
store i16 %5, i16* %0
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
store i16 %9, i16* %0
ret void
}
/* Variables and functions */
int nonint(int, char const **);
int repl();
int main(int argc, const char *argv[]) {
  if (argc < 2)
    return repl();
  else
    return nonint(argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114f <main+0x2f>
mov    $0x0,%al
call   1030 <repl@plt>
mov    %eax,-0x4(%rbp)
jmp    115e <main+0x3e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <nonint@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jg     112c <main+0xc>
xor    %eax,%eax
jmp    1030 <repl@plt>
jmp    1040 <nonint@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @repl()
store i32 %9, i32* %3
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @nonint(i32 %11, i8** %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @repl()
br label %8
6: ; preds = %2
%7 = tail call i32 @nonint(i32 %0, i8** %1)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char const *, int /*<<< orphan*/);
int exists(const char *path) { return access(path, F_OK) > -1; }


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp sgt i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *cmd) {
  printf("usage: %s SRC DEST\n", cmd);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"usage: %s SRC DEST\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"usage: %s SRC DEST\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int do_993() { return 993; }


x86 assembly (clang, -O0):
<do_993>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_993>:
mov    $0x3e1,%eax
ret

LLVM IR (-O0):
define i32 @do_993() {
ret i32 993
}

LLVM IR (-O2):
define i32 @do_993() {
ret i32 993
}
__attribute__((weak)) void HSMC4_IrqHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<HSMC4_IrqHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HSMC4_IrqHandler+0x9>
jmp    1109 <HSMC4_IrqHandler+0x9>

x86 assembly (clang, -O2):
<HSMC4_IrqHandler>:
jmp    1100 <HSMC4_IrqHandler>

LLVM IR (-O0):
define weak void @HSMC4_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @HSMC4_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void funcd(void) { printf("zx\n"); }


x86 assembly (clang, -O0):
<funcd>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcd>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"zx\0A\00"
define void @funcd() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"zx\00"
define void @funcd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_shm_attach_ro() {
  printf("NOT IMPLEMENTED:"
         "pa_shm_attach_ro"
         "\n");
}


x86 assembly (clang, -O0):
<pa_shm_attach_ro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_shm_attach_ro>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_shm_attach_ro\0A\00"
define i32 @pa_shm_attach_ro() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_shm_attach_ro\00"
define i32 @pa_shm_attach_ro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ exit(int);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int open_for_writing(const char *name) {
  int fd = open(name, O_WRONLY);
  if (fd < 0) {
    perror("open");
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_for_writing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1171 <open_for_writing+0x41>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_for_writing>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
test   %eax,%eax
js     1145 <open_for_writing+0x15>
pop    %rcx
ret
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@.str = [5 x i8] c"open\00"
define i32 @open_for_writing(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@.str = [5 x i8] c"open\00"
define i32 @open_for_writing(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i32 %3
}
void SCE_Encode_Long(long id, unsigned char *data) {
  data[0] = 0xFF & (unsigned char)id;
  data[1] = 0xFF & (unsigned char)(id >> 8);
  data[2] = 0xFF & (unsigned char)(id >> 16);
  data[3] = 0xFF & (unsigned char)(id >> 24);
}


x86 assembly (clang, -O0):
<SCE_Encode_Long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
sar    $0x18,%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCE_Encode_Long>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @SCE_Encode_Long(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i8
%7 = zext i8 %6 to i32
%8 = and i32 255, %7
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i64, i64* %3
%13 = ashr i64 %12, 8
%14 = trunc i64 %13 to i8
%15 = zext i8 %14 to i32
%16 = and i32 255, %15
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i64, i64* %3
%21 = ashr i64 %20, 16
%22 = trunc i64 %21 to i8
%23 = zext i8 %22 to i32
%24 = and i32 255, %23
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 2
store i8 %25, i8* %27
%28 = load i64, i64* %3
%29 = ashr i64 %28, 24
%30 = trunc i64 %29 to i8
%31 = zext i8 %30 to i32
%32 = and i32 255, %31
%33 = trunc i32 %32 to i8
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i64 3
store i8 %33, i8* %35
ret void
}

LLVM IR (-O2):
define void @SCE_Encode_Long(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i8
store i8 %3, i8* %1
%4 = lshr i64 %0, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %0, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %0, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int f151(int *);
int f152(int *p) { return f151(p); }


x86 assembly (clang, -O0):
<f152>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f151@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f152>:
jmp    1030 <f151@plt>

LLVM IR (-O0):
define i32 @f152(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f151(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f152(i32* %0) {
%2 = tail call i32 @f151(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, int);
void serial_cfg_baudrate(unsigned short com, unsigned short divisor) {
  outb((com + 3), 0x80);
  outb((com), (divisor >> 8) & 0x00FF);
  outb((com), divisor & 0x00FF);
  outb((com + 3), 0x0);
}


x86 assembly (clang, -O0):
<serial_cfg_baudrate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
mov    $0x80,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
mov    -0x2(%rbp),%ax
movzwl -0x4(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
mov    -0x2(%rbp),%ax
movzwl -0x4(%rbp),%esi
and    $0xff,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
xor    %esi,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_cfg_baudrate>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%ebx
lea    0x3(%rbx),%eax
movzwl %ax,%r14d
mov    %r14d,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    %ebp,%esi
shr    $0x8,%esi
mov    %ebx,%edi
call   1030 <outb@plt>
movzbl %bpl,%esi
mov    %ebx,%edi
call   1030 <outb@plt>
mov    %r14d,%edi
xor    %esi,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_cfg_baudrate(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 3
%8 = trunc i32 %7 to i16
%9 = call i32 @outb(i16 zeroext %8, i32 128)
%10 = load i16, i16* %3
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = call i32 @outb(i16 zeroext %10, i32 %14)
%16 = load i16, i16* %3
%17 = load i16, i16* %4
%18 = zext i16 %17 to i32
%19 = and i32 %18, 255
%20 = call i32 @outb(i16 zeroext %16, i32 %19)
%21 = load i16, i16* %3
%22 = zext i16 %21 to i32
%23 = add nsw i32 %22, 3
%24 = trunc i32 %23 to i16
%25 = call i32 @outb(i16 zeroext %24, i32 0)
ret void
}

LLVM IR (-O2):
define void @serial_cfg_baudrate(i16 zeroext %0, i16 zeroext %1) {
%3 = add i16 %0, 3
%4 = tail call i32 @outb(i16 zeroext %3, i32 128)
%5 = zext i16 %1 to i32
%6 = lshr i32 %5, 8
%7 = tail call i32 @outb(i16 zeroext %0, i32 %6)
%8 = and i32 %5, 255
%9 = tail call i32 @outb(i16 zeroext %0, i32 %8)
%10 = tail call i32 @outb(i16 zeroext %3, i32 0)
ret void
}
void init_log_table(void) {}


x86 assembly (clang, -O0):
<init_log_table>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_log_table>:
ret

LLVM IR (-O0):
define void @init_log_table() {
ret void
}

LLVM IR (-O2):
define void @init_log_table() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage_word_format();
void usage(char **argv) {
  fprintf(stderr,
          "Usage: %s [-b] [-t] [-W<input word format>] [-X<output word "
          "format>] [<input files...>]\n\n",
          argv[0]);
  usage_word_format();
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xebc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [90 x i8] c"Usage: %s [-b] [-t] [-W<input word format>] [-X<output word format>] [<input files...>]\0A\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @usage_word_format()
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [90 x i8] c"Usage: %s [-b] [-t] [-W<input word format>] [-X<output word format>] [<input files...>]\0A\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 (...) @usage_word_format()
%6 = tail call i32 @exit(i32 1)
unreachable
}
void BN_GF2m_mod_sqrt(void) {}


x86 assembly (clang, -O0):
<BN_GF2m_mod_sqrt>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_GF2m_mod_sqrt>:
ret

LLVM IR (-O0):
define void @BN_GF2m_mod_sqrt() {
ret void
}

LLVM IR (-O2):
define void @BN_GF2m_mod_sqrt() {
ret void
}
/* Variables and functions */
int strlen(unsigned char *c) {
  const unsigned char *eos = c;
  while (*eos++)
    ;
  return (eos - c - 1);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
br label %5
11: ; preds = %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = sub nsw i64 %16, 1
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
void freeFourDigits(int *value) {}


x86 assembly (clang, -O0):
<freeFourDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeFourDigits>:
ret

LLVM IR (-O0):
define void @freeFourDigits(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret void
}

LLVM IR (-O2):
define void @freeFourDigits(i32* nocapture %0) {
ret void
}
void FalseTests(void) {}


x86 assembly (clang, -O0):
<FalseTests>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FalseTests>:
ret

LLVM IR (-O0):
define void @FalseTests() {
ret void
}

LLVM IR (-O2):
define void @FalseTests() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F();
int /*<<< orphan*/ T_prime();
void T() {
  F();
  T_prime();
}


x86 assembly (clang, -O0):
<T>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <F@plt>
mov    $0x0,%al
call   1040 <T_prime@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<T>:
push   %rax
xor    %eax,%eax
call   1030 <F@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <T_prime@plt>

LLVM IR (-O0):
define void @T() {
%1 = call i32 (...) @F()
%2 = call i32 (...) @T_prime()
ret void
}

LLVM IR (-O2):
define void @T() {
%1 = tail call i32 (...) @F()
%2 = tail call i32 (...) @T_prime()
ret void
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_times;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, struct tms *);
clock_t times(struct tms *buf) { return syscall(SYS_times, buf); }


x86 assembly (clang, -O0):
<times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<times>:
mov    %rdi,%rsi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.tms = type { i32 }
@SYS_times = global i32 0
define i32 @times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load i32, i32* @SYS_times
%4 = load %struct.tms*, %struct.tms** %2
%5 = call i32 @syscall(i32 %3, %struct.tms* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@SYS_times = global i32 0
define i32 @times(%struct.tms* %0) {
%2 = load i32, i32* @SYS_times
%3 = tail call i32 @syscall(i32 %2, %struct.tms* %0)
ret i32 %3
}
void INT_Excep_RIIC0_TXI0(void) {}


x86 assembly (clang, -O0):
<INT_Excep_RIIC0_TXI0>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT_Excep_RIIC0_TXI0>:
ret

LLVM IR (-O0):
define void @INT_Excep_RIIC0_TXI0() {
ret void
}

LLVM IR (-O2):
define void @INT_Excep_RIIC0_TXI0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *exe) { printf("Usage : %s /v<n>\n", exe); }


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Usage : %s /v<n>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage : %s /v<n>\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_get_selinux_context(void *c, const char **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_get_selinux_context>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_creds_get_selinux_context>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_selinux_context(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_get_selinux_context(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
unsigned xrop3_141_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_141_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_141_1_1>:
or     %esi,%edi
mov    %edi,%eax
not    %eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_141_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %7
%39 = xor i32 %38, -1
%40 = and i32 %37, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = and i32 %41, %42
%44 = or i32 %40, %43
%45 = load i32, i32* %5
%46 = load i32, i32* %7
%47 = and i32 %45, %46
%48 = or i32 %44, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @xrop3_141_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %0, %1
%4 = zext i8 %3 to i32
%5 = xor i32 %4, -1
%6 = shl nsw i32 %5, 8
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int taskCheck(const char *key) {
  if (strcmp(key, "key"))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<taskCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1142 <taskCheck+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <taskCheck+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taskCheck>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"key\00"
define i32 @taskCheck(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"key\00"
define i32 @taskCheck(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int function(int *, int);
void main() {
  int32_t a[10];
  int32_t i;
  int32_t r;
  for (i = 0; i < 10; i = i + 1) {
    a[i] = i;
  }
  r = function(a, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1142 <main+0x32>
mov    -0x34(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    111f <main+0xf>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <function@plt>
mov    %eax,-0x38(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x900000008,%rax
mov    %rax,0x20(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <function@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%17 = call i32 @function(i32* %16, i32 10)
store i32 %17, i32* %3
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 8, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 9, i32* %8
%9 = call i32 @function(i32* %3, i32 10)
ret void
}