xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void draw_cat() {
  char *s = " /\\     /\\\n{  `---'  }\n{  O   O  }\n~~>  V  <~~\n \\  \\|/  "
            "/\n  `-----'____\n  /     \\    \\_\n {       }\\  )_\\_   _\n |  "
            "\\_/  |/ /  \\_\\_/ )\n  \\__/  /(_/     \\__/\n    (__/\n";
  printf("%s\n", s);
}


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

x86 assembly (clang, -O2):
<draw_cat>:
lea    0xf8e(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [165 x i8] c" /\\ /\\\0A{ `---' }\0A{ O O }\0A~~> V <~~\0A \\ \\|/ /\0A `-----'____\0A / \\ \\_\0A { }\\ )_\\_ _\0A | \\_/ |/ / \\_\\_/ )\0A \\__/ /(_/ \\__/\0A (__/\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @draw_cat() {
%1 = alloca i8*
store i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [165 x i8] c" /\\ /\\\0A{ `---' }\0A{ O O }\0A~~> V <~~\0A \\ \\|/ /\0A `-----'____\0A / \\ \\_\0A { }\\ )_\\_ _\0A | \\_/ |/ / \\_\\_/ )\0A \\__/ /(_/ \\__/\0A (__/\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @draw_cat() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0))
ret void
}
int sys_close(int file) {
  int ret = 0;
  asm volatile("movl $6, %%eax;\n\t"
               "int $0x80;"
               : "=a"(ret)
               : "b"(file));
  return (ret);
}


x86 assembly (clang, -O0):
<sys_close>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ebx
mov    $0x6,%eax
int    $0x80
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_close>:
push   %rbx
mov    %edi,%ebx
mov    $0x6,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sys_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "movl $$6, %eax;\0A\09int $$0x80;", "={ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @sys_close(i32 %0) {
%2 = tail call i32 asm sideeffect "movl $$6, %eax;\0A\09int $$0x80;", "={ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
void av_frame_clone() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ inthash(uintptr_t);
ulong ptrhash(void *key) { return inthash((uintptr_t)key); }


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

x86 assembly (clang, -O2):
<ptrhash>:
jmp    1030 <inthash@plt>

