xunge/DecIR huggingface dataset:
/* Type definitions */
struct t_list {
  int dummy;
};

/* Variables and functions */
struct t_list *add_front(struct t_list *, int *, int);
struct t_list *add_front_int(struct t_list *plist, int num) {
  return plist = add_front(plist, &num, sizeof(int));
}


x86 assembly (clang, -O0):
<add_front_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <add_front@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_front_int>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <add_front@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_list = type { i32 }
define %struct.t_list* @add_front_int(%struct.t_list* %0, i32 %1) {
%3 = alloca %struct.t_list*
%4 = alloca i32
store %struct.t_list* %0, %struct.t_list** %3
store i32 %1, i32* %4
%5 = load %struct.t_list*, %struct.t_list** %3
%6 = call %struct.t_list* @add_front(%struct.t_list* %5, i32* %4, i32 4)
store %struct.t_list* %6, %struct.t_list** %3
ret %struct.t_list* %6
}

LLVM IR (-O2):
%struct.t_list = type { i32 }
define %struct.t_list* @add_front_int(%struct.t_list* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call %struct.t_list* @add_front(%struct.t_list* %0, i32* %3, i32 4)
ret %struct.t_list* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *argv[]) {
  fprintf(stderr,
          "Usage: %s [options]\n"
          "Options are:\n"
          "  -n, --no-daemon        stay in foreground, don't daemonize\n"
          "  -h, --help             print this help\n",
          argv[0]);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [136 x i8] c"Usage: %s [options]\0AOptions are:\0A -n, --no-daemon stay in foreground, don't daemonize\0A -h, --help print this help\0A\00"
define void @print_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 ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [136 x i8] c"Usage: %s [options]\0AOptions are:\0A -n, --no-daemon stay in foreground, don't daemonize\0A -h, --help print this help\0A\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_void() {
  printf("test_void\n");
  return;
  printf("test_void\n");
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"test_void\00"
define void @test_void() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void I2CSlaveAddressSet(uint32_t ui32Base, uint8_t ui8AddrNum,
                        uint8_t ui8SlaveAddr) {
  ;
  ;
  ;
  switch (ui8AddrNum) {
  case 0: {
    (*((volatile uint32_t *)(ui32Base + 0x00000800))) = ui8SlaveAddr;
    break;
  }
  case 1: {
    (*((volatile uint32_t *)(ui32Base + 0x0000081C))) =
        0x00000080 | ui8SlaveAddr;
    break;
  }
  }
}


x86 assembly (clang, -O0):
<I2CSlaveAddressSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1131 <I2CSlaveAddressSet+0x31>
jmp    1120 <I2CSlaveAddressSet+0x20>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1145 <I2CSlaveAddressSet+0x45>
jmp    115a <I2CSlaveAddressSet+0x5a>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x800,%eax
cltq
mov    %ecx,(%rax)
jmp    115a <I2CSlaveAddressSet+0x5a>
mov    -0xc(%rbp),%ecx
or     $0x80,%ecx
mov    -0x4(%rbp),%eax
add    $0x81c,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveAddressSet>:
test   %esi,%esi
je     1116 <I2CSlaveAddressSet+0x16>
cmp    $0x1,%esi
jne    1123 <I2CSlaveAddressSet+0x23>
or     $0x80,%edx
mov    $0x81c,%eax
jmp    111b <I2CSlaveAddressSet+0x1b>
mov    $0x800,%eax
mov    %eax,%eax
movslq %edi,%rcx
mov    %edx,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @I2CSlaveAddressSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
switch i32 %7, label %21 [
i32 0, label %8
i32 1, label %14
]
8: ; preds = %3
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 2048
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %9, i32* %13
br label %21
14: ; preds = %3
%15 = load i32, i32* %6
%16 = or i32 128, %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 2076
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %16, i32* %20
br label %21
21: ; preds = %3, %14, %8
ret void
}

