xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int execv(char const *, char *const *);
void do_execv(const char **argv) {
  const char *path = argv[0];
  int result = execv(path, (char *const *)argv);
  if (result == -1)
    die("exec failed");
}


x86 assembly (clang, -O0):
<do_execv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <execv@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    115d <do_execv+0x3d>
lea    0xea8(%rip),%rdi
call   1030 <die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_execv>:
push   %rax
mov    %rdi,%rsi
mov    (%rdi),%rdi
call   1040 <execv@plt>
cmp    $0xffffffff,%eax
je     1133 <do_execv+0x13>
pop    %rax
ret
lea    0xec6(%rip),%rdi
pop    %rax
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"exec failed\00"
define void @do_execv(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8**, i8*** %2
%10 = call i32 @execv(i8* %8, i8** %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"exec failed\00"
define void @do_execv(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execv(i8* %2, i8** %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
int do_508() { return 508; }


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

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

LLVM IR (-O0):
define i32 @do_508() {
ret i32 508
}

LLVM IR (-O2):
define i32 @do_508() {
ret i32 508
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("in test()\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"in test()\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int PAPI_unregister_thread();
void papif_unregster_thread__(int *check) { *check = PAPI_unregister_thread(); }


x86 assembly (clang, -O0):
<papif_unregster_thread__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_unregister_thread@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_unregster_thread__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_unregister_thread@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_unregster_thread__(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_unregister_thread()
store i32 %2, i32* %0
ret void
}
I0AX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (22 <= (((unsigned int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rdx
mov    $0x16,%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
ja     113b <I0AX1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <I0AX1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0AX1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmpl   $0x16,0xa98ac7(,%rcx,4)
16
setae  %al
ret

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

LLVM IR (-O2):
define i32 @I0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = icmp ugt i32 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
struct hm_pool {
  int dummy;
};

/* Variables and functions */
scalar_t__ hm_pool_malloc(struct hm_pool *, size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *hm_pool_strlendup(struct hm_pool *po, const char *str, size_t len) {
  char *ret = (char *)hm_pool_malloc(po, len + 1);
  memcpy(ret, str, len);
  ret[len] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<hm_pool_strlendup>:
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    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1040 <hm_pool_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hm_pool_strlendup>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
lea    0x1(%rdx),%rsi
call   1040 <hm_pool_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.hm_pool = type { i32 }
define i8* @hm_pool_strlendup(%struct.hm_pool* %0, i8* %1, i64 %2) {
%4 = alloca %struct.hm_pool*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct.hm_pool* %0, %struct.hm_pool** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.hm_pool*, %struct.hm_pool** %4
%9 = load i64, i64* %6
%10 = add i64 %9, 1
%11 = call i64 @hm_pool_malloc(%struct.hm_pool* %8, i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %7
%18 = load i64, i64* %6
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %7
ret i8* %20
}

LLVM IR (-O2):
%struct.hm_pool = type { i32 }
define i8* @hm_pool_strlendup(%struct.hm_pool* %0, i8* %1, i64 %2) {
%4 = add i64 %2, 1
%5 = tail call i64 @hm_pool_malloc(%struct.hm_pool* %0, i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memcpy(i8* %6, i8* %1, i64 %2)
%8 = getelementptr inbounds i8, i8* %6, i64 %2
store i8 0, i8* %8
ret i8* %6
}
/* Variables and functions */
char *strdup(char *);
int /*<<< orphan*/ timlib_escape_character_array(char *, char *, char *);
char *timlib_sql_injection_escape(char *source) {
  char destination[131072];
  timlib_escape_character_array(destination, source, "`'$;%");
  return strdup(destination);
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"`'$;%\00"
define i8* @timlib_sql_injection_escape(i8* %0) {
%2 = alloca i8*
%3 = alloca [131072 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [131072 x i8], [131072 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @timlib_escape_character_array(i8* %4, i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [131072 x i8], [131072 x i8]* %3, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"`'$;%\00"
define noalias i8* @timlib_sql_injection_escape(i8* %0) {
%2 = alloca [131072 x i8]
%3 = getelementptr inbounds [131072 x i8], [131072 x i8]* %2, i64 0, i64 0
%4 = call i32 @timlib_escape_character_array(i8* %3, i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
/* Variables and functions */
scalar_t__ g(int);
int /*<<< orphan*/ h(int);
int f(int x) {
out_err:
  if (g(x)) {
    h(x);
  }
  goto out_err;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <g@plt>
cmp    $0x0,%rax
je     1145 <f+0x25>
mov    -0x4(%rbp),%edi
call   1030 <h@plt>
jmp    112b <f+0xb>

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1040 <g@plt>
test   %rax,%rax
je     1130 <f+0x10>
mov    %ebx,%edi
call   1030 <h@plt>
jmp    1130 <f+0x10>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %10, %1
%4 = load i32, i32* %2
%5 = call i64 @g(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @h(i32 %8)
br label %10
10: ; preds = %7, %3
br label %3
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
br label %2
2: ; preds = %7, %1
%3 = tail call i64 @g(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @h(i32 %0)
br label %7
7: ; preds = %5, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ test_taskloop_normal();
scalar_t__ test_taskloop_simd_normal();
int main() {
  int err = 0;
#pragma omp parallel reduction(| : err)
#pragma omp single
  {
    if (test_taskloop_normal() || test_taskloop_simd_normal())
      err = 1;
  }
  if (err)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_taskloop_normal@plt>
cmp    $0x0,%rax
jne    1168 <main+0x38>
mov    $0x0,%al
call   1040 <test_taskloop_simd_normal@plt>
cmp    $0x0,%rax
je     116f <main+0x3f>
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1180 <main+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_taskloop_normal@plt>
test   %rax,%rax
jne    114d <main+0x1d>
xor    %eax,%eax
call   1040 <test_taskloop_simd_normal@plt>
test   %rax,%rax
jne    114d <main+0x1d>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test_taskloop_normal()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 (...) @test_taskloop_simd_normal()
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0, %3
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ myAcronmy(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, const char *argv[]) {
  char dst[100];
  char src[] = "This program is print";
  myAcronmy(dst, src);
  printf("%s\n", dst);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0xa0(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x90(%rbp)
mov    0xeac(%rip),%ax
mov    %ax,-0x8c(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1040 <myAcronmy@plt>
lea    -0x80(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x746e6972702073,%rax
mov    %rax,0xe(%rsp)
lea    0x20(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <myAcronmy@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.src = [22 x i8] c"This program is print\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca [22 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [22 x i8]* %7 to i8*
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = getelementptr inbounds [22 x i8], [22 x i8]* %7, i64 0, i64 0
%11 = call i32 @myAcronmy(i8* %9, i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [22 x i8] c"This program is print\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca [22 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [22 x i8], [22 x i8]* %4, i64 0, i64 0
%7 = call i32 @myAcronmy(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, size_t);
void bmp_init(uint8_t *buf, size_t numbytes) { memset(buf, 0x00, numbytes); }


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

x86 assembly (clang, -O2):
<bmp_init>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bmp_init(i32* %0, i64 %1) {
%3 = tail call i32 @memset(i32* %0, i32 0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__1__GeneralIO__clr();
void CC2420TransmitP__CSN__clr(void) { Msp430GpioC__1__GeneralIO__clr(); }


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

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

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

LLVM IR (-O2):
define void @CC2420TransmitP__CSN__clr() {
%1 = tail call i32 (...) @Msp430GpioC__1__GeneralIO__clr()
ret void
}
int ad_getnew() {
  static int cur = 10;
  return cur++;
}


x86 assembly (clang, -O0):
<ad_getnew>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ad_getnew>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@ad_getnew.cur = internal global i32 10
define i32 @ad_getnew() {
%1 = load i32, i32* @ad_getnew.cur
%2 = add nsw i32 %1, 1
store i32 %2, i32* @ad_getnew.cur
ret i32 %1
}

LLVM IR (-O2):
@ad_getnew.cur = internal unnamed_addr global i32 10
define i32 @ad_getnew() {
%1 = load i32, i32* @ad_getnew.cur
%2 = add nsw i32 %1, 1
store i32 %2, i32* @ad_getnew.cur
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void strcpy_fn(char *x) { strcpy(x, (char *)&strcpy_fn); }


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

x86 assembly (clang, -O2):
<strcpy_fn>:
mov    0x2ec1(%rip),%rsi
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @strcpy_fn(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* bitcast (void (i8*)* @strcpy_fn to i8*))
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
struct TYPE_3__ {
  int si_signo;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
scalar_t__ sigtimedwait(int /*<<< orphan*/ const *, TYPE_1__ *,
                        int /*<<< orphan*/);
int sigwait(const sigset_t *restrict mask, int *restrict sig) {
  siginfo_t si;
  if (sigtimedwait(mask, &si, 0) < 0)
    return -1;
  *sig = si.si_signo;
  return 0;
}


x86 assembly (clang, -O0):
<sigwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigtimedwait@plt>
cmp    $0x0,%rax
jge    1145 <sigwait+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <sigwait+0x45>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigwait>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsp,%rsi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <sigtimedwait@plt>
test   %rax,%rax
js     1130 <sigwait+0x20>
mov    (%rsp),%eax
mov    %eax,(%r14)
jmp    1135 <sigwait+0x25>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @sigwait(i32* noalias %0, i32* noalias %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca %struct.TYPE_3__
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = call i64 @sigtimedwait(i32* %7, %struct.TYPE_3__* %6, i32 0)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %15
11: ; preds = %2
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %5
store i32 %13, i32* %14
store i32 0, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @sigwait(i32* noalias %0, i32* noalias nocapture writeonly %1) {
%3 = alloca %struct.TYPE_3__
%4 = bitcast %struct.TYPE_3__* %3 to i8*
%5 = call i64 @sigtimedwait(i32* %0, %struct.TYPE_3__* %3, i32 0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sys_getpid();
int sys_kill(int /*<<< orphan*/, int);
int sys_raise(int sig) { return sys_kill(sys_getpid(), sig); }


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

x86 assembly (clang, -O2):
<sys_raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <sys_getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <sys_kill@plt>

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

LLVM IR (-O2):
define i32 @sys_raise(i32 %0) {
%2 = tail call i32 (...) @sys_getpid()
%3 = tail call i32 @sys_kill(i32 %2, i32 %0)
ret i32 %3
}
/* Type definitions */
typedef unsigned long long uint64_t;
typedef unsigned long long int64_t;

/* Variables and functions */
uint64_t cntleadzeros(uint64_t size, uint64_t src) {
  int64_t i;
  for (i = (int64_t)size - 1; i >= 0; i--) {
    if (src & (1ull << i))
      return (uint64_t)(size - (i + 1));
  }
  return (uint64_t)size;
}


x86 assembly (clang, -O0):
<cntleadzeros>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jb     1171 <cntleadzeros+0x71>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     115b <cntleadzeros+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <cntleadzeros+0x79>
jmp    1160 <cntleadzeros+0x60>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <cntleadzeros+0x18>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cntleadzeros>:
add    $0xffffffffffffffff,%rdi
mov    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
bt     %rdi,%rsi
lea    -0x1(%rdi),%rdi
jae    1110 <cntleadzeros+0x10>
ret

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

LLVM IR (-O2):
define i64 @cntleadzeros(i64 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %0, %2 ], [ %5, %3 ]
%5 = add i64 %4, -1
%6 = shl nuw i64 1, %5
%7 = and i64 %6, %1
%8 = icmp eq i64 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = sub i64 %0, %4
ret i64 %10
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
uint16_t rol16(uint16_t in, unsigned shift) {
  return (in << shift) | (in >> (16 - shift));
}


x86 assembly (clang, -O0):
<rol16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol16>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x10,%dl
sub    %cl,%dl
mov    %edx,%ecx
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol16(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 16, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol16(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 16, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void exit_text_ui(void) {}


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

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

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

LLVM IR (-O2):
define void @exit_text_ui() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Hola a todos", "Nada más");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hola a todos\00"
@.str.1 = [10 x i8] c"Nada m\C3\A1s\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hola a todos\00"
@.str.1 = [10 x i8] c"Nada m\C3\A1s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void interrupt_handler(int signo) {
  if (signo == SIGINT) {
    fprintf(stderr, "Interrupt signal received\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    1160 <interrupt_handler+0x40>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_handler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
je     112e <interrupt_handler+0xe>
pop    %rax
ret
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"Interrupt signal received\0A\00"
@EXIT_FAILURE = global i32 0
define void @interrupt_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@stderr = global i32 0
@.str = [27 x i8] c"Interrupt signal received\0A\00"
@EXIT_FAILURE = global i32 0
define void @interrupt_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
char *g_ucs4_to_utf8(int /*<<< orphan*/ const *, int /*<<< orphan*/, long *,
                     long *, int /*<<< orphan*/ *);
char *stringprep_ucs4_to_utf8(const uint32_t *str, ssize_t len,
                              size_t *items_read, size_t *items_written) {
  return g_ucs4_to_utf8(str, len, (long *)items_read, (long *)items_written,
                        NULL);
}


x86 assembly (clang, -O0):
<stringprep_ucs4_to_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <g_ucs4_to_utf8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringprep_ucs4_to_utf8>:
xor    %r8d,%r8d
jmp    1030 <g_ucs4_to_utf8@plt>

LLVM IR (-O0):
define i8* @stringprep_ucs4_to_utf8(i32* %0, i32 %1, i64* %2, i64* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i64*
%8 = alloca i64*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i64*, i64** %7
%12 = load i64*, i64** %8
%13 = call i8* @g_ucs4_to_utf8(i32* %9, i32 %10, i64* %11, i64* %12, i32* null)
ret i8* %13
}

LLVM IR (-O2):
define i8* @stringprep_ucs4_to_utf8(i32* %0, i32 %1, i64* %2, i64* %3) {
%5 = tail call i8* @g_ucs4_to_utf8(i32* %0, i32 %1, i64* %2, i64* %3, i32* null)
ret i8* %5
}
/* Variables and functions */
int bin_sch(char *, char);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  if (argc < 3)
    return (0);
  printf("%d\n", bin_sch(argv[1], argv[2][0]));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1179 <main+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%esi
call   1040 <bin_sch@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jl     1148 <main+0x28>
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rax
movsbl (%rax),%esi
call   1040 <bin_sch@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = tail call i32 @bin_sch(i8* %6, i8 signext %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %2, %4
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *strchr(char *, char);
char *cpu_info_strval(char *ptr) {
  if ((ptr = strchr(ptr, ':'))) {
    ptr++;
    while (isspace(*ptr))
      ptr++;
    return ptr;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<cpu_info_strval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1188 <cpu_info_strval+0x68>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     117b <cpu_info_strval+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1154 <cpu_info_strval+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <cpu_info_strval+0x70>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_info_strval>:
push   %rbx
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1154 <cpu_info_strval+0x34>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1040 <isspace@plt>
test   %rax,%rax
jne    1140 <cpu_info_strval+0x20>
jmp    1156 <cpu_info_strval+0x36>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @cpu_info_strval(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %2, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = tail call i64 @isspace(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i8* [ null, %1 ], [ %6, %4 ]
ret i8* %11
}
/* Variables and functions */
int EOF;
int getch();
int /*<<< orphan*/ ungetch(int);
char comment(void) {
  int c;
  while ((c = getch()) != EOF)
    if (c == '*') {
      if ((c = getch()) == '/')
        break;
      else
        ungetch(c);
    }
  return c;
}


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     1175 <comment+0x55>
cmpl   $0x2a,-0x4(%rbp)
jne    1170 <comment+0x50>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x2f,%eax
jne    1163 <comment+0x43>
jmp    1175 <comment+0x55>
mov    -0x4(%rbp),%edi
call   1030 <ungetch@plt>
jmp    1170 <comment+0x50>
jmp    1128 <comment+0x8>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
push   %rbx
xor    %eax,%eax
call   1040 <getch@plt>
mov    0x2eb9(%rip),%rbx
jmp    1147 <comment+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getch@plt>
cmp    (%rbx),%eax
je     116a <comment+0x4a>
cmp    $0x2a,%eax
jne    1140 <comment+0x20>
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0x2f,%eax
je     1165 <comment+0x45>
mov    %eax,%edi
call   1030 <ungetch@plt>
jmp    1140 <comment+0x20>
mov    $0x2f,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define signext i8 @comment() {
%1 = alloca i32
br label %2
2: ; preds = %17, %0
%3 = call i32 (...) @getch()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 42
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = call i32 (...) @getch()
store i32 %10, i32* %1
%11 = icmp eq i32 %10, 47
br i1 %11, label %12, label %13
12: ; preds = %9
br label %18
13: ; preds = %9
%14 = load i32, i32* %1
%15 = call i32 @ungetch(i32 %14)
br label %16
16: ; preds = %13
br label %17
17: ; preds = %16, %6
br label %2
18: ; preds = %12, %2
%19 = load i32, i32* %1
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
@EOF = global i32 0
define signext i8 @comment() {
%1 = tail call i32 (...) @getch()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %16, label %4
4: ; preds = %0, %12
%5 = phi i32 [ %13, %12 ], [ %1, %0 ]
%6 = icmp eq i32 %5, 42
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = tail call i32 (...) @getch()
%9 = icmp eq i32 %8, 47
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = tail call i32 @ungetch(i32 %8)
br label %12
12: ; preds = %10, %4
%13 = tail call i32 (...) @getch()
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %4
16: ; preds = %12, %7, %0
%17 = phi i32 [ %1, %0 ], [ 47, %7 ], [ %13, %12 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}
/* Variables and functions */
int random();
void loop(int a, int b) {
  if (b > 0) {
    int r = random();
    b = a - 1 - r;
    a = a - 1 - r;
    loop(a, b);
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1165 <loop+0x45>
mov    $0x0,%al
call   1040 <random@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <loop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rbx
test   %esi,%esi
jle    112f <loop+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
not    %eax
add    %eax,%ebx
test   %ebx,%ebx
jg     1120 <loop+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @loop(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = call i32 (...) @random()
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = load i32, i32* %4
br label %20
20: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @loop(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = tail call i32 (...) @random()
%7 = xor i32 %6, -1
%8 = add i32 %5, %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_hutaow();
int main(int argc, char *argv[]) {
  test_hutaow();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_hutaow()
ret i32 0
}
float kmph2mph(float kmph) { return kmph / 1.609344; }


x86 assembly (clang, -O0):
<kmph2mph>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmph2mph>:
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @kmph2mph(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 0x3FF9BFDF7E8038A0
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @kmph2mph(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 0x3FF9BFDF7E8038A0
%4 = fptrunc double %3 to float
ret float %4
}
int str_has_char(char *s) {
  char c;
  if (!s)
    return (-1);
  while ((c = *s++)) {
    if (c != ' ')
      break;
  }
  if (c)
    return (0);
  else
    return (-1);
}


x86 assembly (clang, -O0):
<str_has_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <str_has_char+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <str_has_char+0x74>
jmp    1124 <str_has_char+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1157 <str_has_char+0x57>
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
je     1152 <str_has_char+0x52>
jmp    1157 <str_has_char+0x57>
jmp    1124 <str_has_char+0x24>
cmpb   $0x0,-0x11(%rbp)
je     116d <str_has_char+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    1174 <str_has_char+0x74>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_has_char>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1122 <str_has_char+0x22>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x20,%cl
je     1110 <str_has_char+0x10>
test   %cl,%cl
je     1122 <str_has_char+0x22>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_has_char(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %5, %3 ], [ %0, %1 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 32, label %3
i8 0, label %8
]
7: ; preds = %3
br label %8
8: ; preds = %3, %7, %1
%9 = phi i32 [ -1, %1 ], [ 0, %7 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
struct in_addr {
  int dummy;
};
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ memcpy(struct in_addr *, void *, int);
int /*<<< orphan*/ printf(char *, char *);
void print_ip(void *buf) {
  struct in_addr addr;
  memcpy(&addr, buf, sizeof(addr));
  printf("%s", inet_ntoa(addr));
}


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

x86 assembly (clang, -O2):
<print_ip>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    (%rsp),%edi
call   1030 <inet_ntoa@plt>
lea    0xeb0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @print_ip(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.in_addr
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(%struct.in_addr* %3, i8* %4, i32 4)
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i8* @inet_ntoa(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @print_ip(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i32 @memcpy(%struct.in_addr* %2, i8* %0, i32 4)
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i8* @inet_ntoa(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M600_f(char *s) {
  debug("M600_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M600_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M600_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M600_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M600_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}