xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void chdir_error() { perror("chdir error"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"chdir error\00"
define void @chdir_error() {
%1 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"chdir error\00"
define void @chdir_error() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
char *langDbgMemVisible() { return "Visible Memory"; }


x86 assembly (clang, -O0):
<langDbgMemVisible>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgMemVisible>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Visible Memory\00"
define i8* @langDbgMemVisible() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"Visible Memory\00"
define i8* @langDbgMemVisible() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ PR_SET_PDEATHSIG;
int /*<<< orphan*/ SIGHUP;
int execvp(char *, char **);
int /*<<< orphan*/ prctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc < 2)
    return 1;
  prctl(PR_SET_PDEATHSIG, SIGHUP, 0, 0, 0);
  return execvp(argv[1], &argv[1]);
}


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)
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1184 <main+0x64>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <prctl@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1040 <execvp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jge    112b <main+0xb>
mov    $0x1,%eax
ret
push   %rbx
mov    %rsi,%rbx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <prctl@plt>
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <execvp@plt>

LLVM IR (-O0):
@PR_SET_PDEATHSIG = global i32 0
@SIGHUP = global i32 0
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 slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %19
9: ; preds = %2
%10 = load i32, i32* @PR_SET_PDEATHSIG
%11 = load i32, i32* @SIGHUP
%12 = call i32 @prctl(i32 %10, i32 %11, i32 0, i32 0, i32 0)
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = call i32 @execvp(i8* %15, i8** %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %9, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@PR_SET_PDEATHSIG = global i32 0
@SIGHUP = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i32, i32* @PR_SET_PDEATHSIG
%6 = load i32, i32* @SIGHUP
%7 = tail call i32 @prctl(i32 %5, i32 %6, i32 0, i32 0, i32 0)
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @execvp(i8* %9, i8** %8)
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ %10, %4 ], [ 1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ iwc_print_counter(unsigned long long *, unsigned long long *,
                                     unsigned long long *, char);
void iwc_print_total_counter(unsigned long long *lines,
                             unsigned long long *words,
                             unsigned long long *bytes) {
  iwc_print_counter(lines, words, bytes, '\n');
}


x86 assembly (clang, -O0):
<iwc_print_total_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xa,%ecx
call   1030 <iwc_print_counter@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iwc_print_total_counter>:
mov    $0xa,%ecx
jmp    1030 <iwc_print_counter@plt>

LLVM IR (-O0):
define void @iwc_print_total_counter(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %4
%8 = load i64*, i64** %5
%9 = load i64*, i64** %6
%10 = call i32 @iwc_print_counter(i64* %7, i64* %8, i64* %9, i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @iwc_print_total_counter(i64* %0, i64* %1, i64* %2) {
%4 = tail call i32 @iwc_print_counter(i64* %0, i64* %1, i64* %2, i8 signext 10)
ret void
}
void introsort(int arr[], int n) {}


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

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

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

LLVM IR (-O2):
define void @introsort(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
float atof(char *);
char *read_value(char *);
float vcpfr_read_float(char *propertyName) {
  char *value = read_value(propertyName);
  if (value != NULL)
    return atof(value);
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<vcpfr_read_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <read_value@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1157 <vcpfr_read_float+0x37>
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x4(%rbp)
jmp    115f <vcpfr_read_float+0x3f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcpfr_read_float>:
push   %rax
call   1040 <read_value@plt>
test   %rax,%rax
je     1134 <vcpfr_read_float+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atof@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @vcpfr_read_float(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @read_value(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = call float @atof(i8* %10)
store float %11, float* %2
br label %13
12: ; preds = %1
store float 0.000000e+00, float* %2
br label %13
13: ; preds = %12, %9
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
define float @vcpfr_read_float(i8* %0) {
%2 = tail call i8* @read_value(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call float @atof(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi float [ %5, %4 ], [ 0.000000e+00, %1 ]
ret float %7
}
/* Variables and functions */
int factorCount(long);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long triangle = 1;
  int index = 1;
  while (factorCount(triangle) < 1001) {
    index++;
    triangle += index;
  }
  printf("%ld\n", triangle);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <factorCount@plt>
cmp    $0x3e9,%eax
jge    116c <main+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    113e <main+0x1e>
mov    -0x10(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
mov    $0x1,%edi
call   1040 <factorCount@plt>
cmp    $0x3e8,%eax
jg     1166 <main+0x46>
mov    $0x1,%r14d
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
add    %rbx,%r14
mov    %r14,%rdi
call   1040 <factorCount@plt>
add    $0x1,%rbx
cmp    $0x3e9,%eax
jl     1150 <main+0x30>
lea    0xe93(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 1, i64* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %0
%5 = load i64, i64* %2
%6 = call i32 @factorCount(i64 %5)
%7 = icmp slt i32 %6, 1001
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = load i64, i64* %2
%14 = add nsw i64 %13, %12
store i64 %14, i64* %2
br label %4
15: ; preds = %4
%16 = load i64, i64* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @factorCount(i64 1)
%2 = icmp slt i32 %1, 1001
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i64 [ %6, %3 ], [ 1, %0 ]
%5 = phi i64 [ %7, %3 ], [ 1, %0 ]
%6 = add nuw nsw i64 %4, 1
%7 = add nuw nsw i64 %5, %6
%8 = tail call i32 @factorCount(i64 %7)
%9 = icmp slt i32 %8, 1001
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = phi i64 [ 1, %0 ], [ %7, %3 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
ret i32 0
}
void atomic_and_int(volatile int *var, int v) {
  asm volatile("lock ;"
               " "
               "andl %1, %0"
               " \n\t"
               : "=m"(*var)
               : "ri"(v), "m"(*var)
               : "cc", "memory");
}


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

x86 assembly (clang, -O2):
<atomic_and_int>:
lock and %esi,(%rdi)
ret

LLVM IR (-O0):
define void @atomic_and_int(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 = load i32*, i32** %3
ret void
}

LLVM IR (-O2):
define void @atomic_and_int(i32* %0, i32 %1) {
tail call void asm sideeffect "lock ; andl $1, $0 \0A\09", "=*m,ri,*m,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1, i32* elementtype(i32) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void httpRedirect(const char *url) {
  if (url != NULL) {
    puts("Status: 301");
    printf("Location: %s\n\n", url);
  }
  return;
}


x86 assembly (clang, -O0):
<httpRedirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <httpRedirect+0x33>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpRedirect>:
test   %rdi,%rdi
je     1145 <httpRedirect+0x25>
push   %rbx
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Status: 301\00"
@.str.1 = [15 x i8] c"Location: %s\0A\0A\00"
define void @httpRedirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Status: 301\00"
@.str.1 = [15 x i8] c"Location: %s\0A\0A\00"
define void @httpRedirect(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int clock();
unsigned Sys_TickCount(void) { return clock(); }


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

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

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

LLVM IR (-O2):
define i32 @Sys_TickCount() {
%1 = tail call i32 (...) @clock()
ret i32 %1
}
long SIO1close() { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1close() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1close() {
ret i64 0
}
unsigned long leul_to_cpu(unsigned long v) { return (v); }


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

x86 assembly (clang, -O2):
<leul_to_cpu>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @leul_to_cpu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @leul_to_cpu(i64 returned %0) {
ret i64 %0
}
int test_48_4(int *mem) { return __atomic_and_fetch(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_48_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x10,%rcx
mov    %rcx,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    0x10(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    1153 <test_48_4+0x53>
jmp    112a <test_48_4+0x2a>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_48_4>:
mov    0x10(%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
and    $0x1,%ecx
lock cmpxchg %ecx,0x10(%rdi)
jne    1110 <test_48_4+0x10>
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_48_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw and i32* %6, i32 %7 acq_rel
%9 = and i32 %8, %7
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_48_4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = atomicrmw and i32* %2, i32 1 acq_rel
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void uDMADisable(void) { (*((volatile uint32_t *)(0x400FF004))) = 0; }


x86 assembly (clang, -O0):
<uDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400ff004,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMADisable>:
movq   $0x0,0x400ff004
ret

LLVM IR (-O0):
define void @uDMADisable() {
store volatile i64 0, i64* inttoptr (i64 1074786308 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMADisable() {
store volatile i64 0, i64* inttoptr (i64 1074786308 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void second(void) { printf("Second function...\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Second function...\00"
define void @second() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int palindrom(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c[1000];
  scanf("%s", c);
  printf("%d\n", palindrom(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
call   1050 <palindrom@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <palindrom@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @palindrom(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_VariableMustHaveHighLevelType(long p_position) {
  _Error(p_position, "Inappropriate type for variable");
}


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

x86 assembly (clang, -O2):
<Error_VariableMustHaveHighLevelType>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Inappropriate type for variable\00"
define void @Error_VariableMustHaveHighLevelType(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Inappropriate type for variable\00"
define void @Error_VariableMustHaveHighLevelType(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int equal(int *a, int *b) {
  if (a == NULL || b == NULL)
    return 0;
  return (*a == *b);
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <equal+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    112e <equal+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <equal+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
xor    %eax,%eax
test   %rdi,%rdi
je     1115 <equal+0x15>
test   %rsi,%rsi
je     1115 <equal+0x15>
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @equal(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 eq i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %19
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @equal(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, null
%4 = icmp eq i32* %1, null
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 0, %2 ]
ret i32 %12
}
int DeviceNameEnumerate(char **strDevName, int maxcount) {
  int count = 0;
  return count;
}


x86 assembly (clang, -O0):
<DeviceNameEnumerate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @DeviceNameEnumerate(i8** nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ isPrime(int);
uint64_t truncateRight(uint64_t right) {
  for (; right; right /= 10) {
    if (!isPrime(right))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<truncateRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115a <truncateRight+0x4a>
mov    -0x8(%rbp),%edi
call   1030 <isPrime@plt>
cmp    $0x0,%eax
jne    1142 <truncateRight+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1161 <truncateRight+0x51>
jmp    1147 <truncateRight+0x37>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    111b <truncateRight+0xb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncateRight>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
test   %edi,%edi
je     1150 <truncateRight+0x40>
mov    %edi,%ebp
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <isPrime@plt>
test   %eax,%eax
je     114e <truncateRight+0x3e>
movslq %ebp,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    $0x9,%ebp
cmp    $0x12,%ebp
mov    %eax,%ebp
ja     1120 <truncateRight+0x10>
jmp    1150 <truncateRight+0x40>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @truncateRight(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 @isPrime(i32 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7
store i32 0, i32* %2
br label %17
12: ; preds = %7
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 10
store i32 %15, i32* %3
br label %4
16: ; preds = %4
store i32 1, i32* %2
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @truncateRight(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = tail call i32 @isPrime(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = sdiv i32 %4, 10
%9 = add i32 %4, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %7, %1
%12 = phi i32 [ 1, %1 ], [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
int cdrom_dirent_read(struct cdrom_dirent *d, char *data, int length) {
  return 0;
}


x86 assembly (clang, -O0):
<cdrom_dirent_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cdrom_dirent = type opaque
define i32 @cdrom_dirent_read(%struct.cdrom_dirent* %0, i8* %1, i32 %2) {
%4 = alloca %struct.cdrom_dirent*
%5 = alloca i8*
%6 = alloca i32
store %struct.cdrom_dirent* %0, %struct.cdrom_dirent** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.cdrom_dirent = type opaque
define i32 @cdrom_dirent_read(%struct.cdrom_dirent* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ call(int, int);
int main() {
  call(1, 2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <call@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @call(i32 1, i32 2)
ret i32 0
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 "
         "REPO_URL=heads/s-kitkat-3.4-universal3470-topic "
         "REVISION=r4p0-00rel0-Ruby-JB433-3C05R1-g-320-g1a7bdd5 "
         "CHANGED_REVISION=Ruby-JB433-3C05R1-g-320-g1a7bdd5 "
         "CHANGE_DATE=2013-12-13 16:37:33 +0900 BUILD_DATE=Fri Dec 13 16:57:40 "
         "KST 2013 BUILD=release TARGET_PLATFORM=exynos3470 "
         "MALI_PLATFORM=exynos3470 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 "
         "USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= "
         "USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [505 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/s-kitkat-3.4-universal3470-topic REVISION=r4p0-00rel0-Ruby-JB433-3C05R1-g-320-g1a7bdd5 CHANGED_REVISION=Ruby-JB433-3C05R1-g-320-g1a7bdd5 CHANGE_DATE=2013-12-13 16:37:33 +0900 BUILD_DATE=Fri Dec 13 16:57:40 KST 2013 BUILD=release TARGET_PLATFORM=exynos3470 MALI_PLATFORM=exynos3470 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([505 x i8], [505 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [505 x i8] c"malidrv: API_VERSION=401 REPO_URL=heads/s-kitkat-3.4-universal3470-topic REVISION=r4p0-00rel0-Ruby-JB433-3C05R1-g-320-g1a7bdd5 CHANGED_REVISION=Ruby-JB433-3C05R1-g-320-g1a7bdd5 CHANGE_DATE=2013-12-13 16:37:33 +0900 BUILD_DATE=Fri Dec 13 16:57:40 KST 2013 BUILD=release TARGET_PLATFORM=exynos3470 MALI_PLATFORM=exynos3470 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([505 x i8], [505 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL_RES;

/* Variables and functions */
int mysql_num_rows(int /*<<< orphan*/ *);
int MysqlGetNumRows(MYSQL_RES *sqlResult) {
  if (sqlResult == NULL)
    return 0;
  return mysql_num_rows(sqlResult);
}


x86 assembly (clang, -O0):
<MysqlGetNumRows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <MysqlGetNumRows+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <MysqlGetNumRows+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <mysql_num_rows@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MysqlGetNumRows>:
test   %rdi,%rdi
je     111a <MysqlGetNumRows+0xa>
jmp    1030 <mysql_num_rows@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @MysqlGetNumRows(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @mysql_num_rows(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void UserClose(struct Robot *robot) {}


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

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

LLVM IR (-O0):
%struct.Robot = type opaque
define void @UserClose(%struct.Robot* %0) {
%2 = alloca %struct.Robot*
store %struct.Robot* %0, %struct.Robot** %2
ret void
}

LLVM IR (-O2):
%struct.Robot = type opaque
define void @UserClose(%struct.Robot* nocapture %0) {
ret void
}
indreg0adr1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*p0) = (*((short *)11111111)); }


x86 assembly (clang, -O0):
<indreg0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adr1_set>:
movzwl 0xa98ac7,%eax
mov    %ax,(%r8)
ret

LLVM IR (-O0):
define i32 @indreg0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 11111111 to i16*)
%17 = load i16*, i16** %12
store i16 %16, i16* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @indreg0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 11111111 to i16*)
store i16 %7, i16* %4
ret i32 undef
}
void JugarSupervivencia() {}


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

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

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

LLVM IR (-O2):
define void @JugarSupervivencia() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_bool_compare(const void *p1, const void *p2,
                                           size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_bool_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_bool_compare>:
push   %rax
call   1030 <bcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_bool_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_bool_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ reset_prog_mode();
int /*<<< orphan*/ schedule_redraw();
void received_sigcont(void) {
  reset_prog_mode();
  schedule_redraw();
}


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

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

LLVM IR (-O0):
define void @received_sigcont() {
%1 = call i32 (...) @reset_prog_mode()
%2 = call i32 (...) @schedule_redraw()
ret void
}

LLVM IR (-O2):
define void @received_sigcont() {
%1 = tail call i32 (...) @reset_prog_mode()
%2 = tail call i32 (...) @schedule_redraw()
ret void
}
int main() {
  char n = 's';
  char Array[20] = {"Miss Dong"};
  printf("%d", count_char(Array, &n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x73,-0x5(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1030 <count_char@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movb   $0x73,0xf(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1030 <count_char@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.Array = [20 x i8] c"Miss Dong\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [20 x i8]
store i8 115, i8* %1
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @count_char to i32 (i8*, i8*, ...)*)(i8* %3, i8* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int compute_len(int n) {
  int len = 1;
  while (n != 1) {
    len++;
    n = n & 1 ? 3 * n + 1 : n >> 1;
  }
  return len;
}


x86 assembly (clang, -O0):
<compute_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1153 <compute_len+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113f <compute_len+0x3f>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <compute_len+0x48>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <compute_len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_len>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     1127 <compute_len+0x27>
mov    $0x1,%eax
nop
add    $0x1,%eax
mov    %edi,%ecx
sar    %ecx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%edi
cmove  %ecx,%edi
cmp    $0x1,%edi
jne    1110 <compute_len+0x10>
ret

LLVM IR (-O0):
define i32 @compute_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = load i32, i32* %2
%15 = mul nsw i32 3, %14
%16 = add nsw i32 %15, 1
br label %20
17: ; preds = %7
%18 = load i32, i32* %2
%19 = ashr i32 %18, 1
br label %20
20: ; preds = %17, %13
%21 = phi i32 [ %16, %13 ], [ %19, %17 ]
store i32 %21, i32* %2
br label %4
22: ; preds = %4
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @compute_len(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %12, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
%9 = mul nsw i32 %5, 3
%10 = add nsw i32 %9, 1
%11 = ashr i32 %5, 1
%12 = select i1 %8, i32 %11, i32 %10
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %15
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRC1_get(void) { return U_WMRCORENONE_get("U_WMRC1"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRC1\00"
define i32 @U_WMRC1_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC1\00"
define i32 @U_WMRC1_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smax(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smax(N, x, stride);
  printf("max: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_smax@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_smax@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"max: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smax(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"max: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smax(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_7267() {
  Assert_real((isqrt(7267) == 85),
              "/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/stdlib/isqrt.c",
              1425, ("Integer square root of 7267 should be 85"));
}


x86 assembly (clang, -O0):
<t_sqrt_7267>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c63,%edi
call   1030 <isqrt@plt>
cmp    $0x55,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x591,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_7267>:
push   %rax
mov    $0x1c63,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x55,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x591,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 7267 should be 85\00"
define void @t_sqrt_7267() {
%1 = call i32 @isqrt(i32 7267)
%2 = icmp eq i32 %1, 85
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1425, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 7267 should be 85\00"
define void @t_sqrt_7267() {
%1 = tail call i32 @isqrt(i32 7267)
%2 = icmp eq i32 %1, 85
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1425, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ehci_vdbg(struct ehci_hcd *ehci, ...) {}


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

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

LLVM IR (-O0):
%struct.ehci_hcd = type opaque
define void @ehci_vdbg(%struct.ehci_hcd* %0, ...) {
%2 = alloca %struct.ehci_hcd*
store %struct.ehci_hcd* %0, %struct.ehci_hcd** %2
ret void
}

LLVM IR (-O2):
%struct.ehci_hcd = type opaque
define void @ehci_vdbg(%struct.ehci_hcd* nocapture %0, ...) {
ret void
}
/* Type definitions */
struct daemon_session {
  int dummy;
};

/* Variables and functions */
int serve_reg_write(struct daemon_session *);
int serve_central_write(struct daemon_session *dsess) {
  return serve_reg_write(dsess);
}


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

x86 assembly (clang, -O2):
<serve_central_write>:
jmp    1030 <serve_reg_write@plt>

LLVM IR (-O0):
%struct.daemon_session = type { i32 }
define i32 @serve_central_write(%struct.daemon_session* %0) {
%2 = alloca %struct.daemon_session*
store %struct.daemon_session* %0, %struct.daemon_session** %2
%3 = load %struct.daemon_session*, %struct.daemon_session** %2
%4 = call i32 @serve_reg_write(%struct.daemon_session* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.daemon_session = type { i32 }
define i32 @serve_central_write(%struct.daemon_session* %0) {
%2 = tail call i32 @serve_reg_write(%struct.daemon_session* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
void gen_immediate(void) { output_with_tab("lxi \th,"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"lxi \09h,\00"
define void @gen_immediate() {
%1 = call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"lxi \09h,\00"
define void @gen_immediate() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;
typedef unsigned int const uint16_t;

/* Variables and functions */
uint16_t le16toh_ptr(const uint8_t *p) { return p[0] | (p[1] << 8U); }


x86 assembly (clang, -O0):
<le16toh_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le16toh_ptr>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @le16toh_ptr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @le16toh_ptr(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}