LLVM IR (-O0):
define i32 @ptrhash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i32 @inthash(i64 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ptrhash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @inthash(i64 %2)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_dobldobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(232, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_dobldobl_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xe8,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dobldobl_target_system>:
mov    $0xe8,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_dobldobl_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 232, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_dobldobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 232, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void test4(int *a, int *b) {
  int i;
  for (i = 0; i < 100000; ++i)
    *a += b[i];
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x186a0,-0x14(%rbp)
jge    1141 <test4+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test4+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
mov    (%rdi),%eax
mov    $0x4,%ecx
nopw   0x0(%rax,%rax,1)
add    -0x10(%rsi,%rcx,4),%eax
mov    %eax,(%rdi)
add    -0xc(%rsi,%rcx,4),%eax
mov    %eax,(%rdi)
add    -0x8(%rsi,%rcx,4),%eax
mov    %eax,(%rdi)
add    -0x4(%rsi,%rcx,4),%eax
mov    %eax,(%rdi)
add    (%rsi,%rcx,4),%eax
mov    %eax,(%rdi)
add    $0x5,%rcx
cmp    $0x186a4,%rcx
jne    1110 <test4+0x10>
ret

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

LLVM IR (-O2):
define void @test4(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ %3, %2 ], [ %25, %4 ]
%6 = phi i64 [ 0, %2 ], [ %26, %4 ]
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = add nsw i32 %5, %8
store i32 %9, i32* %0
%10 = add nuw nsw i64 %6, 1
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
store i32 %13, i32* %0
%14 = add nuw nsw i64 %6, 2
%15 = getelementptr inbounds i32, i32* %1, i64 %14
%16 = load i32, i32* %15
%17 = add nsw i32 %13, %16
store i32 %17, i32* %0
%18 = add nuw nsw i64 %6, 3
%19 = getelementptr inbounds i32, i32* %1, i64 %18
%20 = load i32, i32* %19
%21 = add nsw i32 %17, %20
store i32 %21, i32* %0
%22 = add nuw nsw i64 %6, 4
%23 = getelementptr inbounds i32, i32* %1, i64 %22
%24 = load i32, i32* %23
%25 = add nsw i32 %21, %24
store i32 %25, i32* %0
%26 = add nuw nsw i64 %6, 5
%27 = icmp eq i64 %26, 100000
br i1 %27, label %28, label %4
28: ; preds = %4
ret void
}
long long int f_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i64 @f_n_in() {
ret i64 2
}

LLVM IR (-O2):
define i64 @f_n_in() {
ret i64 2
}
/* Variables and functions */
int /*<<< orphan*/ cput_hex_byte(long);
void cput_hex_long(long int n) {
  cput_hex_byte(n >> 24);
  cput_hex_byte(n >> 16);
  cput_hex_byte(n >> 8);
  cput_hex_byte(n);
}


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

x86 assembly (clang, -O2):
<cput_hex_long>:
push   %rbx
mov    %rdi,%rbx
sar    $0x18,%rdi
call   1030 <cput_hex_byte@plt>
mov    %rbx,%rdi
sar    $0x10,%rdi
call   1030 <cput_hex_byte@plt>
mov    %rbx,%rdi
sar    $0x8,%rdi
call   1030 <cput_hex_byte@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <cput_hex_byte@plt>

LLVM IR (-O0):
define void @cput_hex_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 24
%5 = call i32 @cput_hex_byte(i64 %4)
%6 = load i64, i64* %2
%7 = ashr i64 %6, 16
%8 = call i32 @cput_hex_byte(i64 %7)
%9 = load i64, i64* %2
%10 = ashr i64 %9, 8
%11 = call i32 @cput_hex_byte(i64 %10)
%12 = load i64, i64* %2
%13 = call i32 @cput_hex_byte(i64 %12)
ret void
}

LLVM IR (-O2):
define void @cput_hex_long(i64 %0) {
%2 = ashr i64 %0, 24
%3 = tail call i32 @cput_hex_byte(i64 %2)
%4 = ashr i64 %0, 16
%5 = tail call i32 @cput_hex_byte(i64 %4)
%6 = ashr i64 %0, 8
%7 = tail call i32 @cput_hex_byte(i64 %6)
%8 = tail call i32 @cput_hex_byte(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f3(unsigned int a) {
  if (4 / (a & 0xff) == 5)
    link_error();
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    $0x4,%eax
xor    %edx,%edx
div    %ecx
cmp    $0x5,%eax
jne    113d <f3+0x2d>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f3(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int blockfd(int fd) {
  int flags = fcntl(fd, F_GETFL, 0);
  return fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) == -1 ? -1 : 0;
}


x86 assembly (clang, -O0):
<blockfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
call   1030 <fcntl@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blockfd>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%edx
not    %edx
and    %eax,%edx
mov    %ebx,%edi
call   1030 <fcntl@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @blockfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = call i32 @fcntl(i32 %7, i32 %8, i32 %12)
%14 = icmp eq i32 %13, -1
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 -1, i32 0
ret i32 %16
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @blockfd(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
%8 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %7)
%9 = icmp eq i32 %8, -1
%10 = sext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ heapfy(int *, int, int);
void build_heap(int arr[], int heap_size) {
  for (int i = heap_size / 2; i >= 0; i--)
    heapfy(arr, heap_size, i);
}


x86 assembly (clang, -O0):
<build_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <build_heap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <heapfy@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <build_heap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0xffffffff,%esi
jl     1141 <build_heap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%ebp
shr    $0x1f,%ebp
add    %esi,%ebp
sar    %ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <heapfy@plt>
add    $0xffffffff,%ebp
jb     1130 <build_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_heap(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 = sdiv i32 %6, 2
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @heapfy(i32* %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @build_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, -2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = sdiv i32 %1, 2
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %5, %4 ]
%9 = tail call i32 @heapfy(i32* %0, i32 %1, i32 %8)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ Pbracket(int, int, int, int);
void Pstar(int i, int m) {
  int a;
  if (m > 1) {
    a = m / 2;
    Pstar(i, a);
    Pstar((i + a), (m - a));
    Pbracket(i, a, (i + a), (m - a));
  }
}


x86 assembly (clang, -O0):
<Pstar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1179 <Pstar+0x59>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <Pstar@plt>
mov    -0x4(%rbp),%edi
add    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
call   1030 <Pstar@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
add    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
call   1040 <Pbracket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pstar>:
cmp    $0x1,%esi
jle    1168 <Pstar+0x48>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
mov    %esi,%r15d
shr    %r15d
mov    %r15d,%esi
call   1030 <Pstar@plt>
lea    (%r15,%r14,1),%ebp
sub    %r15d,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <Pstar@plt>
mov    %r14d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <Pbracket@plt>
ret

LLVM IR (-O0):
define void @Pstar(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, 1
br i1 %7, label %8, label %28
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 2
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %3
%20 = load i32, i32* %5
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = sub nsw i32 %24, %25
%27 = call i32 @Pbracket(i32 %19, i32 %20, i32 %23, i32 %26)
br label %28
28: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @Pstar(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %1, 1
tail call void @Pstar(i32 %0, i32 %6)
%7 = add nsw i32 %6, %0
%8 = sub nsw i32 %1, %6
tail call void @Pstar(i32 %7, i32 %8)
%9 = tail call i32 @Pbracket(i32 %0, i32 %6, i32 %7, i32 %8)
br label %4
}
/* Type definitions */
struct memory {
  int dummy;
};

/* Variables and functions */
unsigned char memory_get_d8(struct memory *, unsigned short);
unsigned char memory_get_interrupt_flag(struct memory *mem) {
  return memory_get_d8(mem, ((unsigned short)0xFF0F));
}


x86 assembly (clang, -O0):
<memory_get_interrupt_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xff0f,%esi
call   1030 <memory_get_d8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_get_interrupt_flag>:
mov    $0xff0f,%esi
jmp    1030 <memory_get_d8@plt>

LLVM IR (-O0):
%struct.memory = type { i32 }
define zeroext i8 @memory_get_interrupt_flag(%struct.memory* %0) {
%2 = alloca %struct.memory*
store %struct.memory* %0, %struct.memory** %2
%3 = load %struct.memory*, %struct.memory** %2
%4 = call zeroext i8 @memory_get_d8(%struct.memory* %3, i16 zeroext -241)
ret i8 %4
}

LLVM IR (-O2):
%struct.memory = type { i32 }
define zeroext i8 @memory_get_interrupt_flag(%struct.memory* %0) {
%2 = tail call zeroext i8 @memory_get_d8(%struct.memory* %0, i16 zeroext -241)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ port_byte_out(int, int);
void set_cursor(int offset) {
  offset /= 2;
  port_byte_out(0x3D4, 14);
  port_byte_out(0x3D5, (unsigned char)(offset >> 8));
  port_byte_out(0x3D4, 15);
  port_byte_out(0x3D5, offset);
}


x86 assembly (clang, -O0):
<set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%esi
mov    $0x3d5,%edi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    -0x4(%rbp),%esi
mov    $0x3d5,%edi
call   1030 <port_byte_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cursor>:
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%ebx
add    %edi,%ebx
sar    %ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <port_byte_out@plt>

LLVM IR (-O0):
define void @set_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
store i32 %4, i32* %2
%5 = call i32 @port_byte_out(i32 980, i32 14)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i8
%9 = zext i8 %8 to i32
%10 = call i32 @port_byte_out(i32 981, i32 %9)
%11 = call i32 @port_byte_out(i32 980, i32 15)
%12 = load i32, i32* %2
%13 = call i32 @port_byte_out(i32 981, i32 %12)
ret void
}

LLVM IR (-O2):
define void @set_cursor(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @port_byte_out(i32 980, i32 14)
%4 = lshr i32 %2, 8
%5 = and i32 %4, 255
%6 = tail call i32 @port_byte_out(i32 981, i32 %5)
%7 = tail call i32 @port_byte_out(i32 980, i32 15)
%8 = tail call i32 @port_byte_out(i32 981, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int xg_read_mem(uint64_t guestva, char *tobuf, int len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xg_read_mem(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int quit_cmd(cp)
char *cp;
{
  if (extra_characters(cp))
    return 0;
  exit_program(0);
  return 0;
}


x86 assembly (clang, -O0):
<quit_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <extra_characters@plt>
cmp    $0x0,%eax
je     114c <quit_cmd+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    115c <quit_cmd+0x3c>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <exit_program@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit_cmd>:
push   %rax
xor    %eax,%eax
call   1030 <extra_characters@plt>
test   %eax,%eax
jne    1135 <quit_cmd+0x15>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <exit_program@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @quit_cmd(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @extra_characters to i32 (i8*, ...)*)(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 (i32, ...) bitcast (i32 (...)* @exit_program to i32 (i32, ...)*)(i32 0)
store i32 0, i32* %2
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @quit_cmd(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @extra_characters to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @exit_program to i32 (i32, ...)*)(i32 0)
br label %6
6: ; preds = %1, %4
ret i32 0
}
long gcd(long a, long b) {
  if (b > a)
    return gcd(b, a);
  if (b == 0)
    return a;
  return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1144 <gcd+0x34>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
jmp    1176 <gcd+0x66>
cmpq   $0x0,-0x18(%rbp)
jne    115c <gcd+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <gcd+0x66>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rax
jmp    111b <gcd+0x1b>
cs nopw 0x0(%rax,%rax,1)
nop
cqto
idiv   %rcx
mov    %rcx,%rdi
mov    %rdx,%rax
mov    %rax,%rcx
mov    %rdi,%rax
mov    %rcx,%rdi
cmp    %rax,%rcx
jg     111b <gcd+0x1b>
test   %rcx,%rcx
je     1145 <gcd+0x45>
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
mov    %rcx,%rdi
mov    %edx,%eax
jmp    111b <gcd+0x1b>
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
br label %3
3: ; preds = %11, %2
%4 = phi i64 [ %0, %2 ], [ %5, %11 ]
%5 = phi i64 [ %1, %2 ], [ %12, %11 ]
%6 = icmp sgt i64 %5, %4
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = icmp eq i64 %5, 0
br i1 %8, label %13, label %9
9: ; preds = %7
%10 = srem i64 %4, %5
br label %11
11: ; preds = %9, %3
%12 = phi i64 [ %10, %9 ], [ %4, %3 ]
br label %3
13: ; preds = %7
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_or_insert(int);
void *process1(void *arg) {
  int val = 50;
  int found = find_or_insert(val);
  assert(found);
  return NULL;
}


x86 assembly (clang, -O0):
<process1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x32,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <find_or_insert@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process1>:
push   %rax
mov    $0x32,%edi
call   1040 <find_or_insert@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @process1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 50, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @find_or_insert(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @assert(i32 %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @process1(i8* nocapture readnone %0) {
%2 = tail call i32 @find_or_insert(i32 50)
%3 = tail call i32 @assert(i32 %2)
ret i8* null
}
int g_DUMMY_scrollbar_set_dominant_viewport(int win_id, int vp_id) {
  win_id = win_id;
  vp_id = vp_id;
  return 0;
}


x86 assembly (clang, -O0):
<g_DUMMY_scrollbar_set_dominant_viewport>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g_DUMMY_scrollbar_set_dominant_viewport(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
store i32 %5, i32* %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @g_DUMMY_scrollbar_set_dominant_viewport(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ is_pair(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Digite o numero: ");
  scanf("%d", &num);
  if (is_pair(num))
    printf("\nNumero par\n");
  else
    printf("\nNumero impar\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_pair@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <main+0x5a>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <is_pair@plt>
test   %rax,%rax
lea    0xea4(%rip),%rax
lea    0xeab(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Digite o numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [14 x i8] c"\0ANumero impar\00"
@str.4 = [12 x i8] c"\0ANumero par\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @is_pair(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f() { printf("Call f()...\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Call f()...\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y_root;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
int get_XButtonReleasedEvent_y_root(void *_p) {
  return (int)((XButtonReleasedEvent *)_p)->y_root;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XButtonReleasedEvent_y_root(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XButtonReleasedEvent_y_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CompileWord(int, long);
int /*<<< orphan*/ InlineWords(int, int, int);
void DoRewind(void) {
  CompileWord(50, 0L);
  InlineWords(2, 16, 99);
}


x86 assembly (clang, -O0):
<DoRewind>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <CompileWord@plt>
mov    $0x2,%edi
mov    $0x10,%esi
mov    $0x63,%edx
call   1040 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoRewind>:
push   %rax
mov    $0x32,%edi
xor    %esi,%esi
call   1030 <CompileWord@plt>
mov    $0x2,%edi
mov    $0x10,%esi
mov    $0x63,%edx
pop    %rax
jmp    1040 <InlineWords@plt>

LLVM IR (-O0):
define void @DoRewind() {
%1 = call i32 @CompileWord(i32 50, i64 0)
%2 = call i32 @InlineWords(i32 2, i32 16, i32 99)
ret void
}

LLVM IR (-O2):
define void @DoRewind() {
%1 = tail call i32 @CompileWord(i32 50, i64 0)
%2 = tail call i32 @InlineWords(i32 2, i32 16, i32 99)
ret void
}
long scanlong(char **ptr) {
  long val;
  if (*(*ptr) & 1) {
    val = ((*(unsigned long *)*ptr) >> 1) - 0x40000000L;
    *ptr += 4;
  } else {
    val = ((*(unsigned short *)*ptr) >> 1) - 0x4000;
    *ptr += 2;
  }
  return val;
}


x86 assembly (clang, -O0):
<scanlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1149 <scanlong+0x49>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
shr    $0x1,%rax
sub    $0x40000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
jmp    116f <scanlong+0x6f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl (%rax),%eax
sar    $0x1,%eax
sub    $0x4000,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanlong>:
mov    (%rdi),%rcx
testb  $0x1,(%rcx)
jne    111b <scanlong+0x1b>
movzwl (%rcx),%eax
shr    %rax
add    $0xffffffffffffc000,%rax
mov    $0x2,%edx
jmp    112c <scanlong+0x2c>
mov    (%rcx),%rax
shr    %rax
add    $0xffffffffc0000000,%rax
mov    $0x4,%edx
add    %rdx,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i64 @scanlong(i8** %0) {
%2 = alloca i8**
%3 = alloca i64
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %1
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = bitcast i8* %12 to i64*
%14 = load i64, i64* %13
%15 = lshr i64 %14, 1
%16 = sub i64 %15, 1073741824
store i64 %16, i64* %3
%17 = load i8**, i8*** %2
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i64 4
store i8* %19, i8** %17
br label %32
20: ; preds = %1
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = bitcast i8* %22 to i16*
%24 = load i16, i16* %23
%25 = zext i16 %24 to i32
%26 = ashr i32 %25, 1
%27 = sub nsw i32 %26, 16384
%28 = sext i32 %27 to i64
store i64 %28, i64* %3
%29 = load i8**, i8*** %2
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8* %31, i8** %29
br label %32
32: ; preds = %20, %10
%33 = load i64, i64* %3
ret i64 %33
}

LLVM IR (-O2):
define i64 @scanlong(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = and i8 %3, 1
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = bitcast i8* %2 to i64*
%8 = load i64, i64* %7
%9 = lshr i64 %8, 1
%10 = add nsw i64 %9, -1073741824
br label %17
11: ; preds = %1
%12 = bitcast i8* %2 to i16*
%13 = load i16, i16* %12
%14 = lshr i16 %13, 1
%15 = zext i16 %14 to i64
%16 = add nsw i64 %15, -16384
br label %17
17: ; preds = %11, %6
%18 = phi i64 [ 2, %11 ], [ 4, %6 ]
%19 = phi i64 [ %16, %11 ], [ %10, %6 ]
%20 = getelementptr inbounds i8, i8* %2, i64 %18
store i8* %20, i8** %0
ret i64 %19
}
/* Variables and functions */
unsigned long long magic();
int /*<<< orphan*/ printf(char *, unsigned long long);
int main() {
  unsigned long long res = 0;
  res = magic();
  printf("If you can trust me, the number "
         "you are looking for is %llu\n",
         res);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"If you can trust me, the number you are looking for is %llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
%3 = call i64 (...) @magic()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"If you can trust me, the number you are looking for is %llu\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @magic()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Type definitions */
struct jffs2_raw_dirent {
  int dummy;
};
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
struct jffs2_raw_dirent *resolvepath0(char *, size_t, int /*<<< orphan*/,
                                      char *, int /*<<< orphan*/ *,
                                      int /*<<< orphan*/);
struct jffs2_raw_dirent *resolvepath(char *o, size_t size, __u32 ino, char *p,
                                     __u32 *inos) {
  return resolvepath0(o, size, ino, p, inos, 0);
}


x86 assembly (clang, -O0):
<resolvepath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <resolvepath0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolvepath>:
xor    %r9d,%r9d
jmp    1030 <resolvepath0@plt>

LLVM IR (-O0):
%struct.jffs2_raw_dirent = type { i32 }
define %struct.jffs2_raw_dirent* @resolvepath(i8* %0, i64 %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32*, i32** %10
%16 = call %struct.jffs2_raw_dirent* @resolvepath0(i8* %11, i64 %12, i32 %13, i8* %14, i32* %15, i32 0)
ret %struct.jffs2_raw_dirent* %16
}

LLVM IR (-O2):
%struct.jffs2_raw_dirent = type { i32 }
define %struct.jffs2_raw_dirent* @resolvepath(i8* %0, i64 %1, i32 %2, i8* %3, i32* %4) {
%6 = tail call %struct.jffs2_raw_dirent* @resolvepath0(i8* %0, i64 %1, i32 %2, i8* %3, i32* %4, i32 0)
ret %struct.jffs2_raw_dirent* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ const *);
int /*<<< orphan*/ be16toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint16_t knot_wire_read_u16(const uint8_t *pos) {
  assert(pos);
  uint16_t result;
  memcpy(&result, pos, sizeof(result));
  return be16toh(result);
}


x86 assembly (clang, -O0):
<knot_wire_read_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1050 <be16toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_read_u16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <assert@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0xc(%rsp),%edi
call   1050 <be16toh@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @knot_wire_read_u16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @assert(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @memcpy(i32* %3, i32* %6, i32 4)
%8 = load i32, i32* %3
%9 = call i32 @be16toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @knot_wire_read_u16(i32* %0) {
%2 = alloca i32
%3 = tail call i32 @assert(i32* %0)
%4 = bitcast i32* %2 to i8*
%5 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%6 = load i32, i32* %2
%7 = call i32 @be16toh(i32 %6)
ret i32 %7
}
unsigned int f(unsigned int a0, unsigned int a1, unsigned int a2,
               unsigned int a3, unsigned int a4) {
  unsigned int b0, b1, b2, b3, b4, e;
  b4 = a4 + a3 + a2 + a1 + a0;
  b3 = a3 + a2 + a1 + a0;
  b2 = a2 + a1 + a0;
  b1 = a1 + a0;
  e = b4 - b3 + b2 - b1 - a4 - a2;
  return e;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%eax
sub    -0x24(%rbp),%eax
add    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
sub    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%17 = load i32, i32* %10
%18 = load i32, i32* %9
%19 = add i32 %17, %18
%20 = load i32, i32* %8
%21 = add i32 %19, %20
%22 = load i32, i32* %7
%23 = add i32 %21, %22
%24 = load i32, i32* %6
%25 = add i32 %23, %24
store i32 %25, i32* %15
%26 = load i32, i32* %9
%27 = load i32, i32* %8
%28 = add i32 %26, %27
%29 = load i32, i32* %7
%30 = add i32 %28, %29
%31 = load i32, i32* %6
%32 = add i32 %30, %31
store i32 %32, i32* %14
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = add i32 %33, %34
%36 = load i32, i32* %6
%37 = add i32 %35, %36
store i32 %37, i32* %13
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = add i32 %38, %39
store i32 %40, i32* %12
%41 = load i32, i32* %15
%42 = load i32, i32* %14
%43 = sub i32 %41, %42
%44 = load i32, i32* %13
%45 = add i32 %43, %44
%46 = load i32, i32* %12
%47 = sub i32 %45, %46
%48 = load i32, i32* %10
%49 = sub i32 %47, %48
%50 = load i32, i32* %8
%51 = sub i32 %49, %50
store i32 %51, i32* %16
%52 = load i32, i32* %16
ret i32 %52
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
int stdimpl_strlen(const char *str) {
  const char *estr = str;
  char c;
  do {
    c = *estr;
    estr++;
  } while (c);
  return ((int)(estr - str - 1));
}


x86 assembly (clang, -O0):
<stdimpl_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpb   $0x0,-0x11(%rbp)
jne    1110 <stdimpl_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdimpl_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stdimpl_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @stdimpl_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %5, %2 ]
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = icmp eq i8 %4, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %5 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_set_one(uintptr_t);
void fiat_p224_set_one(uint64_t out1[4]) {
  internal_fiat_p224_set_one((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p224_set_one>:
jmp    1030 <internal_fiat_p224_set_one@plt>

LLVM IR (-O0):
define void @fiat_p224_set_one(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p224_set_one(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_set_one(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p224_set_one(i64 %2)
ret void
}
void _gfortran_caf_sync_memory(int *stat, char *errmsg __attribute__((unused)),
                               int errmsg_len __attribute__((unused))) {
  __asm__ __volatile__("" ::: "memory");
  if (stat)
    *stat = 0;
}


x86 assembly (clang, -O0):
<_gfortran_caf_sync_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1124 <_gfortran_caf_sync_memory+0x24>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gfortran_caf_sync_memory>:
test   %rdi,%rdi
je     110b <_gfortran_caf_sync_memory+0xb>
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @_gfortran_caf_sync_memory(i32* writeonly %0, i8* nocapture readnone %1, i32 %2) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%4 = icmp eq i32* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i32 0, i32* %0
br label %6
6: ; preds = %5, %3
ret void
}