xunge/DecIR huggingface dataset:
int test_imm_FCuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xFC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FCuint64_highword_reg>:
movabs $0xfc00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FCuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1082331758592
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x0b() {
  Assert_real((isodigit(11) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              60, ("isodigit should be 0 for 0x0b"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x0b>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3c,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x0b>:
push   %rax
mov    $0xb,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3c,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x0b\00"
define void @t_isodigit_0x0b() {
%1 = call i64 @isodigit(i32 11)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x0b\00"
define void @t_isodigit_0x0b() {
%1 = tail call i64 @isodigit(i32 11)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float rsqrt(float n) {
  void *v;
  int i;
  float x2;
  x2 = n * 0.5F;
  v = &n;
  i = *(int *)v;
  i = 0x5f3759df - (i >> 1);
  v = &i;
  n = *(float *)v;
  n = n * (1.5F - (x2 * n * n));
  return n;
}


x86 assembly (clang, -O0):
<rsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe82(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @rsqrt(float %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca i32
%5 = alloca float
store float %0, float* %2
%6 = load float, float* %2
%7 = fmul float %6, 5.000000e-01
store float %7, float* %5
%8 = bitcast float* %2 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = ashr i32 %12, 1
%14 = sub nsw i32 1597463007, %13
store i32 %14, i32* %4
%15 = bitcast i32* %4 to i8*
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = bitcast i8* %16 to float*
%18 = load float, float* %17
store float %18, float* %2
%19 = load float, float* %2
%20 = load float, float* %5
%21 = load float, float* %2
%22 = fmul float %20, %21
%23 = load float, float* %2
%24 = fneg float %22
%25 = call float @llvm.fmuladd.f32(float %24, float %23, float 1.500000e+00)
%26 = fmul float %19, %25
store float %26, float* %2
%27 = load float, float* %2
ret float %27
}

LLVM IR (-O2):
define float @rsqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
int b4(int index) { return ((int *)01000000)[index]; }


x86 assembly (clang, -O0):
<b4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    $0x40000,%eax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b4>:
movslq %edi,%rax
mov    0x40000(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @b4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* inttoptr (i64 262144 to i32*), i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @b4(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds i32, i32* inttoptr (i64 262144 to i32*), i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ check_args(int);
int /*<<< orphan*/ print_usage();
int main(int argc, char *argv[]) {
  if (!check_args(argc)) {
    print_usage();
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <check_args@plt>
cmp    $0x0,%eax
jne    115a <main+0x3a>
mov    $0x0,%al
call   1040 <print_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1161 <main+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <check_args@plt>
test   %eax,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
call   1040 <print_usage@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_args(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @print_usage()
br label %7
7: ; preds = %2, %5
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int kmul_o_s32_p_23(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a, b;
  a = atoi(argv[1]);
  b = kmul_o_s32_p_23(a);
  printf("b = %d\n", b);
  return b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <kmul_o_s32_p_23@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <kmul_o_s32_p_23@plt>
mov    %eax,%ebx
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"b = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @kmul_o_s32_p_23(i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@.str = [8 x i8] c"b = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @kmul_o_s32_p_23(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(int x) { printf("%d\n", x); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
unsigned long long rotl64(unsigned long long, int);
uint64_t hash64_mix_tail(uint64_t x, uint64_t y) {
  x = rotl64(x * 14029467366897019727ULL, 31) * 11400714785074694791ULL;
  return y ^ x;
}


x86 assembly (clang, -O0):
<hash64_mix_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xc2b2ae3d27d4eb4f,%rdi
ae b2 c2
imul   -0x8(%rbp),%rdi
mov    $0x1f,%esi
call   1030 <rotl64@plt>
movabs $0x9e3779b185ebca87,%rcx
79 37 9e
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
xor    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash64_mix_tail>:
push   %rbx
mov    %rsi,%rbx
movabs $0xc2b2ae3d27d4eb4f,%rax
ae b2 c2
imul   %rax,%rdi
mov    $0x1f,%esi
call   1030 <rotl64@plt>
movabs $0x9e3779b185ebca87,%rcx
79 37 9e
imul   %rcx,%rax
xor    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @hash64_mix_tail(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = mul i64 %5, -4417276706812531889
%7 = call i64 @rotl64(i64 %6, i32 31)
%8 = mul i64 %7, -7046029288634856825
store i64 %8, i64* %3
%9 = load i64, i64* %4
%10 = load i64, i64* %3
%11 = xor i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @hash64_mix_tail(i64 %0, i64 %1) {
%3 = mul i64 %0, -4417276706812531889
%4 = tail call i64 @rotl64(i64 %3, i32 31)
%5 = mul i64 %4, -7046029288634856825
%6 = xor i64 %5, %1
ret i64 %6
}
/* Variables and functions */
int ENODEV;
int psp_check_tee_status(void) { return -ENODEV; }


x86 assembly (clang, -O0):
<psp_check_tee_status>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @psp_check_tee_status() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @psp_check_tee_status() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}
unsigned addval_136(unsigned x) { return x + 3374367113U; }


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

x86 assembly (clang, -O2):
<addval_136>:
lea    -0x36df3e77(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_136(i32 %0) {
%2 = add i32 %0, -920600183
ret i32 %2
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int getopt(int, char **, char *);
int get_next_option(int argc, char *argv[], char *optstring,
                    struct option *long_opts) {
  char *name_string;
  return getopt(argc, argv, optstring);
}


x86 assembly (clang, -O0):
<get_next_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <getopt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_option>:
jmp    1030 <getopt@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @get_next_option(i32 %0, i8** %1, i8* %2, %struct.option* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca %struct.option*
%9 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store %struct.option* %3, %struct.option** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load i8*, i8** %7
%13 = call i32 @getopt(i32 %10, i8** %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @get_next_option(i32 %0, i8** %1, i8* %2, %struct.option* nocapture readnone %3) {
%5 = tail call i32 @getopt(i32 %0, i8** %1, i8* %2)
ret i32 %5
}
/* Variables and functions */
unsigned char *flag_table_3_4_location(unsigned char **);
int set_flag_table_3_4(unsigned char **sec, unsigned int flag) {
  unsigned char *p;
  p = flag_table_3_4_location(sec);
  if (p == NULL)
    return 1;
  *p = flag;
  return 0;
}


x86 assembly (clang, -O0):
<set_flag_table_3_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <flag_table_3_4_location@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1143 <set_flag_table_3_4+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1155 <set_flag_table_3_4+0x45>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_flag_table_3_4>:
push   %rbx
mov    %esi,%ebx
call   1030 <flag_table_3_4_location@plt>
test   %rax,%rax
je     1123 <set_flag_table_3_4+0x13>
mov    %bl,(%rax)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @set_flag_table_3_4(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
%7 = load i8**, i8*** %4
%8 = call i8* @flag_table_3_4_location(i8** %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %16
12: ; preds = %2
%13 = load i32, i32* %5
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %6
store i8 %14, i8* %15
store i32 0, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @set_flag_table_3_4(i8** %0, i32 %1) {
%3 = tail call i8* @flag_table_3_4_location(i8** %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
store i8 %6, i8* %3
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Array1();
int main() {
  Array1();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Array1@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Array1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read(int, unsigned int *, int);
unsigned check_ack(int fd) {
  unsigned data;
  read(fd, &data, 4);
  if ((data == 0xc1a0c1a0)) {
    return 0;
  }
  return data;
}


x86 assembly (clang, -O0):
<check_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
cmpl   $0xc1a0c1a0,-0xc(%rbp)
jne    1145 <check_ack+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114b <check_ack+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ack>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    0x4(%rsp),%ecx
xor    %eax,%eax
cmp    $0xc1a0c1a0,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @check_ack(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @read(i32 %5, i32* %4, i32 4)
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1046429280
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @check_ack(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @read(i32 %0, i32* %2, i32 4)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1046429280
%7 = select i1 %6, i32 0, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float x, a;
  scanf("%f", &x);
  scanf("%f", &a);
  if (x > a) {
    printf("x bolshe, chem a\n");
  } else {
    printf("x ne bolshe, chem a\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    116f <main+0x4f>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x5b>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0x8(%rsp),%xmm0
lea    0xebf(%rip),%rax
lea    0xea4(%rip),%rdi
cmova  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [18 x i8] c"x bolshe, chem a\0A\00"
@.str.2 = [21 x i8] c"x ne bolshe, chem a\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = load float, float* %2
%7 = load float, float* %3
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@str = [20 x i8] c"x ne bolshe, chem a\00"
@str.3 = [17 x i8] c"x bolshe, chem a\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = fcmp ogt float %7, %8
%10 = select i1 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}
int do_649() { return 649; }


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

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

LLVM IR (-O0):
define i32 @do_649() {
ret i32 649
}

LLVM IR (-O2):
define i32 @do_649() {
ret i32 649
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void signalhandler(int signumber) { printf("signal %d.;\n", signumber); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"signal %d.;\0A\00"
define void @signalhandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v;

/* Variables and functions */
int *malloc(int);
int *mallocValue(int v) {
  int *ret = malloc(sizeof(v));
  *ret = v;
  return ret;
}


x86 assembly (clang, -O0):
<mallocValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocValue>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @mallocValue(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %3
%5 = load i32, i32* %2
%6 = load i32*, i32** %3
store i32 %5, i32* %6
%7 = load i32*, i32** %3
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @mallocValue(i32 %0) {
%2 = tail call i32* @malloc(i32 4)
store i32 %0, i32* %2
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
void my_putstr(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    my_putchar(str[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <my_putstr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <my_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <my_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <my_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <my_putstr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @my_putstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext 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 ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @my_putchar(i8 signext %17)
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @my_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @my_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
float g(float x) { return 3 * x * x + 2; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xed9(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
addss  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define float @g(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 3.000000e+00, %3
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float %4, float %5, float 2.000000e+00)
ret float %6
}

LLVM IR (-O2):
define float @g(float %0) {
%2 = fmul float %0, 3.000000e+00
%3 = tail call float @llvm.fmuladd.f32(float %2, float %0, float 2.000000e+00)
ret float %3
}
int parseToIntCelsius(int fahr) { return (fahr - 32) * 5 / 9; }


x86 assembly (clang, -O0):
<parseToIntCelsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseToIntCelsius>:
lea    (%rdi,%rdi,4),%eax
add    $0xffffff60,%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @parseToIntCelsius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = mul nsw i32 %4, 5
%6 = sdiv i32 %5, 9
ret i32 %6
}

LLVM IR (-O2):
define i32 @parseToIntCelsius(i32 %0) {
%2 = mul i32 %0, 5
%3 = add i32 %2, -160
%4 = sdiv i32 %3, 9
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
struct acia_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ acia_control_write(struct acia_state *, int);
void acia_configure(struct acia_state *as, uint8_t cr) {
  acia_control_write(as, 3);
  acia_control_write(as, cr);
}


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

x86 assembly (clang, -O2):
<acia_configure>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x3,%esi
call   1030 <acia_control_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <acia_control_write@plt>

LLVM IR (-O0):
%struct.acia_state = type { i32 }
define void @acia_configure(%struct.acia_state* %0, i32 %1) {
%3 = alloca %struct.acia_state*
%4 = alloca i32
store %struct.acia_state* %0, %struct.acia_state** %3
store i32 %1, i32* %4
%5 = load %struct.acia_state*, %struct.acia_state** %3
%6 = call i32 @acia_control_write(%struct.acia_state* %5, i32 3)
%7 = load %struct.acia_state*, %struct.acia_state** %3
%8 = load i32, i32* %4
%9 = call i32 @acia_control_write(%struct.acia_state* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.acia_state = type { i32 }
define void @acia_configure(%struct.acia_state* %0, i32 %1) {
%3 = tail call i32 @acia_control_write(%struct.acia_state* %0, i32 3)
%4 = tail call i32 @acia_control_write(%struct.acia_state* %0, i32 %1)
ret void
}
int test_imm_77uint32_reg(unsigned int val) {
  return ((val) & (0x77 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_77uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x77,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_77uint32_reg>:
test   $0x77,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_77uint32_reg(i32 %0) {
%2 = and i32 %0, 119
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int str_startwith(const char *haystack, const char *word) {
  return (strncmp(haystack, word, strlen(word)) == 0);
}


x86 assembly (clang, -O0):
<str_startwith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_startwith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @str_startwith(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 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @str_startwith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t Now() {
  struct timespec ts;
  clock_gettime(CLOCK_REALTIME, &ts);
  return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<Now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Now>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i32 @Now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i32 @Now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
ret i32 %11
}
/* Variables and functions */
int test_if6(void) {
  if (0)
    return 0;
  return 'f';
}


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

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

LLVM IR (-O0):
define i32 @test_if6() {
ret i32 102
}

LLVM IR (-O2):
define i32 @test_if6() {
ret i32 102
}
int config_init(const char *file_name) {}


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

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

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

LLVM IR (-O2):
define i32 @config_init(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showWarning(char *msg) { printf("\033[;31;1m%s\033[0m", msg); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"\1B[;31;1m%s\1B[0m\00"
define void @showWarning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\1B[;31;1m%s\1B[0m\00"
define void @showWarning(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void CommDestroy(int channel_id) {
  if (msgctl(channel_id, IPC_RMID, NULL) == -1) {
    printf("Error! Failed to destroy message queue! \n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<CommDestroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <msgctl@plt>
cmp    $0xffffffff,%eax
jne    116f <CommDestroy+0x3f>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommDestroy>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <msgctl@plt>
cmp    $0xffffffff,%eax
je     1148 <CommDestroy+0x18>
pop    %rax
ret
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [42 x i8] c"Error! Failed to destroy message queue! \0A\00"
define void @CommDestroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @msgctl(i32 %3, i32 %4, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@str = [41 x i8] c"Error! Failed to destroy message queue! \00"
define void @CommDestroy(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @msgctl(i32 %0, i32 %2, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *int_cloner(void *int_v) {
  void *ret = malloc(sizeof(int));
  memcpy(ret, int_v, sizeof(int));
  return ret;
}


x86 assembly (clang, -O0):
<int_cloner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_cloner>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @int_cloner(i8* %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%3 = tail call i32 @memcpy(i8* %2, i8* %0, i32 4)
ret i8* %2
}
void demo_segmenter(char *datacfg, char *cfg, char *weights, int cam_index,
                    const char *filename) {}


x86 assembly (clang, -O0):
<demo_segmenter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @demo_segmenter(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @demo_segmenter(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3, i8* nocapture %4) {
ret void
}
int h(void) {
  _Atomic int x;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @h() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @h() {
ret i32 0
}
void sws_shiftVec() {}


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

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

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

LLVM IR (-O2):
define void @sws_shiftVec() {
ret void
}
/* Variables and functions */
double log(int /*<<< orphan*/);
int /*<<< orphan*/ ro(double, double, double);
double gg(double t, double x, double y) { return log(ro(t, x, y)); }


x86 assembly (clang, -O0):
<gg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <ro@plt>
mov    %eax,%edi
call   1040 <log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg>:
push   %rax
call   1030 <ro@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <log@plt>

LLVM IR (-O0):
define double @gg(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @ro(double %7, double %8, double %9)
%11 = call double @log(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @gg(double %0, double %1, double %2) {
%4 = tail call i32 @ro(double %0, double %1, double %2)
%5 = tail call double @log(i32 %4)
ret double %5
}
/* Variables and functions */
void *box_int(int);
void *square(void *e, void *closure) {
  return box_int((*(int *)e) * (*(int *)e));
}


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

x86 assembly (clang, -O2):
<square>:
mov    (%rdi),%edi
imul   %edi,%edi
jmp    1030 <box_int@plt>

LLVM IR (-O0):
define i8* @square(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 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = call i8* @box_int(i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @square(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, %4
%6 = tail call i8* @box_int(i32 %5)
ret i8* %6
}
int syscall_read_flash(int offs, void *buf, int cnt) {
  return (*(int (**)())0x8c0000b8)(offs, buf, cnt, 1);
}


x86 assembly (clang, -O0):
<syscall_read_flash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x8c0000b8,%eax
mov    (%rax),%r8
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
mov    $0x0,%al
call   *%r8
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_read_flash>:
mov    $0x8c0000b8,%eax
mov    (%rax),%r8
mov    $0x1,%ecx
xor    %eax,%eax
jmp    *%r8

LLVM IR (-O0):
define i32 @syscall_read_flash(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32 (...)*, i32 (...)** inttoptr (i64 2348810424 to i32 (...)**)
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = bitcast i32 (...)* %7 to i32 (i32, i8*, i32, i32, ...)*
%12 = call i32 (i32, i8*, i32, i32, ...) %11(i32 %8, i8* %9, i32 %10, i32 1)
ret i32 %12
}

LLVM IR (-O2):
define i32 @syscall_read_flash(i32 %0, i8* %1, i32 %2) {
%4 = load i32 (i32, i8*, i32, i32, ...)*, i32 (i32, i8*, i32, i32, ...)** inttoptr (i64 2348810424 to i32 (i32, i8*, i32, i32, ...)**)
%5 = tail call i32 (i32, i8*, i32, i32, ...) %4(i32 %0, i8* %1, i32 %2, i32 1)
ret i32 %5
}
void sdma_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @sdma_iomux_config() {
ret void
}
int PR8962_b(int *t) {
  if (((int)((int)t)))
    return 0;
  return *t;
}


x86 assembly (clang, -O0):
<PR8962_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0x0,%eax
je     1121 <PR8962_b+0x21>
movl   $0x0,-0x4(%rbp)
jmp    112a <PR8962_b+0x2a>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR8962_b>:
xor    %eax,%eax
test   %edi,%edi
je     1107 <PR8962_b+0x7>
ret
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @PR8962_b(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = ptrtoint i32* %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %11
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @PR8962_b(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %0
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ 0, %1 ]
ret i32 %8
}
float interpolateLinear2values(float point1, float point2, double address) {
  float posFract = (float)(address - (double)((long)address));
  return (point1 * (1.0f - posFract)) + (point2 * posFract);
}


x86 assembly (clang, -O0):
<interpolateLinear2values>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movsd  %xmm2,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec3(%rip),%xmm2
subss  -0x14(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolateLinear2values>:
cvttsd2si %xmm2,%rax
cvtsi2sd %rax,%xmm3
subsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
movss  0xee6(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm1,%xmm2
mulss  %xmm3,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @interpolateLinear2values(float %0, float %1, double %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca double
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = load double, double* %6
%10 = fptosi double %9 to i64
%11 = sitofp i64 %10 to double
%12 = fsub double %8, %11
%13 = fptrunc double %12 to float
store float %13, float* %7
%14 = load float, float* %4
%15 = load float, float* %7
%16 = fsub float 1.000000e+00, %15
%17 = load float, float* %5
%18 = load float, float* %7
%19 = fmul float %17, %18
%20 = call float @llvm.fmuladd.f32(float %14, float %16, float %19)
ret float %20
}

LLVM IR (-O2):
define float @interpolateLinear2values(float %0, float %1, double %2) {
%4 = fptosi double %2 to i64
%5 = sitofp i64 %4 to double
%6 = fsub double %2, %5
%7 = fptrunc double %6 to float
%8 = fsub float 1.000000e+00, %7
%9 = fmul float %7, %1
%10 = tail call float @llvm.fmuladd.f32(float %0, float %8, float %9)
ret float %10
}