xunge/DecIR huggingface dataset:
void rotr(int *a, int *b, int *c) {
  int t = *c;
  *c = *b;
  *b = *a;
  *a = t;
}


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

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdx),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %0
store i32 %6, i32* %1
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setMcuToDefaultSleep();
void idleThreadCode(void) {
  while (1) {
    setMcuToDefaultSleep();
  }
}


x86 assembly (clang, -O0):
<idleThreadCode>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <idleThreadCode+0x9>
mov    $0x0,%al
call   1030 <setMcuToDefaultSleep@plt>
jmp    1119 <idleThreadCode+0x9>

x86 assembly (clang, -O2):
<idleThreadCode>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <setMcuToDefaultSleep@plt>
jmp    1120 <idleThreadCode+0x10>

LLVM IR (-O0):
define void @idleThreadCode() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @setMcuToDefaultSleep()
br label %1
}

LLVM IR (-O2):
define void @idleThreadCode() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @setMcuToDefaultSleep()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ check_desa_move();
int /*<<< orphan*/ desa_dcw();
void desa_li123(void) {
  if (!check_desa_move())
    desa_dcw();
}


x86 assembly (clang, -O0):
<desa_li123>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <check_desa_move@plt>
cmp    $0x0,%eax
jne    113b <desa_li123+0x1b>
mov    $0x0,%al
call   1040 <desa_dcw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<desa_li123>:
push   %rax
xor    %eax,%eax
call   1030 <check_desa_move@plt>
test   %eax,%eax
je     112e <desa_li123+0xe>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <desa_dcw@plt>

