xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ INPUT_read_data();
int /*<<< orphan*/ NETWORK_build();
int /*<<< orphan*/ NETWORK_set_units_per_layer();
int /*<<< orphan*/ NETWORK_test();
int /*<<< orphan*/ NETWORK_train();
int main(void) {
  NETWORK_set_units_per_layer();
  NETWORK_build();
  INPUT_read_data();
  NETWORK_train();
  NETWORK_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <NETWORK_set_units_per_layer@plt>
mov    $0x0,%al
call   1070 <NETWORK_build@plt>
mov    $0x0,%al
call   1030 <INPUT_read_data@plt>
mov    $0x0,%al
call   1060 <NETWORK_train@plt>
mov    $0x0,%al
call   1040 <NETWORK_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <NETWORK_set_units_per_layer@plt>
xor    %eax,%eax
call   1070 <NETWORK_build@plt>
xor    %eax,%eax
call   1030 <INPUT_read_data@plt>
xor    %eax,%eax
call   1060 <NETWORK_train@plt>
xor    %eax,%eax
call   1040 <NETWORK_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @NETWORK_set_units_per_layer()
%3 = call i32 (...) @NETWORK_build()
%4 = call i32 (...) @INPUT_read_data()
%5 = call i32 (...) @NETWORK_train()
%6 = call i32 (...) @NETWORK_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @NETWORK_set_units_per_layer()
%2 = tail call i32 (...) @NETWORK_build()
%3 = tail call i32 (...) @INPUT_read_data()
%4 = tail call i32 (...) @NETWORK_train()
%5 = tail call i32 (...) @NETWORK_test()
ret i32 0
}
int ti_decay_start(double const *options) {
  (void)options;
  return 0;
}


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

x86 assembly (clang, -O2):
<ti_decay_start>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ti_decay_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @ti_decay_start(double* nocapture readnone %0) {
ret i32 0
}
void set_int(void *base, int offset, unsigned int value) {
  const unsigned int swapped =
      ((value >> 24) & 0xff) | ((value << 8) & 0xff0000) |
      ((value >> 8) & 0xff00) | ((value << 24) & 0xff000000);
  *(unsigned int *)(base + offset) = swapped;
}


x86 assembly (clang, -O0):
<set_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_int>:
bswap  %edx
movslq %esi,%rax
mov    %edx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @set_int(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = lshr i32 %8, 24
%10 = and i32 %9, 255
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = and i32 %12, 16711680
%14 = or i32 %10, %13
%15 = load i32, i32* %6
%16 = lshr i32 %15, 8
%17 = and i32 %16, 65280
%18 = or i32 %14, %17
%19 = load i32, i32* %6
%20 = shl i32 %19, 24
%21 = and i32 %20, -16777216
%22 = or i32 %18, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i8*, i8** %4
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr i8, i8* %24, i64 %26
%28 = bitcast i8* %27 to i32*
store i32 %23, i32* %28
ret void
}

