xunge/DecIR huggingface dataset:
float absFloat(float x) { return x >= 0.001 ? x : -x; }


x86 assembly (clang, -O0):
<absFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <absFloat+0x33>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    114a <absFloat+0x4a>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absFloat>:
cvtss2sd %xmm0,%xmm1
ucomisd 0xef4(%rip),%xmm1
jae    1115 <absFloat+0x15>
xorps  0xefb(%rip),%xmm0
ret

LLVM IR (-O0):
define float @absFloat(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp oge double %4, 1.000000e-03
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = fneg float %9
br label %11
11: ; preds = %8, %6
%12 = phi float [ %7, %6 ], [ %10, %8 ]
ret float %12
}

LLVM IR (-O2):
define float @absFloat(float %0) {
%2 = fpext float %0 to double
%3 = fcmp oge double %2, 1.000000e-03
%4 = fneg float %0
%5 = select i1 %3, float %0, float %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xc8() {
  Assert_real((iscntrl(200) == 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_iscntrl.c",
              1005, ("iscntrl should be 0 for 0xc8"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xc8>:
push   %rax
mov    $0xc8,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ed,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xc8\00"
define void @t_iscntrl_0xc8() {
%1 = call i64 @iscntrl(i32 200)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1005, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xc8\00"
define void @t_iscntrl_0xc8() {
%1 = tail call i64 @iscntrl(i32 200)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1005, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
void c_sleep(unsigned int sec) { sleep(sec); }


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

x86 assembly (clang, -O2):
<c_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @c_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
unsigned int sys_call(int, int, unsigned int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int timer_set_period(unsigned int val) {
  return sys_call(0x04, 2, val, 0, 0);
}


x86 assembly (clang, -O0):
<timer_set_period>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x4,%edi
mov    $0x2,%esi
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <sys_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_set_period>:
mov    %edi,%edx
mov    $0x4,%edi
mov    $0x2,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

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

LLVM IR (-O2):
define i32 @timer_set_period(i32 %0) {
%2 = tail call i32 @sys_call(i32 4, i32 2, i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int cow_str_find(char const *, char);
int cow_str_rfind_safe(const char *str, char c) {
  if (!str)
    return -1;
  return cow_str_find(str, c);
}


x86 assembly (clang, -O0):
<cow_str_rfind_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <cow_str_rfind_safe+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <cow_str_rfind_safe+0x39>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <cow_str_find@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cow_str_rfind_safe>:
test   %rdi,%rdi
je     111e <cow_str_rfind_safe+0xe>
movsbl %sil,%esi
jmp    1030 <cow_str_find@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @cow_str_rfind_safe(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @cow_str_find(i8* %0, i8 signext %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, char);
double recip(int);
void test2(int denom) {
  double r1;
  int t1;
  r1 = recip(denom);
  t1 = r1 == 1.0 / (double)denom;
  printf("test2 t1: r1 %f %c= 1.0/10.0\n", r1, t1 ? '=' : '!');
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <recip@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xeb6(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edx
mov    $0x21,%eax
mov    $0x3d,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xe87(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbx
mov    %edi,%ebx
call   1040 <recip@plt>
cvtsi2sd %ebx,%xmm1
movsd  0xecc(%rip),%xmm2
divsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
mov    $0x21,%eax
mov    $0x3d,%esi
cmovne %eax,%esi
cmovp  %eax,%esi
lea    0xeb5(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"test2 t1: r1 %f %c= 1.0/10.0\0A\00"
define void @test2(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call double @recip(i32 %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fdiv double 1.000000e+00, %9
%11 = fcmp oeq double %7, %10
%12 = zext i1 %11 to i32
store i32 %12, i32* %4
%13 = load double, double* %3
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 61, i32 33
%18 = trunc i32 %17 to i8
%19 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %13, i8 signext %18)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"test2 t1: r1 %f %c= 1.0/10.0\0A\00"
define void @test2(i32 %0) {
%2 = tail call double @recip(i32 %0)
%3 = sitofp i32 %0 to double
%4 = fdiv double 1.000000e+00, %3
%5 = fcmp oeq double %2, %4
%6 = select i1 %5, i8 61, i8 33
%7 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %2, i8 signext %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *,
                           int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void err_size(char *name, __u64 old) {
  fprintf(stderr, "size must be larger than current %s (%llu)\n", name, old);
}


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

x86 assembly (clang, -O2):
<err_size>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"size must be larger than current %s (%llu)\0A\00"
define void @err_size(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"size must be larger than current %s (%llu)\0A\00"
define void @err_size(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
void foo703() {}


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

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

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

LLVM IR (-O2):
define void @foo703() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
float UnflattenFloat(int /*<<< orphan*/ *, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int /*<<< orphan*/ be_buf_to_i32(int /*<<< orphan*/ const *, size_t);
float DeserializeFloat(const uint8_t *buf, size_t len) {
  int32_t mant;
  int8_t exp;
  float result = 0.0;
  mant = be_buf_to_i32(buf, len);
  exp = buf[sizeof(uint32_t)];
  result = UnflattenFloat(NULL, mant, exp);
  return result;
}


x86 assembly (clang, -O0):
<DeserializeFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <be_buf_to_i32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <UnflattenFloat@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeserializeFloat>:
push   %rbx
mov    %rdi,%rbx
call   1040 <be_buf_to_i32@plt>
mov    0x10(%rbx),%edx
xor    %edi,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <UnflattenFloat@plt>

LLVM IR (-O0):
define float @DeserializeFloat(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32* %0, i32** %3
store i64 %1, i64* %4
store float 0.000000e+00, float* %7
%8 = load i32*, i32** %3
%9 = load i64, i64* %4
%10 = call i32 @be_buf_to_i32(i32* %8, i64 %9)
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load i32, i32* %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call float @UnflattenFloat(i32* null, i32 %14, i32 %15)
store float %16, float* %7
%17 = load float, float* %7
ret float %17
}

LLVM IR (-O2):
define float @DeserializeFloat(i32* %0, i64 %1) {
%3 = tail call i32 @be_buf_to_i32(i32* %0, i64 %1)
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = load i32, i32* %4
%6 = tail call float @UnflattenFloat(i32* null, i32 %3, i32 %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  char str[11] = {0};
  itoa(41200, str, 10);
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xf(%rbp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1040 <memset@plt>
lea    -0xf(%rbp),%rsi
mov    $0xa0f0,%edi
mov    $0xa,%edx
call   1050 <itoa@plt>
lea    -0xf(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x7(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rbx
mov    $0xa0f0,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = bitcast [11 x i8]* %2 to i8*
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i32 @itoa(i32 41200, i8* %4, i32 10)
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = call i32 @puts(i8* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 41200, i8* %2, i32 10)
%4 = call i32 @puts(i8* %2)
ret i32 0
}
void ft_strclr(char *as) {
  while (*as) {
    *as = 0;
    as++;
  }
}


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

x86 assembly (clang, -O2):
<ft_strclr>:
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
store i8 0, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int test_server_gzip();
int main() {
  int nret = 0;
  nret = test_server_gzip();
  return -nret;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_server_gzip()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_server_gzip()
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ db_open(char const *);
int /*<<< orphan*/ db_read();
scalar_t__ sdb_has_errors();
int ssa_db_init(const char *db_name) {
  db_open(db_name);
  if (sdb_has_errors()) {
    return 1;
  }
  db_read();
  if (sdb_has_errors()) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ssa_db_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <db_open@plt>
mov    $0x0,%al
call   1050 <sdb_has_errors@plt>
cmp    $0x0,%rax
je     1162 <ssa_db_init+0x32>
movl   $0x1,-0x4(%rbp)
jmp    118d <ssa_db_init+0x5d>
mov    $0x0,%al
call   1040 <db_read@plt>
mov    $0x0,%al
call   1050 <sdb_has_errors@plt>
cmp    $0x0,%rax
je     1186 <ssa_db_init+0x56>
movl   $0x1,-0x4(%rbp)
jmp    118d <ssa_db_init+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssa_db_init>:
push   %rax
call   1030 <db_open@plt>
xor    %eax,%eax
call   1050 <sdb_has_errors@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     114c <ssa_db_init+0x1c>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <db_read@plt>
xor    %eax,%eax
call   1050 <sdb_has_errors@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ssa_db_init(i8* %0) {
%2 = tail call i32 @db_open(i8* %0)
%3 = tail call i64 (...) @sdb_has_errors()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = tail call i32 (...) @db_read()
%7 = tail call i64 (...) @sdb_has_errors()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
void usage(progname) char *progname;
{
  printf("Usage: %s [ -f filename ] [-number] [name...] [tty...]\n", progname);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"Usage: %s [ -f filename ] [-number] [name...] [tty...]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %3)
unreachable
}

LLVM IR (-O2):
@.str = [56 x i8] c"Usage: %s [ -f filename ] [-number] [name...] [tty...]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ port_unlock();
void port_unlock_from_isr(void) { port_unlock(); }


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

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

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

LLVM IR (-O2):
define void @port_unlock_from_isr() {
%1 = tail call i32 (...) @port_unlock()
ret void
}
void gpio_i2c_hs_inactive(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_i2c_hs_inactive() {
ret void
}
int true(int *bits, int *known, int b) {
  return get_bit(bits, b) && get_bit(known, b);
}


x86 assembly (clang, -O0):
<true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <get_bit@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1158 <true+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <get_bit@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<true>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
xor    %ebp,%ebp
mov    %edx,%esi
xor    %eax,%eax
call   1030 <get_bit@plt>
test   %eax,%eax
je     113c <true+0x2c>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <get_bit@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @true(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** %4
%8 = load i32, i32* %6
%9 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @get_bit to i32 (i32*, i32, ...)*)(i32* %7, i32 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32*, i32** %5
%13 = load i32, i32* %6
%14 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @get_bit to i32 (i32*, i32, ...)*)(i32* %12, i32 %13)
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %11, %3
%17 = phi i1 [ false, %3 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @true(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @get_bit to i32 (i32*, i32, ...)*)(i32* %0, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @get_bit to i32 (i32*, i32, ...)*)(i32* %1, i32 %2)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef char *uint8_t;

/* Variables and functions */
__attribute__((always_)) uint8_t ATOMIC_BTS(uint8_t *addr, size_t offset) {
  uint8_t oldbit;
  addr += (offset / 8);
  __asm__("lock btsq %2, %1\n"
          "sbb %0, %0\n"
          : "=r"(oldbit), "+m"(*addr)
          : "Ir"(offset % 8));
  return oldbit;
}


x86 assembly (clang, -O0):
<ATOMIC_BTS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x3,%rax
shl    $0x3,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
lock bts %rcx,(%rax)
sbb    %rax,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ATOMIC_BTS>:
mov    %rsi,%rax
and    $0xfffffffffffffff8,%rax
and    $0x7,%esi
lock bts %rsi,(%rdi,%rax,1)
sbb    %rax,%rax
ret

LLVM IR (-O0):
define i8* @ATOMIC_BTS(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i8*
store i8** %0, i8*** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = udiv i64 %6, 8
%8 = load i8**, i8*** %3
%9 = getelementptr inbounds i8*, i8** %8, i64 %7
store i8** %9, i8*** %3
%10 = load i8**, i8*** %3
%11 = load i64, i64* %4
%12 = urem i64 %11, 8
%13 = call i8* asm "lock btsq $2, $1\0Asbb $0, $0\0A", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %10, i64 %12, i8** elementtype(i8*) %10)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @ATOMIC_BTS(i8** %0, i64 %1) {
%3 = lshr i64 %1, 3
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = and i64 %1, 7
%6 = tail call i8* asm "lock btsq $2, $1\0Asbb $0, $0\0A", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %4, i64 %5, i8** elementtype(i8*) %4)
ret i8* %6
}
int fun594() { return 594; }


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

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

LLVM IR (-O0):
define i32 @fun594() {
ret i32 594
}

LLVM IR (-O2):
define i32 @fun594() {
ret i32 594
}
int callback(void *ptr, char *string1, char *string2, short number,
             long long rand) {
  if (ptr != 0 || string1 != 0 || string2 != 0 || number != 0x1234 ||
      rand != 0x1234567890abcdefLL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ax,-0x22(%rbp)
mov    %r8,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <callback+0x5f>
cmpq   $0x0,-0x18(%rbp)
jne    115f <callback+0x5f>
cmpq   $0x0,-0x20(%rbp)
jne    115f <callback+0x5f>
movswl -0x22(%rbp),%eax
cmp    $0x1234,%eax
jne    115f <callback+0x5f>
movabs $0x1234567890abcdef,%rax
56 34 12
cmp    %rax,-0x30(%rbp)
je     116b <callback+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <callback+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
or     %rsi,%rdi
or     %rdx,%rdi
setne  %al
cmp    $0x1234,%ecx
setne  %cl
or     %al,%cl
movabs $0x1234567890abcdef,%rax
56 34 12
cmp    %rax,%r8
setne  %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @callback(i8* %0, i8* %1, i8* %2, i16 signext %3, i64 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i16
%11 = alloca i64
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i16 %3, i16* %10
store i64 %4, i64* %11
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %27, label %14
14: ; preds = %5
%15 = load i8*, i8** %8
%16 = icmp ne i8* %15, null
br i1 %16, label %27, label %17
17: ; preds = %14
%18 = load i8*, i8** %9
%19 = icmp ne i8* %18, null
br i1 %19, label %27, label %20
20: ; preds = %17
%21 = load i16, i16* %10
%22 = sext i16 %21 to i32
%23 = icmp ne i32 %22, 4660
br i1 %23, label %27, label %24
24: ; preds = %20
%25 = load i64, i64* %11
%26 = icmp ne i64 %25, 1311768467294899695
br i1 %26, label %27, label %28
27: ; preds = %24, %20, %17, %14, %5
store i32 1, i32* %6
br label %29
28: ; preds = %24
store i32 0, i32* %6
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %6
ret i32 %30
}

LLVM IR (-O2):
define i32 @callback(i8* readnone %0, i8* readnone %1, i8* readnone %2, i16 signext %3, i64 %4) {
%6 = icmp ne i8* %0, null
%7 = icmp ne i8* %1, null
%8 = or i1 %6, %7
%9 = icmp ne i8* %2, null
%10 = or i1 %8, %9
%11 = icmp ne i16 %3, 4660
%12 = or i1 %10, %11
%13 = icmp ne i64 %4, 1311768467294899695
%14 = or i1 %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}
int ft_strcmp(const char *s1, const char *s2) {
  if (*s1 && *s1 == *s2)
    return (ft_strcmp(s1 + 1, s2 + 1));
  return ((unsigned char)*s1 - (unsigned char)*s2);
}


x86 assembly (clang, -O0):
<ft_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1163 <ft_strcmp+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1163 <ft_strcmp+0x53>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <ft_strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1176 <ft_strcmp+0x66>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <ft_strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <ft_strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <ft_strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11, %5, %2
%17 = phi i8* [ %1, %2 ], [ %7, %5 ], [ %13, %11 ]
%18 = phi i8 [ 0, %2 ], [ %6, %5 ], [ 0, %11 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_regexp_matches(char **matches) {
  int i = -1;
  while (matches[++i])
    free(matches[i]);
}


x86 assembly (clang, -O0):
<free_regexp_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1154 <free_regexp_matches+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1123 <free_regexp_matches+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_regexp_matches>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <free_regexp_matches+0x21>
add    $0x8,%rbx
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <free_regexp_matches+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @free_regexp_matches(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 -1, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %5, i64 %8
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
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 @free(i8* %17)
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @free_regexp_matches(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 i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @free(i8* %6)
%8 = add nuw nsw i64 %5, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insertStrAt(char *, int, int, int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[15] = "ab";
  insertStrAt("c", 1, 1, 15, str);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%r8
lea    0xead(%rip),%rdi
mov    $0x1,%edx
mov    $0xf,%ecx
mov    %edx,%esi
call   1040 <insertStrAt@plt>
lea    -0x13(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x7(%rsp)
movq   $0x6261,(%rsp)
lea    0xed2(%rip),%rdi
mov    %rsp,%rbx
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0xf,%ecx
mov    %rbx,%r8
call   1040 <insertStrAt@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [15 x i8] c"ab\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"c\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
store i32 0, i32* %1
%3 = bitcast [15 x i8]* %2 to i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @insertStrAt(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 15, i8* %4)
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [15 x i8] c"ab\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"c\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @insertStrAt(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 15, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
unsigned short saveInt8ToBuffer(unsigned char value, unsigned char *buffer,
                                unsigned short offset) {
  buffer[offset] = value;
  return offset + sizeof(unsigned char);
}


x86 assembly (clang, -O0):
<saveInt8ToBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
movzwl -0x12(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
movzwl -0x12(%rbp),%eax
add    $0x1,%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveInt8ToBuffer>:
mov    %edx,%eax
mov    %dil,(%rsi,%rax,1)
lea    0x1(%rdx),%eax
ret

LLVM IR (-O0):
define zeroext i16 @saveInt8ToBuffer(i8 zeroext %0, i8* %1, i16 zeroext %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i16
store i8 %0, i8* %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i8, i8* %4
%8 = load i8*, i8** %5
%9 = load i16, i16* %6
%10 = zext i16 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 %7, i8* %11
%12 = load i16, i16* %6
%13 = zext i16 %12 to i64
%14 = add i64 %13, 1
%15 = trunc i64 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @saveInt8ToBuffer(i8 zeroext %0, i8* nocapture writeonly %1, i16 zeroext %2) {
%4 = zext i16 %2 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %0, i8* %5
%6 = add i16 %2, 1
ret i16 %6
}
int test_imm_F6uint32_reg(unsigned int val) {
  return ((val) & (0xF6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F6uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 246
%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_F6uint32_reg(i32 %0) {
%2 = and i32 %0, 246
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c;
  while ((c = getchar()) != EOF)
    putchar(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("I am test sub2.\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"I am test sub2.\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"I am test sub2.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct xdg_shell {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
void xdg_shell_destroy(struct xdg_shell *xdg_shell) {
  wl_proxy_destroy((struct wl_proxy *)xdg_shell);
}


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

x86 assembly (clang, -O2):
<xdg_shell_destroy>:
jmp    1030 <wl_proxy_destroy@plt>

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

LLVM IR (-O2):
%struct.xdg_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_shell_destroy(%struct.xdg_shell* %0) {
%2 = bitcast %struct.xdg_shell* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ gpio_init();
void led(void) {
  gpio_init();
  (*((volatile uint32_t *)0x20b4000u)) |= 1 << 8;
  (*((volatile uint32_t *)0x20a4000u)) |= 1 << 26;
  (*((volatile uint32_t *)0x20b4000u)) |= 1 << 13;
  (*((volatile uint32_t *)0x20a8000u)) |= 1 << 5;
}


x86 assembly (clang, -O0):
<led>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gpio_init@plt>
mov    $0x20b4000,%eax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    $0x20b4000,%eax
mov    %ecx,(%rax)
mov    $0x20a4000,%eax
mov    (%rax),%ecx
or     $0x4000000,%ecx
mov    $0x20a4000,%eax
mov    %ecx,(%rax)
mov    $0x20b4000,%eax
mov    (%rax),%ecx
or     $0x2000,%ecx
mov    $0x20b4000,%eax
mov    %ecx,(%rax)
mov    $0x20a8000,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x20a8000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led>:
push   %rax
xor    %eax,%eax
call   1030 <gpio_init@plt>
orl    $0x100,0x20b4000
orl    $0x4000000,0x20a4000
orl    $0x2000,0x20b4000
orl    $0x20,0x20a8000
20
pop    %rax
ret

LLVM IR (-O0):
define void @led() {
%1 = call i32 (...) @gpio_init()
%2 = load volatile i32, i32* inttoptr (i64 34291712 to i32*)
%3 = or i32 %2, 256
store volatile i32 %3, i32* inttoptr (i64 34291712 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 34226176 to i32*)
%5 = or i32 %4, 67108864
store volatile i32 %5, i32* inttoptr (i64 34226176 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 34291712 to i32*)
%7 = or i32 %6, 8192
store volatile i32 %7, i32* inttoptr (i64 34291712 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 34242560 to i32*)
%9 = or i32 %8, 32
store volatile i32 %9, i32* inttoptr (i64 34242560 to i32*)
ret void
}

LLVM IR (-O2):
define void @led() {
%1 = tail call i32 (...) @gpio_init()
%2 = load volatile i32, i32* inttoptr (i64 34291712 to i32*)
%3 = or i32 %2, 256
store volatile i32 %3, i32* inttoptr (i64 34291712 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 34226176 to i32*)
%5 = or i32 %4, 67108864
store volatile i32 %5, i32* inttoptr (i64 34226176 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 34291712 to i32*)
%7 = or i32 %6, 8192
store volatile i32 %7, i32* inttoptr (i64 34291712 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 34242560 to i32*)
%9 = or i32 %8, 32
store volatile i32 %9, i32* inttoptr (i64 34242560 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
scalar_t__ realloc(char *, int);
void reallocRadar6337483_2() {
  char *buf = malloc(100);
  char *buf2 = (char *)realloc(buf, 0x1000000);
  if (!buf2) {
    ;
  } else {
    free(buf2);
  }
}


x86 assembly (clang, -O0):
<reallocRadar6337483_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1000000,%esi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <reallocRadar6337483_2+0x38>
jmp    1171 <reallocRadar6337483_2+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocRadar6337483_2>:
push   %rax
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x1000000,%esi
call   1050 <realloc@plt>
test   %rax,%rax
je     1156 <reallocRadar6337483_2+0x26>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @reallocRadar6337483_2() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 100)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @realloc(i8* %4, i32 16777216)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %0
br label %13
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @reallocRadar6337483_2() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i64 @realloc(i8* %1, i32 16777216)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = inttoptr i64 %2 to i8*
%6 = tail call i32 @free(i8* %5)
br label %7
7: ; preds = %0, %4
ret void
}
/* Variables and functions */
scalar_t__ log(float);
float logf(float x) { return (float)log(x); }


x86 assembly (clang, -O0):
<logf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logf>:
push   %rax
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @logf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @log(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @logf(float %0) {
%2 = tail call i64 @log(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage() {
  fprintf(stderr, "Usage: ./a.out -n mq_name message prio\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: ./a.out -n mq_name message prio\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: ./a.out -n mq_name message prio\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}