xunge/DecIR huggingface dataset:
int sum_upto(n)
int n;
{
  int i;
  int retval = 0;
  for (i = 1; i <= n; ++i)
    retval += i;
  return retval;
}


x86 assembly (clang, -O0):
<sum_upto>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <sum_upto+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <sum_upto+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_upto>:
test   %edi,%edi
jle    1118 <sum_upto+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum_upto(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *check_realloc(void *place, size_t new_size) {
  place = realloc(place, new_size);
  if (!place) {
    fprintf(stderr, "check_realloc: out of memory! (fatal)\n");
    exit(-1);
  }
  return place;
}


x86 assembly (clang, -O0):
<check_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117b <check_realloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_realloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <check_realloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"check_realloc: out of memory! (fatal)\0A\00"
define i8* @check_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"check_realloc: out of memory! (fatal)\0A\00"
define noalias i8* @check_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret i8* %3
}
int test() { return 100; }


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

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

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

LLVM IR (-O2):
define i32 @test() {
ret i32 100
}
/* Variables and functions */
unsigned long SHR(unsigned long, unsigned long);
unsigned long int ROTR(unsigned long int x, unsigned long int n) {
  return (SHR(x, n) | (x << (32 - n)));
}


x86 assembly (clang, -O0):
<ROTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <SHR@plt>
mov    -0x8(%rbp),%rdx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROTR>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <SHR@plt>
add    $0x20,%rbx
neg    %rbx
mov    %ebx,%ecx
shl    %cl,%r14
or     %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @ROTR(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @SHR(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = sub i64 32, %9
%11 = shl i64 %8, %10
%12 = or i64 %7, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @ROTR(i64 %0, i64 %1) {
%3 = tail call i64 @SHR(i64 %0, i64 %1)
%4 = sub i64 32, %1
%5 = shl i64 %0, %4
%6 = or i64 %3, %5
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ real_pread(int, void *, size_t, int /*<<< orphan*/);
scalar_t__ smbw_fd(int);
int /*<<< orphan*/ smbw_pread(int, void *, size_t, int /*<<< orphan*/);
ssize_t pread(int fd, void *buf, size_t size, off_t ofs) {
  if (smbw_fd(fd)) {
    return smbw_pread(fd, buf, size, ofs);
  }
  return real_pread(fd, buf, size, ofs);
}


x86 assembly (clang, -O0):
<pread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <smbw_fd@plt>
cmp    $0x0,%rax
je     1173 <pread+0x43>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <smbw_pread@plt>
mov    %eax,-0x4(%rbp)
jmp    1189 <pread+0x59>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1050 <real_pread@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pread>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %edi,%ebx
call   1040 <smbw_fd@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
test   %rax,%rax
je     1166 <pread+0x36>
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <smbw_pread@plt>
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <real_pread@plt>

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

LLVM IR (-O2):
define i32 @pread(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i64 @smbw_fd(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @smbw_pread(i32 %0, i8* %1, i64 %2, i32 %3)
br label %11
9: ; preds = %4
%10 = tail call i32 @real_pread(i32 %0, i8* %1, i64 %2, i32 %3)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char *, size_t);
ssize_t readlink(const char *restrict path, char *restrict buf,
                 size_t bufsize) {
  return syscall(85, path, buf, bufsize);
}


x86 assembly (clang, -O0):
<readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x55,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlink>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x55,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @readlink(i8* noalias %0, i8* noalias %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 @syscall(i32 85, i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @readlink(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = tail call i32 @syscall(i32 85, i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __bswap_variable_32(int /*<<< orphan*/);
__attribute__((always_)) void __bswap_32s(uint32_t *x) {
  *x = __bswap_variable_32(*x);
}


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

x86 assembly (clang, -O2):
<__bswap_32s>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <__bswap_variable_32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__bswap_32s(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @__bswap_variable_32(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int *nr_ivector(long nl, long nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(int)));
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<nr_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr_ivector>:
push   %rbx
mov    %rdi,%rbx
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1030 <malloc@plt>
shl    $0x2,%rbx
neg    %rbx
add    %rbx,%rax
add    $0x4,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @nr_ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = load i64, i64* %3
%16 = sub i64 0, %15
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = getelementptr inbounds i32, i32* %17, i64 1
ret i32* %18
}

LLVM IR (-O2):
define i32* @nr_ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i32*
%8 = sub i64 0, %0
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 1
ret i32* %10
}
void path_039_expected_1(int y) {
  while (0) {
    y++;
  }
}


x86 assembly (clang, -O0):
<path_039_expected_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1116 <path_039_expected_1+0x16>
jmp    1124 <path_039_expected_1+0x24>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <path_039_expected_1+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @path_039_expected_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %4, %1
br i1 false, label %4, label %7
4: ; preds = %3
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
br label %3
7: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @path_039_expected_1(i32 %0) {
ret void
}
void assign_byte(void *ptr) {
  char *c = ptr;
  c[0] = 1;
}


x86 assembly (clang, -O0):
<assign_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_byte>:
movb   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @assign_byte(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 1, i8* %6
ret void
}

LLVM IR (-O2):
define void @assign_byte(i8* nocapture writeonly %0) {
store i8 1, i8* %0
ret void
}
void __asan_set_error_report_callback() {}


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

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

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

LLVM IR (-O2):
define void @__asan_set_error_report_callback() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
scalar_t__ alloca(int);
int cstrlen(char *);
int main() {
  int length1 = __VERIFIER_nondet_int();
  if (length1 < 1) {
    length1 = 1;
  }
  char *nondetString1 = (char *)alloca(length1 * sizeof(char));
  nondetString1[length1 - 1] = '\0';
  return cstrlen(nondetString1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    115a <main+0x2a>
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
call   1030 <cstrlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0x1,%ebx
cmovg  %eax,%ebx
mov    %ebx,%edi
call   1040 <alloca@plt>
add    $0xffffffff,%ebx
movb   $0x0,(%rax,%rbx,1)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <cstrlen@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %2
br label %8
8: ; preds = %7, %0
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @alloca(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %3
%21 = call i32 @cstrlen(i8* %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 1
%3 = select i1 %2, i32 %1, i32 1
%4 = tail call i64 @alloca(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = add nsw i32 %3, -1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
%9 = tail call i32 @cstrlen(i8* %5)
ret i32 %9
}
unsigned long hash_gd4(char *uri) {
  unsigned long hash = 0;
  int c;
  while ((c = *uri++)) {
    if (c == '?' || c == '\n')
      break;
    hash = hash + (hash << 6) - (hash << 15) - c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_gd4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1171 <hash_gd4+0x71>
cmpl   $0x3f,-0x14(%rbp)
je     1142 <hash_gd4+0x42>
cmpl   $0xa,-0x14(%rbp)
jne    1147 <hash_gd4+0x47>
jmp    1171 <hash_gd4+0x71>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0xf,%rcx
sub    %rcx,%rax
movslq -0x14(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_gd4+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_gd4>:
xor    %eax,%eax
movabs $0x8000000000000401,%rcx
jmp    1122 <hash_gd4+0x22>
xchg   %ax,%ax
movsbq %dl,%rdx
add    $0x1,%rdi
imul   $0xffffffffffff8041,%rax,%rax
sub    %rdx,%rax
movzbl (%rdi),%edx
cmp    $0x3f,%rdx
ja     1110 <hash_gd4+0x10>
bt     %rdx,%rcx
jae    1110 <hash_gd4+0x10>
ret

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

LLVM IR (-O2):
define i64 @hash_gd4(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ 0, %1 ], [ %10, %6 ]
%4 = phi i8* [ %0, %1 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %11
i8 63, label %11
i8 10, label %11
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = mul i64 %3, -32703
%9 = sext i8 %5 to i64
%10 = sub i64 %8, %9
br label %2
11: ; preds = %2, %2, %2
ret i64 %3
}
OP(dd, fe) { op_fe(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_fe()
ret i32 undef
}
unsigned char answer_5(unsigned char arg0) { return 0; }


x86 assembly (clang, -O0):
<answer_5>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @answer_5(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @answer_5(i8 zeroext %0) {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "usage: %s [opts] <dirname> <seconds> <threads>\n", name);
  fprintf(stderr, "  -q quiet\n");
  fprintf(stderr, "  -a abort other children on first err\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s [opts] <dirname> <seconds> <threads>\0A\00"
@.str.1 = [12 x i8] c" -q quiet\0A\00"
@.str.2 = [40 x i8] c" -a abort other children on first err\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s [opts] <dirname> <seconds> <threads>\0A\00"
@.str.1 = [12 x i8] c" -q quiet\0A\00"
@.str.2 = [40 x i8] c" -a abort other children on first err\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
float toCelsius(float fahrenheit) { return (5.0 / 9.0) * (fahrenheit - 32); }


x86 assembly (clang, -O0):
<toCelsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toCelsius>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @toCelsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
%5 = fpext float %4 to double
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @toCelsius(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int core12_safe(char const *);
int U_EMRCREATEMONOBRUSH_safe(const char *record) {
  return (core12_safe(record));
}


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

x86 assembly (clang, -O2):
<U_EMRCREATEMONOBRUSH_safe>:
jmp    1030 <core12_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRCREATEMONOBRUSH_safe(i8* %0) {
%2 = tail call i32 @core12_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoLoadQueryReaction(int);
int indigoReadBuffer(char const *, int);
__attribute__((visibility("default"))) int
indigoLoadQueryReactionFromBuffer(const char *buf, int size) {
  int source = indigoReadBuffer(buf, size);
  int result;
  if (source <= 0)
    return -1;
  result = indigoLoadQueryReaction(source);
  indigoFree(source);
  return result;
}


x86 assembly (clang, -O0):
<indigoLoadQueryReactionFromBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <indigoReadBuffer@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1164 <indigoLoadQueryReactionFromBuffer+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <indigoLoadQueryReactionFromBuffer+0x4d>
mov    -0x18(%rbp),%edi
call   1030 <indigoLoadQueryReaction@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <indigoFree@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoLoadQueryReactionFromBuffer>:
push   %rbp
push   %rbx
push   %rax
call   1050 <indigoReadBuffer@plt>
test   %eax,%eax
jle    1152 <indigoLoadQueryReactionFromBuffer+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <indigoLoadQueryReaction@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <indigoFree@plt>
mov    %ebp,%eax
jmp    1157 <indigoLoadQueryReactionFromBuffer+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @indigoLoadQueryReactionFromBuffer(i8* %0, i32 %1) {
%3 = tail call i32 @indigoReadBuffer(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @indigoLoadQueryReaction(i32 %3)
%7 = tail call i32 @indigoFree(i32 %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int);
int match(const char *s1, const char *s2) {
  int s1_len = strlen(s1);
  return s1_len == strlen(s2) && strncmp(s1, s2, s1_len) == 0;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
jne    1177 <match+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%ebp
jne    1159 <match+0x39>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = call i64 @strncmp(i8* %13, i8* %14, i32 %15)
%17 = icmp eq i64 %16, 0
br label %18
18: ; preds = %12, %2
%19 = phi i1 [ false, %2 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void tek_ALP(void) { printf("%c", 0x001F); }


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

x86 assembly (clang, -O2):
<tek_ALP>:
lea    0xee9(%rip),%rdi
mov    $0x1f,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @tek_ALP() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 31)
ret void
}
/* Variables and functions */
void *malloc(unsigned int);
void *inv_malloc(unsigned int num_bytes) {
  void *alloc_ptr = malloc(num_bytes);
  return alloc_ptr;
}


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

x86 assembly (clang, -O2):
<inv_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @inv_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void showhelp(void) { panic("usage: flashamit <UPGRADE.BIN> <MTD-DEVICE>\n"); }


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"usage: flashamit <UPGRADE.BIN> <MTD-DEVICE>\0A\00"
define void @showhelp() {
%1 = call i32 @panic(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"usage: flashamit <UPGRADE.BIN> <MTD-DEVICE>\0A\00"
define void @showhelp() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
int terminal(int x) { return x & 1; }


x86 assembly (clang, -O0):
<terminal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal>:
mov    %edi,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @terminal(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
void turnleft(int *direz) {
  switch (*direz) {
  case 0:
    (*direz) = 3;
    break;
  case 1:
    (*direz) = 0;
    break;
  case 2:
    (*direz) = 1;
    break;
  case 3:
    (*direz) = 2;
    break;
  }
}


x86 assembly (clang, -O0):
<turnleft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1167 <turnleft+0x67>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
jmp    1167 <turnleft+0x67>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    1167 <turnleft+0x67>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
jmp    1167 <turnleft+0x67>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnleft>:
movslq (%rdi),%rax
cmp    $0x3,%rax
ja     1115 <turnleft+0x15>
lea    0xef0(%rip),%rcx
mov    (%rcx,%rax,4),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
@switch.table.turnleft = [4 x i32] [i32 3, i32 0, i32 1, i32 2]
define void @turnleft(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.turnleft, i64 0, i64 %5
%7 = load i32, i32* %6
store i32 %7, i32* %0
br label %8
8: ; preds = %1, %4
ret void
}
/* Variables and functions */
int SIGINT;
int SIGQUIT;
int /*<<< orphan*/ printf(char *);
void my_func(int sign_no) {
  if (sign_no == SIGINT) {
    printf("I have get SIGINT\n");
  } else if (sign_no == SIGQUIT) {
    printf("I have get SIGQUIT\n");
  }
}


x86 assembly (clang, -O0):
<my_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    113e <my_func+0x2e>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    1161 <my_func+0x51>
mov    -0x4(%rbp),%eax
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
jne    115c <my_func+0x4c>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    1161 <my_func+0x51>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_func>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <my_func+0x17>
lea    0xef1(%rip),%rdi
jmp    1030 <puts@plt>
mov    0x2eb2(%rip),%rax
cmp    %edi,(%rax)
jne    113e <my_func+0x2e>
lea    0xec7(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [19 x i8] c"I have get SIGINT\0A\00"
@SIGQUIT = global i32 0
@.str.1 = [20 x i8] c"I have get SIGQUIT\0A\00"
define void @my_func(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 %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = load i32, i32* @SIGQUIT
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
br label %15
15: ; preds = %14, %6
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@str = [19 x i8] c"I have get SIGQUIT\00"
@str.2 = [18 x i8] c"I have get SIGINT\00"
define void @my_func(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @SIGQUIT
%6 = icmp eq i32 %5, %0
br i1 %6, label %7, label %10
7: ; preds = %4, %1
%8 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0), %1 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), %4 ]
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
br label %10
10: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n;
  int result = 0;
  while (1) {
    scanf("%d", &n);
    if (n < 0) {
      break;
    }
    result += n;
  }
  printf("souwa=%d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1155 <main+0x35>
jmp    1163 <main+0x43>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
lea    0xece(%rip),%r14
lea    0xc(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %eax,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
lea    (%rcx,%rbx,1),%eax
test   %ecx,%ecx
jns    1140 <main+0x20>
lea    0xea4(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"souwa=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %8, %3 ]
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
%8 = add nsw i32 %6, %4
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *copy_string(const char *a) {
  char *b;
  b = malloc(strlen(a) + 1);
  strcpy(b, a);
  return b;
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copy_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @copy_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
double sqrt(double);
double norm(double *v) {
  return (sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]));
}


x86 assembly (clang, -O0):
<norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <norm+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @norm(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @norm(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
double _gmm_pow2(double x) { return x * x; }


x86 assembly (clang, -O0):
<_gmm_pow2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gmm_pow2>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @_gmm_pow2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @_gmm_pow2(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void fire_user_return_notifiers(void) {}


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

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

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

LLVM IR (-O2):
define void @fire_user_return_notifiers() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ _write_decimal_1(int /*<<< orphan*/);
int /*<<< orphan*/ _write_decimal_10(int /*<<< orphan*/);
int /*<<< orphan*/ _write_decimal_100(int /*<<< orphan*/);
int /*<<< orphan*/ _write_decimal_1000(int /*<<< orphan*/);
int /*<<< orphan*/ _write_decimal_10000(int /*<<< orphan*/);
void vt_write_uint16(uint16_t value) {
  _write_decimal_10000(value);
  _write_decimal_1000(value);
  _write_decimal_100(value);
  _write_decimal_10(value);
  _write_decimal_1(value);
}


x86 assembly (clang, -O0):
<vt_write_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_write_decimal_10000@plt>
mov    -0x4(%rbp),%edi
call   1070 <_write_decimal_1000@plt>
mov    -0x4(%rbp),%edi
call   1050 <_write_decimal_100@plt>
mov    -0x4(%rbp),%edi
call   1030 <_write_decimal_10@plt>
mov    -0x4(%rbp),%edi
call   1060 <_write_decimal_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_write_uint16>:
push   %rbx
mov    %edi,%ebx
call   1040 <_write_decimal_10000@plt>
mov    %ebx,%edi
call   1070 <_write_decimal_1000@plt>
mov    %ebx,%edi
call   1050 <_write_decimal_100@plt>
mov    %ebx,%edi
call   1030 <_write_decimal_10@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <_write_decimal_1@plt>

LLVM IR (-O0):
define void @vt_write_uint16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_write_decimal_10000(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @_write_decimal_1000(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @_write_decimal_100(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @_write_decimal_10(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @_write_decimal_1(i32 %11)
ret void
}

LLVM IR (-O2):
define void @vt_write_uint16(i32 %0) {
%2 = tail call i32 @_write_decimal_10000(i32 %0)
%3 = tail call i32 @_write_decimal_1000(i32 %0)
%4 = tail call i32 @_write_decimal_100(i32 %0)
%5 = tail call i32 @_write_decimal_10(i32 %0)
%6 = tail call i32 @_write_decimal_1(i32 %0)
ret void
}