LLVM IR (-O2):
define void @set_int(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @llvm.bswap.i32(i32 %2)
%5 = sext i32 %1 to i64
%6 = getelementptr i8, i8* %0, i64 %5
%7 = bitcast i8* %6 to i32*
store i32 %4, i32* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ chmod(char const *, int /*<<< orphan*/);
int slate_ChangeFileModes(const char *path, mode_t mode) {
  return !chmod(path, mode);
}


x86 assembly (clang, -O0):
<slate_ChangeFileModes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <chmod@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slate_ChangeFileModes>:
push   %rax
call   1030 <chmod@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @slate_ChangeFileModes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @chmod(i8* %5, i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @slate_ChangeFileModes(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @chmod(i8* %0, i32 %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ wdt_kick();
int /*<<< orphan*/ wdt_setup_reboot(int /*<<< orphan*/, int);
int /*<<< orphan*/ wdt_start();
void pm_reboot(void) {
  wdt_setup_reboot(0, 1);
  wdt_start();
  wdt_kick();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<pm_reboot>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <wdt_setup_reboot@plt>
mov    $0x0,%al
call   1040 <wdt_start@plt>
mov    $0x0,%al
call   1030 <wdt_kick@plt>
jmp    114e <pm_reboot+0x1e>

x86 assembly (clang, -O2):
<pm_reboot>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <wdt_setup_reboot@plt>
xor    %eax,%eax
call   1040 <wdt_start@plt>
xor    %eax,%eax
call   1030 <wdt_kick@plt>
nopl   0x0(%rax,%rax,1)
jmp    1150 <pm_reboot+0x20>

LLVM IR (-O0):
define void @pm_reboot() {
%1 = call i32 @wdt_setup_reboot(i32 0, i32 1)
%2 = call i32 (...) @wdt_start()
%3 = call i32 (...) @wdt_kick()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define void @pm_reboot() {
%1 = tail call i32 @wdt_setup_reboot(i32 0, i32 1)
%2 = tail call i32 (...) @wdt_start()
%3 = tail call i32 (...) @wdt_kick()
br label %4
4: ; preds = %0, %4
br label %4
}
int toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return c + ('A' - 'a');
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <toupper+0x29>
mov    -0x8(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int calculaM(int faixas) {
  int retorno;
  if (faixas > 0) {
    retorno = calculaM(faixas - 1);
    if (faixas > 1)
      retorno += calculaM(faixas - 2);
  } else
    retorno = 1;
  return retorno;
}


x86 assembly (clang, -O0):
<calculaM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1153 <calculaM+0x43>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <calculaM@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    114e <calculaM+0x3e>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <calculaM@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    115a <calculaM+0x4a>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculaM>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1143 <calculaM+0x33>
mov    %edi,%ebx
add    $0xffffffff,%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
mov    %ebx,%edi
call   1030 <calculaM@plt>
test   %ebx,%ebx
je     113f <calculaM+0x2f>
add    %eax,%ebp
lea    -0x2(%rbx),%eax
add    $0x1,%ebx
cmp    $0x2,%ebx
mov    %eax,%ebx
ja     1120 <calculaM+0x10>
mov    $0x1,%eax
add    %eax,%ebp
jmp    1148 <calculaM+0x38>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @calculaM(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i32 @calculaM(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %18
12: ; preds = %6
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 2
%15 = call i32 @calculaM(i32 %14)
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %6
br label %20
19: ; preds = %1
store i32 1, i32* %3
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @calculaM(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %17
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ %0, %1 ]
%5 = phi i32 [ %11, %9 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @calculaM(i32 %6)
%8 = icmp eq i32 %4, 1
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %7, %5
%12 = icmp ugt i32 %4, 2
br i1 %12, label %3, label %13
13: ; preds = %9, %3
%14 = phi i32 [ %5, %3 ], [ %11, %9 ]
%15 = phi i32 [ %7, %3 ], [ 1, %9 ]
%16 = add nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 1, %1 ]
ret i32 %18
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_refresh(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(refresh());
}


x86 assembly (clang, -O0):
<cmd_refresh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_refresh+0x27>
jmp    117f <cmd_refresh+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_refresh>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_refresh+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_refresh(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @refresh()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_refresh(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
void sysYield(void) {}


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

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

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

LLVM IR (-O2):
define void @sysYield() {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *strip_n(char *str) {
  char *n = NULL;
  n = strchr(str, '\n');
  if (n)
    *n = '\0';
  return str;
}


x86 assembly (clang, -O0):
<strip_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <strip_n+0x38>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_n>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <strip_n+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strip_n(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @strip_n(i8* returned %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i8* %0
}
long count_masked_bytes(long mask) {
  long a = (0x0ff0001 + mask) >> 23;
  return a & mask;
}


x86 assembly (clang, -O0):
<count_masked_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xff0001,%rax
sar    $0x17,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_masked_bytes>:
lea    0xff0001(%rdi),%rax
sar    $0x17,%rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @count_masked_bytes(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add nsw i64 16711681, %4
%6 = ashr i64 %5, 23
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %2
%9 = and i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @count_masked_bytes(i64 %0) {
%2 = add nsw i64 %0, 16711681
%3 = ashr i64 %2, 23
%4 = and i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int_clbk(void *elem, void *data) { printf("%d\n", *(int *)elem); }


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

x86 assembly (clang, -O2):
<print_int_clbk>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_int_clbk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_int_clbk(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int node_flash(int counter, int *output) {
  *output = (counter < 5);
  return 1;
}


x86 assembly (clang, -O0):
<node_flash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_flash>:
xor    %eax,%eax
cmp    $0x5,%edi
setl   %al
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @node_flash(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 5
%4 = zext i1 %3 to i32
store i32 %4, i32* %1
ret i32 1
}
int qsort_cmp__uint(const void *x, const void *y) {
  if (*((unsigned int *)x) > *((unsigned int *)y))
    return (-1);
  else
    return (*((unsigned int *)x) < *((unsigned int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp__uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jbe    112a <qsort_cmp__uint+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp__uint+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp__uint>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setb   %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp__uint(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp ugt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp ult i32 %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qsort_cmp__uint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ugt i32 %4, %6
%8 = icmp ult i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
unsigned int foo(void) { return sizeof((int[]){}); }


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

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
__attribute__((no)) int function1(int x) { return x; }


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

x86 assembly (clang, -O2):
<function1>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @function1(i32 returned %0) {
ret i32 %0
}
float math_degrees_to_radians(float f) { return f * (3.14159265 / 180.0); }


x86 assembly (clang, -O0):
<math_degrees_to_radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_degrees_to_radians>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @math_degrees_to_radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3F91DF46A1FAE712
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @math_degrees_to_radians(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3F91DF46A1FAE712
%4 = fptrunc double %3 to float
ret float %4
}
void testClosureFBrV(void (*closure)(float, char), float a1, char a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureFBrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movsbl -0xd(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFBrV>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureFBrV(void (float, i8)* %0, float %1, i8 signext %2) {
%4 = alloca void (float, i8)*
%5 = alloca float
%6 = alloca i8
store void (float, i8)* %0, void (float, i8)** %4
store float %1, float* %5
store i8 %2, i8* %6
%7 = load void (float, i8)*, void (float, i8)** %4
%8 = load float, float* %5
%9 = load i8, i8* %6
ret void
}

LLVM IR (-O2):
define void @testClosureFBrV(void (float, i8)* nocapture %0, float %1, i8 signext %2) {
tail call void %0(float %1, i8 signext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(void) { test(2126753390); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7ec3ae6e,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7ec3ae6e,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test(i32 2126753390)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 2126753390)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_char_vec(char *vec) { free(vec); }


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

x86 assembly (clang, -O2):
<free_char_vec>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_char_vec(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void mus_bint_to_char(unsigned char *j, int x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[0];
  j[1] = ox[1];
  j[2] = ox[2];
  j[3] = ox[3];
}


x86 assembly (clang, -O0):
<mus_bint_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_bint_to_char>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mus_bint_to_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast i32* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
ret void
}

LLVM IR (-O2):
define void @mus_bint_to_char(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = lshr i32 %1, 24
%9 = trunc i32 %8 to i8
store i8 %3, i8* %0
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %9, i8* %12
ret void
}
char *clean_string(char *string) {
  register unsigned i;
  i = 0;
  while (string[i] == ' ' && string[i] != '\0')
    i++;
  return &string[i];
}


x86 assembly (clang, -O0):
<clean_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
jne    113c <clean_string+0x3c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114c <clean_string+0x4c>
jmp    115a <clean_string+0x5a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clean_string+0xf>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_string>:
mov    %rdi,%rax
mov    $0xffffffff,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
cmpb   $0x20,(%rax,%rcx,1)
je     1110 <clean_string+0x10>
mov    %ecx,%ecx
add    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @clean_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %20
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %12, %4
%21 = phi i1 [ false, %4 ], [ %19, %12 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i32, i32* %3
%24 = add i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %20
%26 = load i8*, i8** %2
%27 = load i32, i32* %3
%28 = zext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
ret i8* %29
}

LLVM IR (-O2):
define i8* @clean_string(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
%8 = add i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
%10 = zext i32 %3 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
main() { printf("31=%d 'a'='%c'\n", 31, 'a'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1f,%esi
mov    $0x61,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"31=%d 'a'='%c'\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 31, i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"31=%d 'a'='%c'\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 31, i8 signext 97)
ret i32 0
}
int testFun(struct module *mod, const char *name, int val) {
  int (*ifunv)() = module_getsym(mod, name);
  if (!ifunv) {
    printf("ERROR: Can't find %s\n", name);
  }
  return ifunv() == val;
}


x86 assembly (clang, -O0):
<testFun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <module_getsym@plt>
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <testFun+0x45>
mov    -0x10(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   *-0x20(%rbp)
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFun>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <module_getsym@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1148 <testFun+0x28>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movslq %ebp,%rcx
xor    %eax,%eax
call   *%rcx
xor    %ecx,%ecx
cmp    %r14d,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.module = type opaque
@.str = [22 x i8] c"ERROR: Can't find %s\0A\00"
define i32 @testFun(%struct.module* %0, i8* %1, i32 %2) {
%4 = alloca %struct.module*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32 (...)*
store %struct.module* %0, %struct.module** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.module*, %struct.module** %4
%9 = load i8*, i8** %5
%10 = call i32 (%struct.module*, i8*, ...) bitcast (i32 (...)* @module_getsym to i32 (%struct.module*, i8*, ...)*)(%struct.module* %8, i8* %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32 (...)*
store i32 (...)* %12, i32 (...)** %7
%13 = load i32 (...)*, i32 (...)** %7
%14 = icmp ne i32 (...)* %13, null
br i1 %14, label %18, label %15
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %3
%19 = load i32 (...)*, i32 (...)** %7
%20 = call i32 (...) %19()
%21 = load i32, i32* %6
%22 = icmp eq i32 %20, %21
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
%struct.module = type opaque
@.str = [22 x i8] c"ERROR: Can't find %s\0A\00"
define i32 @testFun(%struct.module* %0, i8* %1, i32 %2) {
%4 = tail call i32 (%struct.module*, i8*, ...) bitcast (i32 (...)* @module_getsym to i32 (%struct.module*, i8*, ...)*)(%struct.module* %0, i8* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %3
%9 = sext i32 %4 to i64
%10 = inttoptr i64 %9 to i32 (...)*
%11 = tail call i32 (...) %10()
%12 = icmp eq i32 %11, %2
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
struct event {
  int dummy;
};
typedef int /*<<< orphan*/ strBuff;

/* Variables and functions */
int AMCEvent_DumpString(struct event *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int AMCEvent_DumpStdout(struct event *event) {
  int ret;
  char strBuff[128];
  ret = AMCEvent_DumpString(event, strBuff, sizeof(strBuff));
  printf("%s\n", strBuff);
  return (ret < 0) ? -1 : 0;
}


x86 assembly (clang, -O0):
<AMCEvent_DumpStdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1030 <AMCEvent_DumpString@plt>
mov    %eax,-0xc(%rbp)
lea    -0x90(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCEvent_DumpStdout>:
push   %rbp
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x80,%edx
call   1030 <AMCEvent_DumpString@plt>
mov    %eax,%ebp
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
sar    $0x1f,%ebp
mov    %ebp,%eax
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.event = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define i32 @AMCEvent_DumpStdout(%struct.event* %0) {
%2 = alloca %struct.event*
%3 = alloca i32
%4 = alloca [128 x i8]
store %struct.event* %0, %struct.event** %2
%5 = load %struct.event*, %struct.event** %2
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%7 = call i32 @AMCEvent_DumpString(%struct.event* %5, i8* %6, i32 128)
store i32 %7, i32* %3
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 0
ret i32 %13
}

LLVM IR (-O2):
%struct.event = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define i32 @AMCEvent_DumpStdout(%struct.event* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @AMCEvent_DumpString(%struct.event* %0, i8* %3, i32 128)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = ashr i32 %4, 31
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Git!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello Git!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Hello Git!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void av_d2q() {}


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

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

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

LLVM IR (-O2):
define void @av_d2q() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void cmatrixfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<cmatrixfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @cmatrixfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int, int);
int /*<<< orphan*/ barfoo(int, int);
int /*<<< orphan*/ foo(int, int);
int /*<<< orphan*/ foobar(int, int);
int main() {
  foo(12, 120);
  foobar(23, 230);
  barfoo(34, 340);
  bar(45, 450);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
mov    $0x78,%esi
call   1060 <foo@plt>
mov    $0x17,%edi
mov    $0xe6,%esi
call   1040 <foobar@plt>
mov    $0x22,%edi
mov    $0x154,%esi
call   1050 <barfoo@plt>
mov    $0x2d,%edi
mov    $0x1c2,%esi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
mov    $0x78,%esi
call   1060 <foo@plt>
mov    $0x17,%edi
mov    $0xe6,%esi
call   1040 <foobar@plt>
mov    $0x22,%edi
mov    $0x154,%esi
call   1050 <barfoo@plt>
mov    $0x2d,%edi
mov    $0x1c2,%esi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 12, i32 120)
%2 = call i32 @foobar(i32 23, i32 230)
%3 = call i32 @barfoo(i32 34, i32 340)
%4 = call i32 @bar(i32 45, i32 450)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 12, i32 120)
%2 = tail call i32 @foobar(i32 23, i32 230)
%3 = tail call i32 @barfoo(i32 34, i32 340)
%4 = tail call i32 @bar(i32 45, i32 450)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ columnround(int /*<<< orphan*/ *);
int /*<<< orphan*/ rowround(int /*<<< orphan*/ *);
void doubleround(uint32_t *a) {
  columnround(a);
  rowround(a);
}


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

x86 assembly (clang, -O2):
<doubleround>:
push   %rbx
mov    %rdi,%rbx
call   1030 <columnround@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rowround@plt>

LLVM IR (-O0):
define void @doubleround(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @columnround(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @rowround(i32* %5)
ret void
}

LLVM IR (-O2):
define void @doubleround(i32* %0) {
%2 = tail call i32 @columnround(i32* %0)
%3 = tail call i32 @rowround(i32* %0)
ret void
}
unsigned int instr_util_ustuffu8(unsigned int byte3, unsigned int byte2,
                                 unsigned int byte1, unsigned int byte0) {
  unsigned int retval;
  retval = ((byte3 << 24) & 0xff000000);
  retval |= ((byte2 << 16) & 0x00ff0000);
  retval |= ((byte1 << 8) & 0x0000ff00);
  retval |= (byte0 & 0x000000ff);
  return retval;
}


x86 assembly (clang, -O0):
<instr_util_ustuffu8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
and    $0xff0000,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr_util_ustuffu8>:
shl    $0x18,%edi
movzbl %sil,%eax
shl    $0x10,%eax
or     %edi,%eax
shl    $0x8,%edx
movzwl %dx,%edx
or     %eax,%edx
movzbl %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @instr_util_ustuffu8(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = shl i32 %10, 24
%12 = and i32 %11, -16777216
store i32 %12, i32* %9
%13 = load i32, i32* %6
%14 = shl i32 %13, 16
%15 = and i32 %14, 16711680
%16 = load i32, i32* %9
%17 = or i32 %16, %15
store i32 %17, i32* %9
%18 = load i32, i32* %7
%19 = shl i32 %18, 8
%20 = and i32 %19, 65280
%21 = load i32, i32* %9
%22 = or i32 %21, %20
store i32 %22, i32* %9
%23 = load i32, i32* %8
%24 = and i32 %23, 255
%25 = load i32, i32* %9
%26 = or i32 %25, %24
store i32 %26, i32* %9
%27 = load i32, i32* %9
ret i32 %27
}

LLVM IR (-O2):
define i32 @instr_util_ustuffu8(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 24
%6 = shl i32 %1, 16
%7 = and i32 %6, 16711680
%8 = or i32 %7, %5
%9 = shl i32 %2, 8
%10 = and i32 %9, 65280
%11 = or i32 %8, %10
%12 = and i32 %3, 255
%13 = or i32 %11, %12
ret i32 %13
}
unsigned int BSP_GetHsicEnumStatus(void) { return 0; }


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

x86 assembly (clang, -O2):
<BSP_GetHsicEnumStatus>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @BSP_GetHsicEnumStatus() {
ret i32 0
}

LLVM IR (-O2):
define i32 @BSP_GetHsicEnumStatus() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = 42;
  unsigned long pa = (unsigned long)&a;
  double da = (double)pa;
  unsigned long pa1 = (unsigned long)da;
  test_assert(*((int *)pa1) == a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movaps 0xecb(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xeca(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rax
movq   %rax,%xmm0
punpckldq 0xedd(%rip),%xmm0
subpd  0xee5(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
movl   $0x2a,0x4(%rsp)
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xecd(%rip),%xmm1
cvttsd2si %xmm1,%rdx
and    %rcx,%rdx
or     %rax,%rdx
xor    %edi,%edi
cmpl   $0x2a,(%rdx)
sete   %dil
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca double
%5 = alloca i64
store i32 0, i32* %1
store i32 42, i32* %2
%6 = ptrtoint i32* %2 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = uitofp i64 %7 to double
store double %8, double* %4
%9 = load double, double* %4
%10 = fptoui double %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = inttoptr i64 %11 to i32*
%13 = load i32, i32* %12
%14 = load i32, i32* %2
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @test_assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 42, i32* %1
%3 = ptrtoint i32* %1 to i64
%4 = uitofp i64 %3 to double
%5 = fptoui double %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 42
%9 = zext i1 %8 to i32
%10 = call i32 @test_assert(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _fwalk(int (*)());
void _cleanup() {
  extern int fclose();
  _fwalk(fclose);
}


x86 assembly (clang, -O0):
<_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <_fwalk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cleanup>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <_fwalk@plt>

LLVM IR (-O0):
define void @_cleanup() {
%1 = call i32 @_fwalk(i32 (...)* @fclose)
ret void
}

LLVM IR (-O2):
define void @_cleanup() {
%1 = tail call i32 @_fwalk(i32 (...)* @fclose)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_keyboard();
int /*<<< orphan*/ init_timer(int);
void irq_install() {
  asm volatile("sti");
  init_timer(50);
  init_keyboard();
}


x86 assembly (clang, -O0):
<irq_install>:
push   %rbp
mov    %rsp,%rbp
sti
mov    $0x32,%edi
call   1040 <init_timer@plt>
mov    $0x0,%al
call   1030 <init_keyboard@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_install>:
push   %rax
sti
mov    $0x32,%edi
call   1040 <init_timer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_keyboard@plt>

LLVM IR (-O0):
define void @irq_install() {
%1 = call i32 @init_timer(i32 50)
%2 = call i32 (...) @init_keyboard()
ret void
}

LLVM IR (-O2):
define void @irq_install() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 @init_timer(i32 50)
%2 = tail call i32 (...) @init_keyboard()
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct clause_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_shuffle(struct genlist *);
void clause_list_shuffle(struct clause_list *tthis) {
  genlist_shuffle((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<clause_list_shuffle>:
jmp    1030 <genlist_shuffle@plt>

LLVM IR (-O0):
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define void @clause_list_shuffle(%struct.clause_list* %0) {
%2 = alloca %struct.clause_list*
store %struct.clause_list* %0, %struct.clause_list** %2
%3 = load %struct.clause_list*, %struct.clause_list** %2
%4 = bitcast %struct.clause_list* %3 to %struct.genlist*
%5 = call i32 @genlist_shuffle(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.clause_list = type { i32 }
%struct.genlist = type { i32 }
define void @clause_list_shuffle(%struct.clause_list* %0) {
%2 = bitcast %struct.clause_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_shuffle(%struct.genlist* %2)
ret void
}
float *vec2_add(float *result, float *a, float *b) {
  result[0] = a[0] + b[0];
  result[1] = a[1] + b[1];
  return result;
}


x86 assembly (clang, -O0):
<vec2_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_add>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define float* @vec2_add(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
ret float* %25
}

LLVM IR (-O2):
define float* @vec2_add(float* returned writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret float* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_1(char *filename) {
  FILE *this = fopen(filename, "w");
  return this;
}


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

x86 assembly (clang, -O2):
<open_1>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i32* @open_1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
ret i32* %6
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i32* @open_1(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}