xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void init_cpufreq_states(void) {
  system("/sbin/modprobe cpufreq_stats > /dev/null 2>&1");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"/sbin/modprobe cpufreq_stats > /dev/null 2>&1\00"
define void @init_cpufreq_states() {
%1 = call i32 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"/sbin/modprobe cpufreq_stats > /dev/null 2>&1\00"
define void @init_cpufreq_states() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cli_putc(int);
void nessie_send_alive_a(uint16_t i) {
  if ((i & 31) == 0)
    cli_putc(0x06);
}


x86 assembly (clang, -O0):
<nessie_send_alive_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
cmp    $0x0,%eax
jne    1134 <nessie_send_alive_a+0x24>
mov    $0x6,%edi
call   1030 <cli_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nessie_send_alive_a>:
test   $0x1f,%dil
je     1117 <nessie_send_alive_a+0x7>
ret
mov    $0x6,%edi
jmp    1030 <cli_putc@plt>

LLVM IR (-O0):
define void @nessie_send_alive_a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @cli_putc(i32 6)
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @nessie_send_alive_a(i32 %0) {
%2 = and i32 %0, 31
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @cli_putc(i32 6)
br label %6
6: ; preds = %4, %1
ret void
}
int *function_2(var)
int var;
{
  int *var_1_0;
  var_1_0 = (int *)make_shape_1d(var);
  return (var_1_0);
}


x86 assembly (clang, -O0):
<function_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <make_shape_1d@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32* @function_2(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @make_shape_1d to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
ret i32* %8
}

LLVM IR (-O2):
define i32* @function_2(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @make_shape_1d to i32 (i32, ...)*)(i32 %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ getkey();
scalar_t__ keypressed();
void flushkeys(void) {
  while (keypressed())
    getkey();
}


x86 assembly (clang, -O0):
<flushkeys>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <flushkeys+0x9>
mov    $0x0,%al
call   1030 <keypressed@plt>
cmp    $0x0,%rax
je     1146 <flushkeys+0x26>
mov    $0x0,%al
call   1040 <getkey@plt>
jmp    1129 <flushkeys+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushkeys>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <keypressed@plt>
test   %rax,%rax
je     1145 <flushkeys+0x25>
xor    %eax,%eax
call   1040 <getkey@plt>
jmp    1130 <flushkeys+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @flushkeys() {
%1 = tail call i64 (...) @keypressed()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @getkey()
%5 = tail call i64 (...) @keypressed()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__19__IO__makeOutput();
void LedsP__Led1__makeOutput(void) {
  HplAtm128GeneralIOPinP__19__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__19__IO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill(int, int, int, int, int);
void clear_flappy(int x, int y) { fill(0x001F, x, y, 34, 24); }


x86 assembly (clang, -O0):
<clear_flappy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x1f,%edi
mov    $0x22,%ecx
mov    $0x18,%r8d
call   1030 <fill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_flappy>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1f,%edi
mov    $0x22,%ecx
mov    $0x18,%r8d
jmp    1030 <fill@plt>

LLVM IR (-O0):
define void @clear_flappy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @fill(i32 31, i32 %5, i32 %6, i32 34, i32 24)
ret void
}

LLVM IR (-O2):
define void @clear_flappy(i32 %0, i32 %1) {
%3 = tail call i32 @fill(i32 31, i32 %0, i32 %1, i32 34, i32 24)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
int /*<<< orphan*/ printf(char *, size_t);
void assert_div_32(size_t x, size_t y, size_t z) {
  size_t actual = (x / y);
  printf("actual = %X\n", actual);
  assertTrue("actual == z", actual == z);
  ;
}


x86 assembly (clang, -O0):
<assert_div_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xea2(%rip),%rdi
call   1040 <assertTrue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_div_32>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1140 <assert_div_32+0x20>
xor    %edx,%edx
div    %rsi
mov    %rax,%rbx
jmp    1146 <assert_div_32+0x26>
xor    %edx,%edx
div    %esi
mov    %eax,%ebx
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %esi,%esi
cmp    %r14,%rbx
sete   %sil
lea    0xea8(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <assertTrue@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"actual = %X\0A\00"
@.str.1 = [12 x i8] c"actual == z\00"
define void @assert_div_32(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = udiv i64 %8, %9
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = icmp eq i64 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assertTrue(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"actual = %X\0A\00"
@.str.1 = [12 x i8] c"actual == z\00"
define void @assert_div_32(i64 %0, i64 %1, i64 %2) {
%4 = udiv i64 %0, %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = icmp eq i64 %4, %2
%7 = zext i1 %6 to i32
%8 = tail call i32 @assertTrue(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
/* Type definitions */
struct _glist {
  int dummy;
};

/* Variables and functions */
float glist_pixelstoy(struct _glist *, int);
float glist_dpixtody(struct _glist *x, float dypix) {
  return (dypix * (glist_pixelstoy(x, 1) - glist_pixelstoy(x, 0)));
}


x86 assembly (clang, -O0):
<glist_dpixtody>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <glist_pixelstoy@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <glist_pixelstoy@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glist_dpixtody>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <glist_pixelstoy@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <glist_pixelstoy@plt>
movss  0x8(%rsp),%xmm1
subss  %xmm0,%xmm1
mulss  0xc(%rsp),%xmm1
movaps %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct._glist = type { i32 }
define float @glist_dpixtody(%struct._glist* %0, float %1) {
%3 = alloca %struct._glist*
%4 = alloca float
store %struct._glist* %0, %struct._glist** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load %struct._glist*, %struct._glist** %3
%7 = call float @glist_pixelstoy(%struct._glist* %6, i32 1)
%8 = load %struct._glist*, %struct._glist** %3
%9 = call float @glist_pixelstoy(%struct._glist* %8, i32 0)
%10 = fsub float %7, %9
%11 = fmul float %5, %10
ret float %11
}

LLVM IR (-O2):
%struct._glist = type { i32 }
define float @glist_dpixtody(%struct._glist* %0, float %1) {
%3 = tail call float @glist_pixelstoy(%struct._glist* %0, i32 1)
%4 = tail call float @glist_pixelstoy(%struct._glist* %0, i32 0)
%5 = fsub float %3, %4
%6 = fmul float %5, %1
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ usage(char *);
int /*<<< orphan*/ xmkstemp(int /*<<< orphan*/);
int /*<<< orphan*/ xstrdup(char *);
int main(int argc, char *argv[]) {
  if (argc != 2)
    usage("Expected 1 parameter defining the temporary file template");
  xmkstemp(xstrdup(argv[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
je     115c <main+0x2c>
lea    0xea9(%rip),%rdi
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <xstrdup@plt>
mov    %eax,%edi
call   1030 <xmkstemp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1145 <main+0x15>
lea    0xec0(%rip),%rdi
call   1050 <usage@plt>
mov    0x8(%rbx),%rdi
call   1040 <xstrdup@plt>
mov    %eax,%edi
call   1030 <xmkstemp@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Expected 1 parameter defining the temporary file template\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @usage(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @xstrdup(i8* %13)
%15 = call i32 @xmkstemp(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [58 x i8] c"Expected 1 parameter defining the temporary file template\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @usage(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @xstrdup(i8* %8)
%10 = tail call i32 @xmkstemp(i32 %9)
ret i32 0
}
int overlap(int f1, int l1, int f2, int l2) {
  int len;
  len = ((l1) < (l2) ? (l1) : (l2)) - ((f1) > (f2) ? (f1) : (f2)) + 1;
  return len;
}


x86 assembly (clang, -O0):
<overlap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1127 <overlap+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    112d <overlap+0x2d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114a <overlap+0x4a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1150 <overlap+0x50>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<overlap>:
cmp    %ecx,%esi
cmovl  %esi,%ecx
cmp    %edx,%edi
cmovg  %edi,%edx
sub    %edx,%ecx
lea    0x1(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @overlap(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32, i32* %6
br label %17
15: ; preds = %4
%16 = load i32, i32* %8
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = load i32, i32* %5
br label %26
24: ; preds = %17
%25 = load i32, i32* %7
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
%28 = sub nsw i32 %18, %27
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
%30 = load i32, i32* %9
ret i32 %30
}

LLVM IR (-O2):
define i32 @overlap(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %1, %3
%6 = select i1 %5, i32 %1, i32 %3
%7 = icmp sgt i32 %0, %2
%8 = select i1 %7, i32 %0, i32 %2
%9 = sub i32 1, %8
%10 = add i32 %9, %6
ret i32 %10
}
int g(int x, int y) {
  if ((x >= 0 && x <= 1) && (y >= 0 && y <= 1))
    return x || y;
  else
    return -1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115b <g+0x5b>
cmpl   $0x1,-0x8(%rbp)
jg     115b <g+0x5b>
cmpl   $0x0,-0xc(%rbp)
jl     115b <g+0x5b>
cmpl   $0x1,-0xc(%rbp)
jg     115b <g+0x5b>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    114b <g+0x4b>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <g+0x62>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %ecx,%ecx
or     %esi,%edi
setne  %cl
cmp    $0x2,%edi
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ult i32 %3, 2
%5 = icmp ne i32 %3, 0
%6 = zext i1 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_get_property_trivial(
    void *bus, const char *destination, const char *path, const char *interface,
    const char *member, void *ret_error, char type, void *ret_ptr) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_get_property_trivial>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
mov    0x2eb4(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_get_property_trivial(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8 signext %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8
%16 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8 %6, i8* %15
store i8* %7, i8** %16
%17 = load i32, i32* @EINVAL
%18 = sub nsw i32 0, %17
ret i32 %18
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_get_property_trivial(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8 signext %6, i8* nocapture readnone %7) {
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}
/* Variables and functions */
bool isPowerOfTwo3(int n) { return n > 0 && !(n & (n - 1)); }


x86 assembly (clang, -O0):
<isPowerOfTwo3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112c <isPowerOfTwo3+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo3>:
test   %edi,%edi
jle    110f <isPowerOfTwo3+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isPowerOfTwo3(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
bool is_end_of_line(char c) {
  bool result = ((c == '\n') || (c == '\r'));
  return (result);
}


x86 assembly (clang, -O0):
<is_end_of_line>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1129 <is_end_of_line+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_end_of_line>:
cmp    $0xa,%dil
sete   %al
cmp    $0xd,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_end_of_line(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 10
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 13
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_end_of_line(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = icmp eq i8 %0, 13
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void avformat_network_init() {}


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

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

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

LLVM IR (-O2):
define void @avformat_network_init() {
ret void
}
/* Type definitions */
struct sembuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __NR_semop;
int syscall(int /*<<< orphan*/, int, struct sembuf *, unsigned int);
int semop(int semid, struct sembuf *sops, unsigned nsops) {
  return syscall(__NR_semop, semid, sops, nsops);
}


x86 assembly (clang, -O0):
<semop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semop>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.sembuf = type { i32 }
@__NR_semop = global i32 0
define i32 @semop(i32 %0, %struct.sembuf* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sembuf*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sembuf* %1, %struct.sembuf** %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_semop
%8 = load i32, i32* %4
%9 = load %struct.sembuf*, %struct.sembuf** %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, %struct.sembuf* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sembuf = type { i32 }
@__NR_semop = global i32 0
define i32 @semop(i32 %0, %struct.sembuf* %1, i32 %2) {
%4 = load i32, i32* @__NR_semop
%5 = tail call i32 @syscall(i32 %4, i32 %0, %struct.sembuf* %1, i32 %2)
ret i32 %5
}
char toHexChar(int b) {
  char c;
  if (b < 10)
    c = '0' + b;
  else
    c = 'A' + b - 10;
  return c;
}


x86 assembly (clang, -O0):
<toHexChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    111f <toHexChar+0x1f>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
jmp    112b <toHexChar+0x2b>
mov    -0x4(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toHexChar>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @toHexChar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %2
%12 = add nsw i32 65, %11
%13 = sub nsw i32 %12, 10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @toHexChar(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ back_mouse_down(double, double);
void front_mouse_down(double x, double y) { back_mouse_down(x, y); }


x86 assembly (clang, -O0):
<front_mouse_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <back_mouse_down@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<front_mouse_down>:
jmp    1030 <back_mouse_down@plt>

LLVM IR (-O0):
define void @front_mouse_down(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @back_mouse_down(double %5, double %6)
ret void
}

LLVM IR (-O2):
define void @front_mouse_down(double %0, double %1) {
%3 = tail call i32 @back_mouse_down(double %0, double %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ grt_overflow_error();
void grt_overflow_handler(int signo, siginfo_t *info, void *ptr) {
  grt_overflow_error();
}


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

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

LLVM IR (-O0):
define void @grt_overflow_handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 (...) @grt_overflow_error()
ret void
}

LLVM IR (-O2):
define void @grt_overflow_handler(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @grt_overflow_error()
ret void
}
char *strstr(const char *string1, const char *string2) {
  const char *pc;
  int n;
  n = strlen(string2);
  for (pc = string1; *pc; pc++) {
    if (!strncmp(pc, string2, n))
      return (char *)pc;
  }
  return (void *)0;
}


x86 assembly (clang, -O0):
<strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     118e <strstr+0x6e>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x24(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1178 <strstr+0x58>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1196 <strstr+0x76>
jmp    117d <strstr+0x5d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1144 <strstr+0x24>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
cmpb   $0x0,(%rbx)
je     115c <strstr+0x3c>
movslq %eax,%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncmp@plt>
test   %eax,%eax
je     115e <strstr+0x3e>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <strstr+0x20>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strstr(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = shl i64 %3, 32
%5 = ashr exact i64 %4, 32
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %2, %12
%9 = phi i8* [ %13, %12 ], [ %0, %2 ]
%10 = tail call i32 @strncmp(i8* %9, i8* %1, i64 %5)
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %12, %2
%17 = phi i8* [ null, %2 ], [ null, %12 ], [ %9, %8 ]
ret i8* %17
}
/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ wait(int *);
void sig_handler(int sig) {
  if (sig == SIGCHLD) {
    int retval;
    wait(&retval);
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1136 <sig_handler+0x26>
lea    -0x8(%rbp),%rdi
call   1030 <wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
jne    1126 <sig_handler+0x16>
lea    0x4(%rsp),%rdi
call   1030 <wait@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGCHLD = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SIGCHLD
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @wait(i32* %3)
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
%3 = load i32, i32* @SIGCHLD
%4 = icmp eq i32 %3, %0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = bitcast i32* %2 to i8*
%7 = call i32 @wait(i32* %2)
br label %8
8: ; preds = %5, %1
ret void
}
int execute_oldolduname() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_oldolduname() {
ret i32 0
}
/* Variables and functions */
int getint();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int);
int main() {
  int a;
  a = getint();
  int b;
  b = getint();
  putint(a + b);
  putchar(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getint@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getint@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    -0xc(%rbp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getint@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getint@plt>
add    %eax,%ebx
mov    %ebx,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getint()
store i32 %4, i32* %2
%5 = call i32 (...) @getint()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = call i32 @putint(i32 %8)
%10 = call i32 @putchar(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getint()
%2 = tail call i32 (...) @getint()
%3 = add nsw i32 %2, %1
%4 = tail call i32 @putint(i32 %3)
%5 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
int /*<<< orphan*/ scanf(char *, char *);
size_t strlen(char *);
void ui__internal_getString(char *s, const char *message) {
  printf(message);
  scanf("%s", s);
  s[strlen(s)] = '\0';
  return;
}


x86 assembly (clang, -O0):
<ui__internal_getString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui__internal_getString>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @ui__internal_getString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @ui__internal_getString(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) %1)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
void simple_strtoul(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<simple_strtoul>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strtoul>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.simple_strtoul = [15 x i8] c"simple_strtoul\00"
define void @simple_strtoul() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.simple_strtoul, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.simple_strtoul = [15 x i8] c"simple_strtoul\00"
define void @simple_strtoul() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.simple_strtoul, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bym(int /*<<< orphan*/);
void or_bym(uint32_t x) {
  bym(x);
  or ();
}


x86 assembly (clang, -O0):
<or_bym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bym@plt>
mov    $0x0,%al
call   1040 <or@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_bym>:
push   %rax
call   1030 <bym@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <or@plt>

LLVM IR (-O0):
define void @or_bym(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bym(i32 %3)
%5 = call i32 (...) @or()
ret void
}

LLVM IR (-O2):
define void @or_bym(i32 %0) {
%2 = tail call i32 @bym(i32 %0)
%3 = tail call i32 (...) @or()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ orgfx_enable_colorkey(unsigned int);
int /*<<< orphan*/ orgfx_set_colorkey(unsigned int);
void orgfxplus_colorkey(unsigned int colorkey, unsigned int enable) {
  orgfx_enable_colorkey(enable);
  orgfx_set_colorkey(colorkey);
}


x86 assembly (clang, -O0):
<orgfxplus_colorkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <orgfx_enable_colorkey@plt>
mov    -0x4(%rbp),%edi
call   1030 <orgfx_set_colorkey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfxplus_colorkey>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <orgfx_enable_colorkey@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <orgfx_set_colorkey@plt>

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

LLVM IR (-O2):
define void @orgfxplus_colorkey(i32 %0, i32 %1) {
%3 = tail call i32 @orgfx_enable_colorkey(i32 %1)
%4 = tail call i32 @orgfx_set_colorkey(i32 %0)
ret void
}
void ADC0triggerSampling(unsigned char selectChannels) {
  (*(volatile unsigned long *)(0xE0034000 + 0x00)) |= (selectChannels);
}


x86 assembly (clang, -O0):
<ADC0triggerSampling>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xe0034000,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0xe0034000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC0triggerSampling>:
mov    %edi,%eax
mov    $0xe0034000,%ecx
or     %rax,(%rcx)
ret

LLVM IR (-O0):
define void @ADC0triggerSampling(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = load volatile i64, i64* inttoptr (i64 3758309376 to i64*)
%6 = or i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 3758309376 to i64*)
ret void
}

LLVM IR (-O2):
define void @ADC0triggerSampling(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = load volatile i64, i64* inttoptr (i64 3758309376 to i64*)
%4 = or i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 3758309376 to i64*)
ret void
}
int test24() {
  int i;
  switch (i) {
  case 0:
    return 0;
  case 2:
    return 2;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<test24>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1128 <test24+0x28>
jmp    1117 <test24+0x17>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1134 <test24+0x34>
jmp    1140 <test24+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1147 <test24+0x47>
movl   $0x2,-0x4(%rbp)
jmp    1147 <test24+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test24() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 0, label %4
i32 2, label %5
]
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
store i32 2, i32* %1
br label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %7
7: ; preds = %6, %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test24() {
ret i32 0
}
int chToint(char ch) {
  if (ch >= '0' && ch <= '9')
    return ch - '0';
  else
    return -1;
}


x86 assembly (clang, -O0):
<chToint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <chToint+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <chToint+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <chToint+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chToint>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%al
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @chToint(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %16
15: ; preds = %7, %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @chToint(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char *, int);
int system(char *);
int hlr_system(char *cmd, int nonZeroOK) {
  int rc = system(cmd);
  if (rc == -1 || (rc != 0 && !nonZeroOK))
    die("system(%s) exit status %d.", cmd, rc);
  return rc;
}


x86 assembly (clang, -O0):
<hlr_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     1159 <hlr_system+0x39>
cmpl   $0x0,-0x10(%rbp)
je     116c <hlr_system+0x4c>
cmpl   $0x0,-0xc(%rbp)
jne    116c <hlr_system+0x4c>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xe99(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlr_system>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
call   1030 <system@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     113d <hlr_system+0x1d>
test   %ebp,%ebp
jne    114e <hlr_system+0x2e>
test   %ebx,%ebx
je     114e <hlr_system+0x2e>
lea    0xebc(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <die@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"system(%s) exit status %d.\00"
define i32 @hlr_system(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @system(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %13, %2
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18)
br label %20
20: ; preds = %16, %13, %10
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [27 x i8] c"system(%s) exit status %d.\00"
define i32 @hlr_system(i8* %0, i32 %1) {
%3 = tail call i32 @system(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = icmp eq i32 %3, 0
%7 = icmp ne i32 %1, 0
%8 = or i1 %7, %6
br i1 %8, label %11, label %9
9: ; preds = %5, %2
%10 = tail call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
br label %11
11: ; preds = %9, %5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ vdfs_close();
int /*<<< orphan*/ vdfs_new_root(char const *);
void vdfs_set_root(const char *root) {
  vdfs_close();
  vdfs_new_root(root);
}


x86 assembly (clang, -O0):
<vdfs_set_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <vdfs_close@plt>
mov    -0x8(%rbp),%rdi
call   1040 <vdfs_new_root@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdfs_set_root>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <vdfs_close@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vdfs_new_root@plt>

LLVM IR (-O0):
define void @vdfs_set_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @vdfs_close()
%4 = load i8*, i8** %2
%5 = call i32 @vdfs_new_root(i8* %4)
ret void
}

LLVM IR (-O2):
define void @vdfs_set_root(i8* %0) {
%2 = tail call i32 (...) @vdfs_close()
%3 = tail call i32 @vdfs_new_root(i8* %0)
ret void
}
/* Variables and functions */
int getchar();
unsigned Sys_GetChar() { return getchar(); }


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

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

LLVM IR (-O0):
define i32 @Sys_GetChar() {
%1 = call i32 (...) @getchar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @Sys_GetChar() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
char *epj2fd(epoch)
double epoch;
{
  double dj;
  dj = epj2jd(epoch);
  return (jd2fd(dj));
}


x86 assembly (clang, -O0):
<epj2fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <epj2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2fd@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epj2fd>:
push   %rax
mov    $0x1,%al
call   1030 <epj2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1040 <jd2fd@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @epj2fd(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (double, ...) bitcast (i32 (...)* @epj2jd to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 (double, ...) bitcast (i32 (...)* @jd2fd to i32 (double, ...)*)(double %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @epj2fd(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @epj2jd to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2fd to i32 (double, ...)*)(double %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
char *strcat(char *dest, const char *src) {
  char *d = dest;
  while (*dest++)
    ;
  while ((*dest++ = *src++))
    ;
  return d;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1131 <strcat+0x31>
jmp    1114 <strcat+0x14>
jmp    1136 <strcat+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1165 <strcat+0x65>
jmp    1136 <strcat+0x36>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %5, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}