LLVM IR (-O0):
define void @desa_li123() {
%1 = call i32 (...) @check_desa_move()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @desa_dcw()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @desa_li123() {
%1 = tail call i32 (...) @check_desa_move()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @desa_dcw()
br label %5
5: ; preds = %3, %0
ret void
}
void sg_page_destroy_comp(void) {}


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

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

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

LLVM IR (-O2):
define void @sg_page_destroy_comp() {
ret void
}
int DC_getMaxSubresults(void) { return (100); }


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

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

LLVM IR (-O0):
define i32 @DC_getMaxSubresults() {
ret i32 100
}

LLVM IR (-O2):
define i32 @DC_getMaxSubresults() {
ret i32 100
}
double ho_recognize_font_1_dot_comma(const double *array_in) {
  double return_value = 0.0;
  return return_value;
}


x86 assembly (clang, -O0):
<ho_recognize_font_1_dot_comma>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_recognize_font_1_dot_comma>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ho_recognize_font_1_dot_comma(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @ho_recognize_font_1_dot_comma(double* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Type definitions */
struct piece {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct piece *);
struct piece *text_next(struct piece *, struct piece *);
void text_dtor(struct piece *t) {
  struct piece *v, *u = 0, *x = t;
  while (x) {
    v = u, u = x;
    x = text_next(u, v);
    free(u);
  }
}


x86 assembly (clang, -O0):
<text_dtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1176 <text_dtor+0x56>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <text_next@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    113c <text_dtor+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_dtor>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114e <text_dtor+0x2e>
mov    %rdi,%rbx
xor    %esi,%esi
xchg   %ax,%ax
mov    %rbx,%r14
mov    %rbx,%rdi
call   1040 <text_next@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r14,%rsi
test   %rbx,%rbx
jne    1130 <text_dtor+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.piece = type { i32 }
define void @text_dtor(%struct.piece* %0) {
%2 = alloca %struct.piece*
%3 = alloca %struct.piece*
%4 = alloca %struct.piece*
%5 = alloca %struct.piece*
store %struct.piece* %0, %struct.piece** %2
store %struct.piece* null, %struct.piece** %4
%6 = load %struct.piece*, %struct.piece** %2
store %struct.piece* %6, %struct.piece** %5
br label %7
7: ; preds = %10, %1
%8 = load %struct.piece*, %struct.piece** %5
%9 = icmp ne %struct.piece* %8, null
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load %struct.piece*, %struct.piece** %4
store %struct.piece* %11, %struct.piece** %3
%12 = load %struct.piece*, %struct.piece** %5
store %struct.piece* %12, %struct.piece** %4
%13 = load %struct.piece*, %struct.piece** %4
%14 = load %struct.piece*, %struct.piece** %3
%15 = call %struct.piece* @text_next(%struct.piece* %13, %struct.piece* %14)
store %struct.piece* %15, %struct.piece** %5
%16 = load %struct.piece*, %struct.piece** %4
%17 = call i32 @free(%struct.piece* %16)
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.piece = type { i32 }
define void @text_dtor(%struct.piece* %0) {
%2 = icmp eq %struct.piece* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi %struct.piece* [ %6, %3 ], [ %0, %1 ]
%5 = phi %struct.piece* [ %4, %3 ], [ null, %1 ]
%6 = tail call %struct.piece* @text_next(%struct.piece* %4, %struct.piece* %5)
%7 = tail call i32 @free(%struct.piece* %4)
%8 = icmp eq %struct.piece* %6, null
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ E(int);
void foo3(int n, int a[n][30]) {
  if (a[29][0] != 0)
    E(4);
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,0xd98(%rax)
je     113a <foo3+0x2a>
mov    $0x4,%edi
call   1030 <E@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
cmpl   $0x0,0xd98(%rsi)
je     1123 <foo3+0x13>
mov    $0x4,%edi
jmp    1030 <E@plt>
ret

LLVM IR (-O0):
define void @foo3(i32 %0, [30 x i32]* %1) {
%3 = alloca i32
%4 = alloca [30 x i32]*
store i32 %0, i32* %3
store [30 x i32]* %1, [30 x i32]** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = load [30 x i32]*, [30 x i32]** %4
%8 = getelementptr inbounds [30 x i32], [30 x i32]* %7, i64 29
%9 = getelementptr inbounds [30 x i32], [30 x i32]* %8, i64 0, i64 0
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @E(i32 4)
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @foo3(i32 %0, [30 x i32]* nocapture %1) {
%3 = getelementptr inbounds [30 x i32], [30 x i32]* %1, i64 29, i64 0
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @E(i32 4)
br label %8
8: ; preds = %6, %2
ret void
}
double at_perlin_get_4d(struct at_perlin *per, double x, double y, double z,
                        double w) {
  return 0.0;
}


x86 assembly (clang, -O0):
<at_perlin_get_4d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_perlin_get_4d>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%struct.at_perlin = type opaque
define double @at_perlin_get_4d(%struct.at_perlin* %0, double %1, double %2, double %3, double %4) {
%6 = alloca %struct.at_perlin*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store %struct.at_perlin* %0, %struct.at_perlin** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
ret double 0.000000e+00
}

LLVM IR (-O2):
%struct.at_perlin = type opaque
define double @at_perlin_get_4d(%struct.at_perlin* nocapture readnone %0, double %1, double %2, double %3, double %4) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ setv(int, int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a;
  setv(1, &a);
  test_assert(a == 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
call   1030 <setv@plt>
cmpl   $0xd,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
call   1030 <setv@plt>
xor    %edi,%edi
cmpl   $0xd,0x4(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @setv(i32 1, i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @setv(i32 1, i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}
/* Variables and functions */
int rand();
__attribute__((__weak__, __always___)) int softboundmpx_rand() {
  return rand();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundmpx_rand() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundmpx_rand() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
int foo__Fi(int);
int cppsub_(int *y) { return foo__Fi(*y); }


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

x86 assembly (clang, -O2):
<cppsub_>:
mov    (%rdi),%edi
jmp    1030 <foo__Fi@plt>

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

LLVM IR (-O2):
define i32 @cppsub_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @foo__Fi(i32 %2)
ret i32 %3
}
int main(void) {
  int a;
  &a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t SysCtlPWMClockGet(void) {
  ;
  if (!((*((volatile unsigned long *)(0x400FE060))) & 0x00100000)) {
    return (0x00000000);
  } else {
    return ((*((volatile unsigned long *)(0x400FE060))) &
            (0x00100000 | 0x000E0000));
  }
}


x86 assembly (clang, -O0):
<SysCtlPWMClockGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe060,%eax
mov    (%rax),%rax
and    $0x100000,%rax
cmp    $0x0,%rax
jne    1128 <SysCtlPWMClockGet+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1139 <SysCtlPWMClockGet+0x39>
mov    $0x400fe060,%eax
mov    (%rax),%rax
and    $0x1e0000,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPWMClockGet>:
xor    %eax,%eax
testq  $0x100000,0x400fe060
je     111d <SysCtlPWMClockGet+0x1d>
mov    0x400fe060,%rax
40
and    $0x1e0000,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlPWMClockGet() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%3 = and i64 %2, 1048576
%4 = icmp ne i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 0, i32* %1
br label %10
6: ; preds = %0
%7 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%8 = and i64 %7, 1966080
%9 = trunc i64 %8 to i32
store i32 %9, i32* %1
br label %10
10: ; preds = %6, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @SysCtlPWMClockGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%2 = and i64 %1, 1048576
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1966080
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ %7, %4 ], [ 0, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cbfree(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @cbfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void putbyte(s, i, c) int *s;
{ *(i + (char *)s) = c; }


x86 assembly (clang, -O0):
<putbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbyte>:
movslq %esi,%rax
mov    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @putbyte(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* %6
%8 = trunc i32 %7 to i8
%9 = load i32, i32* %5
%10 = load i32*, i32** %4
%11 = bitcast i32* %10 to i8*
%12 = sext i32 %9 to i64
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8 %8, i8* %13
ret void
}

LLVM IR (-O2):
define void @putbyte(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = bitcast i32* %0 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %5, i64 %6
store i8 %4, i8* %7
ret void
}
int getStreamsize(char *stream) {
  int *b = (int *)stream;
  return *b;
}


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

x86 assembly (clang, -O2):
<getStreamsize>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getStreamsize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @getStreamsize(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
double atof(char const *);
char *get_str(char *, int);
double get_double(char *line, int column_number) {
  if (column_number >= 0) {
    const char *s = get_str(line, column_number);
    return s ? atof(s) : 0.0;
  } else {
    return 0.0;
  }
}


x86 assembly (clang, -O0):
<get_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1183 <get_double+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <get_str@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1167 <get_double+0x47>
mov    -0x20(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    1174 <get_double+0x54>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1174 <get_double+0x54>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <get_double+0x6b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_double>:
test   %esi,%esi
js     113c <get_double+0x1c>
push   %rax
call   1040 <get_str@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     113c <get_double+0x1c>
mov    %rax,%rdi
jmp    1030 <atof@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @get_double(i8* %0, i32 %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i8* @get_str(i8* %10, i32 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i8*, i8** %6
%17 = call double @atof(i8* %16)
br label %19
18: ; preds = %9
br label %19
19: ; preds = %18, %15
%20 = phi double [ %17, %15 ], [ 0.000000e+00, %18 ]
store double %20, double* %3
br label %22
21: ; preds = %2
store double 0.000000e+00, double* %3
br label %22
22: ; preds = %21, %19
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @get_double(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i8* @get_str(i8* %0, i32 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call double @atof(i8* %5)
br label %9
9: ; preds = %2, %7, %4
%10 = phi double [ %8, %7 ], [ 0.000000e+00, %4 ], [ 0.000000e+00, %2 ]
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ idstring;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int executethestuff() {
  char idstring[1024];
  FILE *f = popen("id", "r");
  fgets(idstring, sizeof(idstring), f);
  printf("Is that how you're gonna be this guy: %s ???", idstring);
}


x86 assembly (clang, -O0):
<executethestuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
lea    0xebe(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    $0x400,%esi
call   1040 <fgets@plt>
lea    -0x410(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executethestuff>:
push   %rbx
sub    $0x400,%rsp
lea    0xec1(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1050 <popen@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"id\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [45 x i8] c"Is that how you're gonna be this guy: %s ???\00"
define i32 @executethestuff() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i32*
%4 = call i32* @popen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = load i32*, i32** %3
%7 = call i32 @fgets(i8* %5, i32 1024, i32* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"id\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [45 x i8] c"Is that how you're gonna be this guy: %s ???\00"
define i32 @executethestuff() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32* @popen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fgets(i8* %2, i32 1024, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 undef
}
void foo478() {}


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

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

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

LLVM IR (-O2):
define void @foo478() {
ret void
}
/* Variables and functions */
int getMin(char *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int res = getMin("xrepayuyubctwtykrauccnquqfuqvccuaakylwlcjuyhyammag");
  printf(" Min secs required %d", res);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <getMin@plt>
lea    0xeff(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"xrepayuyubctwtykrauccnquqfuqvccuaakylwlcjuyhyammag\00"
@.str.1 = [22 x i8] c" Min secs required %d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @getMin(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"xrepayuyubctwtykrauccnquqfuqvccuaakylwlcjuyhyammag\00"
@.str.1 = [22 x i8] c" Min secs required %d\00"
define void @main() {
%1 = tail call i32 @getMin(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int read_from_file(FILE *fd, char *buffer) {
  fgets(buffer, 1000, fd);
  return 1;
}


x86 assembly (clang, -O0):
<read_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x3e8,%esi
call   1030 <fgets@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_from_file>:
push   %rax
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    $0x3e8,%esi
call   1030 <fgets@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read_from_file(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fgets(i8* %1, i32 1000, i32* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ errorMsg(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void sferr(char s[]) {
  char errMsg[512];
  sprintf(errMsg, ">> Input Data file error while reading %s\n", s);
  errorMsg(errMsg);
  return;
}


x86 assembly (clang, -O0):
<sferr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <errorMsg@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sferr>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <errorMsg@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c">> Input Data file error while reading %s\0A\00"
define void @sferr(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @errorMsg(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c">> Input Data file error while reading %s\0A\00"
define void @sferr(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @errorMsg(i8* %3)
ret void
}
void day3() { int input = 289326; }


x86 assembly (clang, -O0):
<day3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x46a2e,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @day3() {
ret void
}
/* Variables and functions */
size_t json_parse_value(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
size_t strlen(char const *);
bool json_is_valid(const char *str) {
  size_t len;
  len = strlen(str);
  if (!len)
    return false;
  return json_parse_value(str, NULL, 0) == len;
}


x86 assembly (clang, -O0):
<json_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <json_is_valid+0x30>
movl   $0x0,-0x4(%rbp)
jmp    116e <json_is_valid+0x4e>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <json_parse_value@plt>
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_is_valid>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     114d <json_is_valid+0x2d>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <json_parse_value@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %r14,%rcx
sete   %al
jmp    114f <json_is_valid+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @json_is_valid(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @json_parse_value(i8* %0, i32* null, i32 0)
%6 = icmp eq i64 %5, %2
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xdb() {
  Assert_real((isxdigit(219) == 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_isxdigit.c",
              1100, ("isxdigit should be 0 for 0xdb"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xdb>:
push   %rax
mov    $0xdb,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x44c,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xdb\00"
define void @t_isxdigit_0xdb() {
%1 = call i64 @isxdigit(i32 219)
%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 1100, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xdb\00"
define void @t_isxdigit_0xdb() {
%1 = tail call i64 @isxdigit(i32 219)
%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 1100, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double fromRep64(int);
double makeInf64() { return fromRep64(0x7ff0000000000000UL); }


x86 assembly (clang, -O0):
<makeInf64>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <fromRep64@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeInf64>:
xor    %edi,%edi
jmp    1030 <fromRep64@plt>

LLVM IR (-O0):
define double @makeInf64() {
%1 = call double @fromRep64(i32 0)
ret double %1
}

LLVM IR (-O2):
define double @makeInf64() {
%1 = tail call double @fromRep64(i32 0)
ret double %1
}
int isascii(int c) { return c >= 0 && c <= 127; }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isascii+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char const *);
int system(char *);
int copy_default_playlist(const char *current_pls) {
  char cmdx[300];
  snprintf(cmdx, 300, "sudo cp -f %s %s",
           "/data/media/playlist/default.pls.img", current_pls);
  return system(cmdx);
}


x86 assembly (clang, -O0):
<copy_default_playlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x12c,%esi
lea    0xeba(%rip),%rdx
lea    0xec4(%rip),%rcx
call   1040 <snprintf@plt>
lea    -0x140(%rbp),%rdi
call   1030 <system@plt>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_default_playlist>:
push   %rbx
sub    $0x130,%rsp
mov    %rdi,%r8
lea    0xece(%rip),%rdx
lea    0xed8(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x12c,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x130,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"sudo cp -f %s %s\00"
@.str.1 = [37 x i8] c"/data/media/playlist/default.pls.img\00"
define i32 @copy_default_playlist(i8* %0) {
%2 = alloca i8*
%3 = alloca [300 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 300, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [300 x i8], [300 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"sudo cp -f %s %s\00"
@.str.1 = [37 x i8] c"/data/media/playlist/default.pls.img\00"
define i32 @copy_default_playlist(i8* %0) {
%2 = alloca [300 x i8]
%3 = getelementptr inbounds [300 x i8], [300 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 300, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret i32 %5
}
/* Variables and functions */
int handleMQTTIsConnected();
int tpMQTTIsConnected() {
  int rc = handleMQTTIsConnected();
  return rc;
}


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

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

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

LLVM IR (-O2):
define i32 @tpMQTTIsConnected() {
%1 = tail call i32 (...) @handleMQTTIsConnected()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ checkCparams(int);
int /*<<< orphan*/ luaI_findsymbolbyname(char *);
int /*<<< orphan*/ setglobal(int /*<<< orphan*/);
void lua_setglobal(char *name) {
  checkCparams(1);
  setglobal(luaI_findsymbolbyname(name));
}


x86 assembly (clang, -O0):
<lua_setglobal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <checkCparams@plt>
mov    -0x8(%rbp),%rdi
call   1030 <luaI_findsymbolbyname@plt>
mov    %eax,%edi
call   1050 <setglobal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_setglobal>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <checkCparams@plt>
mov    %rbx,%rdi
call   1030 <luaI_findsymbolbyname@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <setglobal@plt>

LLVM IR (-O0):
define void @lua_setglobal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @checkCparams(i32 1)
%4 = load i8*, i8** %2
%5 = call i32 @luaI_findsymbolbyname(i8* %4)
%6 = call i32 @setglobal(i32 %5)
ret void
}

LLVM IR (-O2):
define void @lua_setglobal(i8* %0) {
%2 = tail call i32 @checkCparams(i32 1)
%3 = tail call i32 @luaI_findsymbolbyname(i8* %0)
%4 = tail call i32 @setglobal(i32 %3)
ret void
}
/* Variables and functions */
void applyFkt(int values[], size_t count, int (*fkt)(int)) {}


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

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

LLVM IR (-O0):
define void @applyFkt(i32* %0, i64 %1, i32 (i32)* %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32 (i32)*
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 (i32)* %2, i32 (i32)** %6
ret void
}

LLVM IR (-O2):
define void @applyFkt(i32* nocapture %0, i64 %1, i32 (i32)* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ thc_add_failure(char const *, char const *, char const *,
                                   int const);
int /*<<< orphan*/ thc_add_success(char const *, char const *, char const *,
                                   int const);
void thc_run_check(const int result, const char *expr, const char *func,
                   const char *fname, const int fline) {
  if (result) {
    thc_add_success(expr, func, fname, fline);
  } else {
    thc_add_failure(expr, func, fname, fline);
  }
}


x86 assembly (clang, -O0):
<thc_run_check>:
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    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115e <thc_run_check+0x3e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <thc_add_success@plt>
jmp    1172 <thc_run_check+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <thc_add_failure@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thc_run_check>:
test   %edi,%edi
je     1135 <thc_run_check+0x15>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1040 <thc_add_success@plt>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1030 <thc_add_failure@plt>

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

LLVM IR (-O2):
define void @thc_run_check(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @thc_add_success(i8* %1, i8* %2, i8* %3, i32 %4)
br label %11
9: ; preds = %5
%10 = tail call i32 @thc_add_failure(i8* %1, i8* %2, i8* %3, i32 %4)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
float _sinf(float);
float sinf(float angle) { return _sinf(angle); }


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

x86 assembly (clang, -O2):
<sinf>:
jmp    1030 <_sinf@plt>

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

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = tail call float @_sinf(float %0)
ret float %2
}
unsigned int FtoC(unsigned int F) { return (F - 32) * 10 / 18; }


x86 assembly (clang, -O0):
<FtoC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0xa,%eax,%eax
mov    $0x12,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<FtoC>:
lea    (%rdi,%rdi,4),%eax
add    %eax,%eax
add    $0xfffffec0,%eax
imul   $0x38e38e39,%rax,%rax
shr    $0x22,%rax
ret

LLVM IR (-O0):
define i32 @FtoC(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 32
%5 = mul i32 %4, 10
%6 = udiv i32 %5, 18
ret i32 %6
}

LLVM IR (-O2):
define i32 @FtoC(i32 %0) {
%2 = mul i32 %0, 10
%3 = add i32 %2, -320
%4 = udiv i32 %3, 18
ret i32 %4
}
void SSMR3PutU32(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutU32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPSPositionHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GPSPositionRequestUpdate() { UAVObjRequestUpdate(GPSPositionHandle()); }


x86 assembly (clang, -O0):
<GPSPositionRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GPSPositionHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSPositionRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <GPSPositionHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @GPSPositionRequestUpdate() {
%1 = call i32 (...) @GPSPositionHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSPositionRequestUpdate() {
%1 = tail call i32 (...) @GPSPositionHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int net_set_nonblocking(int fd) {
  return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<net_set_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    0x2e99(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_set_nonblocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebp
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2eb3(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @net_set_nonblocking(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* %2
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %7, %8
%10 = call i32 (i32, i32, ...) @fcntl(i32 %3, i32 %4, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @net_set_nonblocking(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2, i32 %6)
ret i32 %7
}
/* Type definitions */
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct timespec *);
struct timespec *malloc(int);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void sleepfunc() {
  struct timespec *sleeptime = malloc(sizeof(struct timespec));
  sleeptime->tv_sec = 1;
  sleeptime->tv_nsec = 0;
  while (1) {
    printf("sleeping...\n");
    nanosleep(sleeptime, NULL);
  }
  free(sleeptime);
}


x86 assembly (clang, -O0):
<sleepfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <nanosleep@plt>
jmp    115c <sleepfunc+0x2c>

x86 assembly (clang, -O2):
<sleepfunc>:
push   %r14
push   %rbx
push   %rax
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x1,(%rax)
movq   $0x0,0x8(%rax)
lea    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <nanosleep@plt>
jmp    1160 <sleepfunc+0x30>

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@.str = [13 x i8] c"sleeping...\0A\00"
define void @sleepfunc() {
%1 = alloca %struct.timespec*
%2 = call %struct.timespec* @malloc(i32 16)
store %struct.timespec* %2, %struct.timespec** %1
%3 = load %struct.timespec*, %struct.timespec** %1
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 1, i32* %4
%5 = load %struct.timespec*, %struct.timespec** %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
store i64 0, i64* %6
br label %7
7: ; preds = %0, %7
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = load %struct.timespec*, %struct.timespec** %1
%10 = call i32 @nanosleep(%struct.timespec* %9, i32* null)
br label %7
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@str = [12 x i8] c"sleeping...\00"
define void @sleepfunc() {
%1 = tail call %struct.timespec* @malloc(i32 16)
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i64 0, i64* %3
br label %4
4: ; preds = %4, %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @nanosleep(%struct.timespec* %1, i32* null)
br label %4
}
int test_imm_AAuint16_reg(unsigned short val) {
  return ((val) & (0xAA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AAuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xaa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_AAuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 170
%6 = icmp ne i32 %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_AAuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 170
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}