LLVM IR (-O2):
define void @I2CSlaveAddressSet(i32 %0, i32 %1, i32 %2) {
switch i32 %1, label %12 [
i32 0, label %6
i32 1, label %4
]
4: ; preds = %3
%5 = or i32 %2, 128
br label %6
6: ; preds = %3, %4
%7 = phi i32 [ 2076, %4 ], [ 2048, %3 ]
%8 = phi i32 [ %5, %4 ], [ %2, %3 ]
%9 = add nsw i32 %7, %0
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %8, i32* %11
br label %12
12: ; preds = %6, %3
ret void
}
/* Variables and functions */
int rom_present(char *);
int gd5430_pci_available(void) {
  return rom_present(L"roms/video/cirruslogic/pci.bin");
}


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

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

LLVM IR (-O0):
@.str = [31 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 112, i32 99, i32 105, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @gd5430_pci_available() {
%1 = call i32 @rom_present(i8* bitcast ([31 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [31 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 112, i32 99, i32 105, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @gd5430_pci_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([31 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
double abs(double);
double UC_11_5_3(double M_v_s_d, double V_1_k_s_d, double V_2_k_s_d,
                 double F_v_d, double h_v) {
  return (abs(((M_v_s_d / h_v) + 0.5 * (V_1_k_s_d + V_2_k_s_d)) / F_v_d));
}


x86 assembly (clang, -O0):
<UC_11_5_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
divsd  -0x28(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
call   1030 <abs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UC_11_5_3>:
divsd  %xmm4,%xmm0
addsd  %xmm2,%xmm1
mulsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm3,%xmm0
jmp    1030 <abs@plt>

LLVM IR (-O0):
define double @UC_11_5_3(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %10
%13 = fdiv double %11, %12
%14 = load double, double* %7
%15 = load double, double* %8
%16 = fadd double %14, %15
%17 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %16, double %13)
%18 = load double, double* %9
%19 = fdiv double %17, %18
%20 = call double @abs(double %19)
ret double %20
}

LLVM IR (-O2):
define double @UC_11_5_3(double %0, double %1, double %2, double %3, double %4) {
%6 = fdiv double %0, %4
%7 = fadd double %1, %2
%8 = tail call double @llvm.fmuladd.f64(double %7, double 5.000000e-01, double %6)
%9 = fdiv double %8, %3
%10 = tail call double @abs(double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ t_algo();
int /*<<< orphan*/ t_list();
int /*<<< orphan*/ t_map();
int /*<<< orphan*/ t_queue();
int /*<<< orphan*/ t_set();
int /*<<< orphan*/ t_stack();
int /*<<< orphan*/ t_tree();
int /*<<< orphan*/ t_vector();
int main() {
  t_list();
  t_vector();
  t_tree();
  t_map();
  t_set();
  t_stack();
  t_queue();
  t_algo();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <t_list@plt>
mov    $0x0,%al
call   1060 <t_vector@plt>
mov    $0x0,%al
call   1080 <t_tree@plt>
mov    $0x0,%al
call   1070 <t_map@plt>
mov    $0x0,%al
call   1030 <t_set@plt>
mov    $0x0,%al
call   10a0 <t_stack@plt>
mov    $0x0,%al
call   1040 <t_queue@plt>
mov    $0x0,%al
call   1090 <t_algo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <t_list@plt>
xor    %eax,%eax
call   1060 <t_vector@plt>
xor    %eax,%eax
call   1080 <t_tree@plt>
xor    %eax,%eax
call   1070 <t_map@plt>
xor    %eax,%eax
call   1030 <t_set@plt>
xor    %eax,%eax
call   10a0 <t_stack@plt>
xor    %eax,%eax
call   1040 <t_queue@plt>
xor    %eax,%eax
call   1090 <t_algo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @t_list()
%3 = call i32 (...) @t_vector()
%4 = call i32 (...) @t_tree()
%5 = call i32 (...) @t_map()
%6 = call i32 (...) @t_set()
%7 = call i32 (...) @t_stack()
%8 = call i32 (...) @t_queue()
%9 = call i32 (...) @t_algo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @t_list()
%2 = tail call i32 (...) @t_vector()
%3 = tail call i32 (...) @t_tree()
%4 = tail call i32 (...) @t_map()
%5 = tail call i32 (...) @t_set()
%6 = tail call i32 (...) @t_stack()
%7 = tail call i32 (...) @t_queue()
%8 = tail call i32 (...) @t_algo()
ret i32 0
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int64_t value_from_index(int32_t index, int32_t sub_index, int32_t mag) {
  return ((int64_t)sub_index) << (index + mag);
}


x86 assembly (clang, -O0):
<value_from_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_from_index>:
mov    %esi,%eax
lea    (%rdi,%rdx,1),%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @value_from_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = add nsw i32 %8, %9
%11 = shl i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @value_from_index(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %0
%5 = shl i32 %1, %4
ret i32 %5
}
void gtk_icon_set_render_icon() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_set_render_icon() {
ret void
}
void free_convert_matrix(b, nrl, nrh, ncl, nch) float **b;
long nch, ncl, nrh, nrl;
{ free((char *)(b + nrl - 1)); }


x86 assembly (clang, -O0):
<free_convert_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_convert_matrix>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_convert_matrix(float** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca float**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store float** %0, float*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load float**, float*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds float*, float** %11, i64 %12
%14 = getelementptr inbounds float*, float** %13, i64 -1
%15 = bitcast float** %14 to i8*
ret void
}

LLVM IR (-O2):
define void @free_convert_matrix(float** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds float*, float** %0, i64 %1
%7 = getelementptr inbounds float*, float** %6, i64 -1
%8 = bitcast float** %7 to i8*
tail call void @free(i8* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  char buf[32];
  bzero(buf, 32);
  read(0, buf, 32);
  write(1, buf, 32);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x20,%esi
call   1050 <bzero@plt>
lea    -0x30(%rbp),%rsi
xor    %edi,%edi
mov    $0x20,%edx
call   1040 <read@plt>
lea    -0x30(%rbp),%rsi
mov    $0x1,%edi
mov    $0x20,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1050 <bzero@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1040 <read@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%8 = call i32 @bzero(i8* %7, i32 32)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%10 = call i32 @read(i32 0, i8* %9, i32 32)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%12 = call i32 @write(i32 1, i8* %11, i32 32)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @bzero(i8* %4, i32 32)
%6 = call i32 @read(i32 0, i8* %4, i32 32)
%7 = call i32 @write(i32 1, i8* %4, i32 32)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, long const);
bool cutils_cdar_DynamicArray_long_format(const long *i, char **b, size_t *s) {
  snprintf(*b, *s, "%ldl", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_long_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
lea    0xec0(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_long_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
mov    (%rdi),%rcx
lea    0xedf(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ldl\00"
define i32 @cutils_cdar_DynamicArray_long_format(i64* %0, i8** %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i8**
%6 = alloca i64*
store i64* %0, i64** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = load i64*, i64** %4
%12 = load i64, i64* %11
%13 = call i32 @snprintf(i8* %8, i64 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ldl\00"
define i32 @cutils_cdar_DynamicArray_long_format(i64* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load i64, i64* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i32 1
}
/* Variables and functions */
int INT_MIN;
int test2(int x) { return x + INT_MIN; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
add    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @INT_MIN
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test2(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int *allocc(int, int, int);
int *allocpermclause(int inst, int len) { return allocc(inst, len, 1); }


x86 assembly (clang, -O0):
<allocpermclause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <allocc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocpermclause>:
mov    $0x1,%edx
jmp    1030 <allocc@plt>

LLVM IR (-O0):
define i32* @allocpermclause(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 = load i32, i32* %4
%7 = call i32* @allocc(i32 %5, i32 %6, i32 1)
ret i32* %7
}

LLVM IR (-O2):
define i32* @allocpermclause(i32 %0, i32 %1) {
%3 = tail call i32* @allocc(i32 %0, i32 %1, i32 1)
ret i32* %3
}
void set_flag(int *flag, int val) { __atomic_store_n(flag, val, 3); }


x86 assembly (clang, -O0):
<set_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @set_flag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
store i32 %7, i32* %5
%8 = load i32, i32* %5
store atomic i32 %8, i32* %6 release
ret void
}

LLVM IR (-O2):
define void @set_flag(i32* nocapture writeonly %0, i32 %1) {
store atomic i32 %1, i32* %0 release
ret void
}
int test_imm_08int16_mem(short *val) {
  return ((*val) & (0x08 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_08int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_08int16_mem>:
testb  $0x8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_08int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_08int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 8
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned long foo() { return (unsigned long)-1 / 8; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movabs $0x1fffffffffffffff,%rax
ff ff 1f
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movabs $0x1fffffffffffffff,%rax
ff ff 1f
ret

LLVM IR (-O0):
define i64 @foo() {
ret i64 2305843009213693951
}

LLVM IR (-O2):
define i64 @foo() {
ret i64 2305843009213693951
}
int test_imm_04uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x04 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_04uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_04uint64_highword_mem>:
testb  $0x4,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_04uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 4
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_04uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 17179869184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int STDOUT_FILENO;
int octave_stdout_fileno(void) { return STDOUT_FILENO; }


x86 assembly (clang, -O0):
<octave_stdout_fileno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_stdout_fileno>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @octave_stdout_fileno() {
%1 = load i32, i32* @STDOUT_FILENO
ret i32 %1
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @octave_stdout_fileno() {
%1 = load i32, i32* @STDOUT_FILENO
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ bind_assert(int /*<<< orphan*/, char *);
void *malloc(size_t);
void *bind_safe_malloc(size_t c, size_t s) {
  void *ret = malloc(c * s);
  bind_assert(ret != NULL, "malloc failed");
  return ret;
}


x86 assembly (clang, -O0):
<bind_safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeaa(%rip),%rsi
call   1040 <bind_assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_safe_malloc>:
push   %rbx
imul   %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
lea    0xec3(%rip),%rsi
call   1040 <bind_assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"malloc failed\00"
define i8* @bind_safe_malloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @bind_assert(i32 %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"malloc failed\00"
define noalias i8* @bind_safe_malloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @bind_assert(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ greth_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  report_start();
  base_test();
  greth_test(0x80000e00);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <base_test@plt>
mov    $0x80000e00,%edi
call   1040 <greth_test@plt>
mov    $0x0,%al
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <base_test@plt>
mov    $0x80000e00,%edi
call   1040 <greth_test@plt>
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 (...) @base_test()
%3 = call i32 @greth_test(i32 -2147480064)
%4 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 @greth_test(i32 -2147480064)
%4 = tail call i32 (...) @report_end()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XFreeFontSet() {
  printf("XFreeFontSet called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"XFreeFontSet called\00"
define i32 @XFreeFontSet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int RSA2048_execute(int, char *);
int /*<<< orphan*/ printf(char *);
int RSA2048_Decrypt_STD(int fd) {
  int ret;
  ret = RSA2048_execute(fd, "BF12C00000");
  if (ret != 0) {
    printf("ERR:RSA2048_Decrypt_STD failed!\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<RSA2048_Decrypt_STD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <RSA2048_execute@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115a <RSA2048_Decrypt_STD+0x3a>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA2048_Decrypt_STD>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <RSA2048_execute@plt>
test   %eax,%eax
je     113d <RSA2048_Decrypt_STD+0x1d>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"BF12C00000\00"
@.str.1 = [33 x i8] c"ERR:RSA2048_Decrypt_STD failed!\0A\00"
define i32 @RSA2048_Decrypt_STD(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @RSA2048_execute(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"BF12C00000\00"
@str = [32 x i8] c"ERR:RSA2048_Decrypt_STD failed!\00"
define i32 @RSA2048_Decrypt_STD(i32 %0) {
%2 = tail call i32 @RSA2048_execute(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ report_status(char *);
void report_ptr(void *ptr) {
  char *string;
  if (ptr == NULL)
    asprintf(&string, "NULL");
  else
    asprintf(&string, "%p", ptr);
  report_status(string);
  free(string);
}


x86 assembly (clang, -O0):
<report_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <report_ptr+0x2e>
lea    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
jmp    1174 <report_ptr+0x44>
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <report_status@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_ptr>:
push   %rax
test   %rdi,%rdi
je     114c <report_ptr+0x1c>
mov    %rdi,%rdx
lea    0xec5(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1050 <asprintf@plt>
jmp    115d <report_ptr+0x2d>
lea    0xead(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1050 <asprintf@plt>
mov    (%rsp),%rdi
call   1040 <report_status@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"NULL\00"
@.str.1 = [3 x i8] c"%p\00"
define void @report_ptr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8**, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 (i8**, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %6
%12 = load i8*, i8** %3
%13 = call i32 @report_status(i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"NULL\00"
@.str.1 = [3 x i8] c"%p\00"
define void @report_ptr(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8**, i8*, ...) @asprintf(i8** %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 (i8**, i8*, ...) @asprintf(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %5
%10 = load i8*, i8** %2
%11 = call i32 @report_status(i8* %10)
%12 = load i8*, i8** %2
%13 = call i32 @free(i8* %12)
ret void
}
void ErrorManage() {}


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

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

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

LLVM IR (-O2):
define void @ErrorManage() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_value(int, int);
void module_led_on(void) { gpio_set_value(5, 1); }


x86 assembly (clang, -O0):
<module_led_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x1,%esi
call   1030 <gpio_set_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_led_on>:
mov    $0x5,%edi
mov    $0x1,%esi
jmp    1030 <gpio_set_value@plt>

LLVM IR (-O0):
define void @module_led_on() {
%1 = call i32 @gpio_set_value(i32 5, i32 1)
ret void
}

LLVM IR (-O2):
define void @module_led_on() {
%1 = tail call i32 @gpio_set_value(i32 5, i32 1)
ret void
}
int canBeep(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @canBeep() {
ret i32 0
}
int Pty_Destroy(struct Pty *pty) { return 1; }


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

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

LLVM IR (-O0):
%struct.Pty = type opaque
define i32 @Pty_Destroy(%struct.Pty* %0) {
%2 = alloca %struct.Pty*
store %struct.Pty* %0, %struct.Pty** %2
ret i32 1
}

LLVM IR (-O2):
%struct.Pty = type opaque
define i32 @Pty_Destroy(%struct.Pty* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free2d(void **a) {
  void **row;
  for (row = a; *row != 0; row++) {
    free(*row);
  }
  free(a);
}


x86 assembly (clang, -O0):
<free2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <free2d+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <free2d+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2d>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free2d+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free2d+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free2d(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 = %14, %1
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = bitcast i8* %11 to i8**
%13 = call i32 @free(i8** %12)
br label %14
14: ; preds = %9
%15 = load i8**, i8*** %3
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %3
br label %5
17: ; preds = %5
%18 = load i8**, i8*** %2
%19 = call i32 @free(i8** %18)
ret void
}

LLVM IR (-O2):
define void @free2d(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %2, %1 ]
%6 = phi i8** [ %9, %4 ], [ %0, %1 ]
%7 = bitcast i8* %5 to i8**
%8 = tail call i32 @free(i8** %7)
%9 = getelementptr inbounds i8*, i8** %6, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @free(i8** %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getFrSkyTelemetryProviderBaudRate(void) { return 9600; }


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

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

LLVM IR (-O0):
define i32 @getFrSkyTelemetryProviderBaudRate() {
ret i32 9600
}

LLVM IR (-O2):
define i32 @getFrSkyTelemetryProviderBaudRate() {
ret i32 9600
}
/* Variables and functions */
double exp(int);
int log(double);
double cbrt(double num) { return exp(log(num) / 3); }


x86 assembly (clang, -O0):
<cbrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrt>:
push   %rax
call   1040 <log@plt>
cltq
imul   $0x55555556,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
shr    $0x20,%rdi
add    %eax,%edi
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @cbrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @log(double %3)
%5 = sdiv i32 %4, 3
%6 = call double @exp(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @cbrt(double %0) {
%2 = tail call i32 @log(double %0)
%3 = sdiv i32 %2, 3
%4 = tail call double @exp(i32 %3)
ret double %4
}
/* Variables and functions */
short shftc_h(short *, short *, short *);
short intr_wrap_568(short p1, short p2, short p3) {
  return shftc_h(&p1, &p2, &p3);
}


x86 assembly (clang, -O0):
<intr_wrap_568>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x6(%rbp),%rdx
call   1030 <shftc_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_568>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
mov    %dx,0x2(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
lea    0x2(%rsp),%rdx
call   1030 <shftc_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_568(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = call signext i16 @shftc_h(i16* %4, i16* %5, i16* %6)
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @intr_wrap_568(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = call signext i16 @shftc_h(i16* %4, i16* %5, i16* %6)
ret i16 %7
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short, int);
int umask(int);
void test_umask(const mode_t mode) {
  mode_t rc = umask(0xffff0000 | mode);
  printf("umask(%#03ho) = %#03o\n", (unsigned short)mode, rc);
}


x86 assembly (clang, -O0):
<test_umask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0xffff0000,%edi
call   1040 <umask@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
movzwl %ax,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_umask>:
push   %rbx
mov    %edi,%ebx
or     $0xffff0000,%edi
call   1040 <umask@plt>
movzwl %bx,%esi
lea    0xec8(%rip),%rdi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"umask(%ho) = %o\0A\00"
define void @test_umask(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = or i32 -65536, %4
%6 = call i32 @umask(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i16
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 zeroext %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"umask(%ho) = %o\0A\00"
define void @test_umask(i32 %0) {
%2 = or i32 %0, -65536
%3 = tail call i32 @umask(i32 %2)
%4 = trunc i32 %0 to i16
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 zeroext %4, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sysfatal(char *);
void usage(void) {
  sysfatal("Usage: goc2c [--go-pkgpath PKGPATH] [--go-prefix PREFIX] [file]\n");
}


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

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

LLVM IR (-O0):
@.str = [65 x i8] c"Usage: goc2c [--go-pkgpath PKGPATH] [--go-prefix PREFIX] [file]\0A\00"
define void @usage() {
%1 = call i32 @sysfatal(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"Usage: goc2c [--go-pkgpath PKGPATH] [--go-prefix PREFIX] [file]\0A\00"
define void @usage() {
%1 = tail call i32 @sysfatal(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int minSplitNumber(int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int res = minSplitNumber(5, 4, 12, 0);
  printf("Res is %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
mov    $0x4,%esi
mov    $0xc,%edx
xor    %ecx,%ecx
call   1030 <minSplitNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x4,%esi
mov    $0xc,%edx
xor    %ecx,%ecx
call   1030 <minSplitNumber@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Res is %d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @minSplitNumber(i32 5, i32 4, i32 12, i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Res is %d\00"
define void @main() {
%1 = tail call i32 @minSplitNumber(i32 5, i32 4, i32 12, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sample_func() { printf("Hello World!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @sample_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mysub(void) {
  int x;
  printf("%d\n", x);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @mysub() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
ret void
}
void info(const char *msg __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @info(i8* nocapture %0) {
ret void
}
void retro_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @retro_reset() {
ret void
}
int main() { return (((~(unsigned)0) >> 1) - 1) == -1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ finish();
GS_step12() { finish(); }


x86 assembly (clang, -O0):
<GS_step12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <finish@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @GS_step12() {
%1 = alloca i32
%2 = call i32 (...) @finish()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @GS_step12() {
%1 = tail call i32 (...) @finish()
ret i32 undef
}
char *savestring(input, size) const char *input;
unsigned int size;
{
  char *output = (char *)xmalloc(size + 1);
  strcpy(output, input);
  return output;
}


x86 assembly (clang, -O0):
<savestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1040 <xmalloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestring>:
push   %rbx
mov    %rdi,%rbx
lea    0x1(%rsi),%edi
xor    %eax,%eax
call   1040 <xmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @savestring(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add i32 %6, 1
%8 = call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = call i8* @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @savestring(i8* nocapture %0, i32 %1) {
%3 = add i32 %1, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
/* Type definitions */
struct stack_st_OPENSSL_STRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_pop(int /*<<< orphan*/ *);
char *sk_OPENSSL_STRING_pop(struct stack_st_OPENSSL_STRING *sk) {
  return (char *)OPENSSL_sk_pop((OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_STRING_pop>:
jmp    1030 <OPENSSL_sk_pop@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i8* @sk_OPENSSL_STRING_pop(%struct.stack_st_OPENSSL_STRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_STRING*
store %struct.stack_st_OPENSSL_STRING* %0, %struct.stack_st_OPENSSL_STRING** %2
%3 = load %struct.stack_st_OPENSSL_STRING*, %struct.stack_st_OPENSSL_STRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_STRING* %3 to i32*
%5 = call i64 @OPENSSL_sk_pop(i32* %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i8* @sk_OPENSSL_STRING_pop(%struct.stack_st_OPENSSL_STRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_STRING, %struct.stack_st_OPENSSL_STRING* %0, i64 0, i32 0
%3 = tail call i64 @OPENSSL_sk_pop(i32* %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}