xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __simplePNG_get_crc(int /*<<< orphan*/,
                                       int /*<<< orphan*/ const *, size_t);
uint32_t __simplePNG_end_crc(uint32_t initial_crc, uint8_t const *data,
                             size_t size) {
  uint32_t crc = __simplePNG_get_crc(initial_crc, data, size);
  crc = ~crc;
  return crc;
}


x86 assembly (clang, -O0):
<__simplePNG_end_crc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__simplePNG_get_crc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__simplePNG_end_crc>:
push   %rax
call   1030 <__simplePNG_get_crc@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__simplePNG_end_crc(i32 %0, i32* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = call i32 @__simplePNG_get_crc(i32 %8, i32* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = xor i32 %12, -1
store i32 %13, i32* %7
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @__simplePNG_end_crc(i32 %0, i32* %1, i64 %2) {
%4 = tail call i32 @__simplePNG_get_crc(i32 %0, i32* %1, i64 %2)
%5 = xor i32 %4, -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ lua_getref(int);
int /*<<< orphan*/ lua_pushobject(int /*<<< orphan*/);
void(lua_pushref)(int ref) { lua_pushobject(lua_getref(ref)); }


x86 assembly (clang, -O0):
<lua_pushref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lua_getref@plt>
mov    %eax,%edi
call   1040 <lua_pushobject@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_pushref>:
push   %rax
call   1030 <lua_getref@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushobject@plt>

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

LLVM IR (-O2):
define void @lua_pushref(i32 %0) {
%2 = tail call i32 @lua_getref(i32 %0)
%3 = tail call i32 @lua_pushobject(i32 %2)
ret void
}
int test_imm_25int16_reg(short val) {
  return ((val) & (-0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffdb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_25int16_reg>:
test   $0xffdb,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_25int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -37
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_25int16_reg(i16 signext %0) {
%2 = and i16 %0, -37
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void escreveCaracter(char c, int n) {
  for (n = n; n > 0; --n) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<escreveCaracter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1148 <escreveCaracter+0x38>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <escreveCaracter+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escreveCaracter>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112f <escreveCaracter+0x1f>
mov    %esi,%ebx
add    $0x1,%ebx
movsbl %dil,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <escreveCaracter+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @escreveCaracter(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
void gtk_alignment_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_alignment_get_type() {
ret void
}
/* Variables and functions */
size_t strlen(char *);
char *strncpyz(char *, char const *, size_t);
char *strncatz(char *dest, const char *source, size_t len) {
  size_t l;
  l = strlen(dest);
  dest += l;
  if (len > l)
    len -= l;
  else
    len = 0;
  return strncpyz(dest, source, len);
}


x86 assembly (clang, -O0):
<strncatz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    116f <strncatz+0x4f>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1177 <strncatz+0x57>
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <strncpyz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncatz>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %edx,%edx
sub    %rax,%r15
cmovae %r15,%rdx
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <strncpyz@plt>

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

LLVM IR (-O2):
define i8* @strncatz(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = tail call i64 @llvm.usub.sat.i64(i64 %2, i64 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = tail call i8* @strncpyz(i8* %6, i8* %1, i64 %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int msgsnd(int, void *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void CommSend(int channel_id, void *message, int size) {
  if (msgsnd(channel_id, message, size - sizeof(long), 0) == -1) {
    printf("Error! Send message wrong!\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<CommSend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
sub    $0x8,%rax
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <msgsnd@plt>
cmp    $0xffffffff,%eax
jne    1179 <CommSend+0x49>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommSend>:
push   %rax
add    $0xfffffff8,%edx
xor    %ecx,%ecx
call   1040 <msgsnd@plt>
cmp    $0xffffffff,%eax
je     1142 <CommSend+0x12>
pop    %rax
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Error! Send message wrong!\0A\00"
define void @CommSend(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 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = sub i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call i32 @msgsnd(i32 %7, i8* %8, i32 %12, i32 0)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Error! Send message wrong!\00"
define void @CommSend(i32 %0, i8* %1, i32 %2) {
%4 = add i32 %2, -8
%5 = tail call i32 @msgsnd(i32 %0, i8* %1, i32 %4, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret void
}
unsigned int udiv(unsigned int X, unsigned int Y) { return X / Y; }


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

x86 assembly (clang, -O2):
<udiv>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i32 @udiv(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
ret i32 %3
}
void __atomic_store_8(volatile void *atom, unsigned long long value,
                      int memorder) {
  *(volatile unsigned long long *)atom = value;
}


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

x86 assembly (clang, -O2):
<__atomic_store_8>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @__atomic_store_8(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
store volatile i64 %7, i64* %9
ret void
}

LLVM IR (-O2):
define void @__atomic_store_8(i8* %0, i64 %1, i32 %2) {
%4 = bitcast i8* %0 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MenuPrincipal();
int /*<<< orphan*/ SetColor(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ asignarTeclas();
int /*<<< orphan*/ cpc_DisableFirmware();
int /*<<< orphan*/ cpc_SetMode(int);
void main() {
  cpc_SetMode(1);
  cpc_DisableFirmware();
  SetColor(0, 0);
  asignarTeclas();
  MenuPrincipal();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1060 <cpc_SetMode@plt>
mov    $0x0,%al
call   1050 <cpc_DisableFirmware@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <SetColor@plt>
mov    $0x0,%al
call   1030 <asignarTeclas@plt>
mov    $0x0,%al
call   1070 <MenuPrincipal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1060 <cpc_SetMode@plt>
xor    %eax,%eax
call   1050 <cpc_DisableFirmware@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <SetColor@plt>
xor    %eax,%eax
call   1030 <asignarTeclas@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <MenuPrincipal@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @cpc_SetMode(i32 1)
%2 = call i32 (...) @cpc_DisableFirmware()
%3 = call i32 @SetColor(i32 0, i32 0)
%4 = call i32 (...) @asignarTeclas()
%5 = call i32 (...) @MenuPrincipal()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @cpc_SetMode(i32 1)
%2 = tail call i32 (...) @cpc_DisableFirmware()
%3 = tail call i32 @SetColor(i32 0, i32 0)
%4 = tail call i32 (...) @asignarTeclas()
%5 = tail call i32 (...) @MenuPrincipal()
ret void
}
/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int fifo_exists(char *);
int mkfifo(char *, int);
int init_fifo(char *filename) {
  int fifo_status;
  if (fifo_exists(filename) == 1) {
    return 1;
  }
  fifo_status = mkfifo(filename, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
  return fifo_status;
}


x86 assembly (clang, -O0):
<init_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fifo_exists@plt>
cmp    $0x1,%eax
jne    114a <init_fifo+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1180 <init_fifo+0x60>
mov    -0x10(%rbp),%rdi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    0x2e6a(%rip),%rax
or     (%rax),%esi
mov    0x2e71(%rip),%rax
or     (%rax),%esi
mov    0x2e60(%rip),%rax
or     (%rax),%esi
call   1040 <mkfifo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fifo>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fifo_exists@plt>
cmp    $0x1,%eax
jne    1135 <init_fifo+0x15>
mov    $0x1,%eax
pop    %rbx
ret
mov    0x2eac(%rip),%rax
mov    0x2e85(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e8a(%rip),%rax
or     (%rax),%esi
mov    0x2e79(%rip),%rax
or     (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mkfifo@plt>

LLVM IR (-O0):
@S_IWUSR = global i32 0
@S_IRUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i32 @init_fifo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @fifo_exists(i8* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %20
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i32, i32* @S_IWUSR
%12 = load i32, i32* @S_IRUSR
%13 = or i32 %11, %12
%14 = load i32, i32* @S_IRGRP
%15 = or i32 %13, %14
%16 = load i32, i32* @S_IROTH
%17 = or i32 %15, %16
%18 = call i32 @mkfifo(i8* %10, i32 %17)
store i32 %18, i32* %4
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %20
20: ; preds = %9, %8
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@S_IWUSR = global i32 0
@S_IRUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i32 @init_fifo(i8* %0) {
%2 = tail call i32 @fifo_exists(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = load i32, i32* @S_IWUSR
%6 = load i32, i32* @S_IRUSR
%7 = or i32 %6, %5
%8 = load i32, i32* @S_IRGRP
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IROTH
%11 = or i32 %9, %10
%12 = tail call i32 @mkfifo(i8* %0, i32 %11)
br label %13
13: ; preds = %1, %4
%14 = phi i32 [ %12, %4 ], [ 1, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char s[] = "hello world";
  reverse(s);
  printf("%s\n", s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,(%rsp)
movl   $0x646c72,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.s = [12 x i8] c"hello world\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > 0) {
    x = x + y;
    y = -y - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1156 <main+0x46>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ **);
int /*<<< orphan*/ RSAPrivateKey_it;
RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa) {
  return ASN1_item_d2i_fp(&RSAPrivateKey_it, fp, rsa);
}


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

x86 assembly (clang, -O2):
<d2i_RSAPrivateKey_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_d2i_fp@plt>

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

LLVM IR (-O2):
@RSAPrivateKey_it = global i32 0
define i32* @d2i_RSAPrivateKey_fp(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_fp(i32* @RSAPrivateKey_it, i32* %0, i32** %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ test();
int main(int argc, char *argv[]) {
  test();
  test();
  test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test()
%4 = tail call i32 (...) @test()
%5 = tail call i32 (...) @test()
ret i32 0
}
void f98(void) {
a:
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    goto a;
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f98>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1104 <f98+0x4>

x86 assembly (clang, -O2):
<f98>:
jmp    1100 <f98>

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

LLVM IR (-O2):
define void @f98() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world\n");
  return 'c';
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 99
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 99
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
#pragma omp parallel
  {
    int ID = omp_get_thread_num();
    printf("Hello(%d)", ID);
    printf("World(%d)\n", ID);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello(%d)\00"
@.str.1 = [11 x i8] c"World(%d)\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t getUniversalHashIndex(uint64_t index) { return index >> 18; }


x86 assembly (clang, -O0):
<getUniversalHashIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x12,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUniversalHashIndex>:
mov    %edi,%eax
sar    $0x12,%eax
ret

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

LLVM IR (-O2):
define i32 @getUniversalHashIndex(i32 %0) {
%2 = ashr i32 %0, 18
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void h1(char *header) { printf("<h1>%s</h1>\n", header); }


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

x86 assembly (clang, -O2):
<h1>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"<h1>%s</h1>\0A\00"
define void @h1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"<h1>%s</h1>\0A\00"
define void @h1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a = 0;
  while (a < 200) {
    printf("%3d\n", a);
    a++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xc8,%eax
jge    114f <main+0x3f>
lea    0xec7(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%bl
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%3d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = add i8 %2, 1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void test(char **str) {
  int i;
  for (i = 0; i < 4; i++) {
    printf("%s\n", *str++);
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    115b <test+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <test+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee0(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x10(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x18(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @test(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %0
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i8*, i8** %0, i64 2
%8 = load i8*, i8** %2
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds i8*, i8** %0, i64 3
%13 = load i8*, i8** %7
%14 = ptrtoint i8* %13 to i64
%15 = trunc i64 %14 to i32
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i8*, i8** %12
%18 = ptrtoint i8* %17 to i64
%19 = trunc i64 %18 to i32
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int OK;
int /*<<< orphan*/ doupdate();
int /*<<< orphan*/ wnoutrefresh(int /*<<< orphan*/ *);
int wrefresh(WINDOW *win) {
  wnoutrefresh(win);
  doupdate();
  return OK;
}


x86 assembly (clang, -O0):
<wrefresh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wnoutrefresh@plt>
mov    $0x0,%al
call   1040 <doupdate@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrefresh>:
push   %rax
call   1030 <wnoutrefresh@plt>
xor    %eax,%eax
call   1040 <doupdate@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @wrefresh(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @wnoutrefresh(i32* %3)
%5 = call i32 (...) @doupdate()
%6 = load i32, i32* @OK
ret i32 %6
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @wrefresh(i32* %0) {
%2 = tail call i32 @wnoutrefresh(i32* %0)
%3 = tail call i32 (...) @doupdate()
%4 = load i32, i32* @OK
ret i32 %4
}
void default_callback_action(void *ptr) { return; }


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

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

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

LLVM IR (-O2):
define void @default_callback_action(i8* nocapture %0) {
ret void
}
char who_win(long long n, long long k) {
  if (k >= n)
    return 'A';
  else
    return n % (k + 1) == 0 ? 'B' : 'A';
}


x86 assembly (clang, -O0):
<who_win>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     1123 <who_win+0x23>
movb   $0x41,-0x1(%rbp)
jmp    1148 <who_win+0x48>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
cqto
idiv   %rcx
mov    $0x41,%eax
mov    $0x42,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<who_win>:
mov    $0x41,%al
cmp    %rdi,%rsi
jge    112f <who_win+0x2f>
add    $0x1,%rsi
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1121 <who_win+0x21>
mov    %rdi,%rax
cqto
idiv   %rsi
jmp    1127 <who_win+0x27>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
mov    $0x41,%al
adc    $0x0,%al
ret

LLVM IR (-O0):
define signext i8 @who_win(i64 %0, i64 %1) {
%3 = alloca i8
%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 sge i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i8 65, i8* %3
br label %19
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = add nsw i64 %12, 1
%14 = srem i64 %11, %13
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 66, i32 65
%18 = trunc i32 %17 to i8
store i8 %18, i8* %3
br label %19
19: ; preds = %10, %9
%20 = load i8, i8* %3
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @who_win(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, %0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = add nsw i64 %1, 1
%6 = srem i64 %0, %5
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8 66, i8 65
br label %9
9: ; preds = %2, %4
%10 = phi i8 [ %8, %4 ], [ 65, %2 ]
ret i8 %10
}
double double_div(double x, double y, int index) { return x / y; }


x86 assembly (clang, -O0):
<double_div>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_div>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @double_div(double %0, double %1, i32 %2) {
%4 = fdiv double %0, %1
ret double %4
}
/* Variables and functions */
char *strdup(char const *);
char *VSIStrdup(const char *pszString) { return (strdup(pszString)); }


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

x86 assembly (clang, -O2):
<VSIStrdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @VSIStrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  char a[100];
  sprintf(a,
          "/usr/lib/jvm/java-7-sun/bin/java Main <%s/stdio/%s.in >%s.out "
          "2>runerror.log",
          argv[1], argv[2], argv[2]);
  system(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r8
lea    0xea4(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0x8(%rsi),%rdx
mov    0x10(%rsi),%rcx
lea    0xecc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rcx,%r8
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [77 x i8] c"/usr/lib/jvm/java-7-sun/bin/java Main <%s/stdio/%s.in >%s.out 2>runerror.log\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %13, i8* %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%19 = call i32 @system(i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [77 x i8] c"/usr/lib/jvm/java-7-sun/bin/java Main <%s/stdio/%s.in >%s.out 2>runerror.log\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8, i8* %8)
%10 = call i32 @system(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DisconnectKeyCodes3();
int /*<<< orphan*/ ForceShowCursor();
int /*<<< orphan*/ RestoreKeyRepeat();
void EnterBackground(void) {
  RestoreKeyRepeat();
  DisconnectKeyCodes3();
  ForceShowCursor();
}


x86 assembly (clang, -O0):
<EnterBackground>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RestoreKeyRepeat@plt>
mov    $0x0,%al
call   1050 <DisconnectKeyCodes3@plt>
mov    $0x0,%al
call   1040 <ForceShowCursor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnterBackground>:
push   %rax
xor    %eax,%eax
call   1030 <RestoreKeyRepeat@plt>
xor    %eax,%eax
call   1050 <DisconnectKeyCodes3@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ForceShowCursor@plt>

LLVM IR (-O0):
define void @EnterBackground() {
%1 = call i32 (...) @RestoreKeyRepeat()
%2 = call i32 (...) @DisconnectKeyCodes3()
%3 = call i32 (...) @ForceShowCursor()
ret void
}

LLVM IR (-O2):
define void @EnterBackground() {
%1 = tail call i32 (...) @RestoreKeyRepeat()
%2 = tail call i32 (...) @DisconnectKeyCodes3()
%3 = tail call i32 (...) @ForceShowCursor()
ret void
}
int hoge(int a) { return (a == -1); }


x86 assembly (clang, -O0):
<hoge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoge>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @hoge(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @hoge(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/
UPnPResponse_AVTransport_GetDeviceCapabilities(void *, char *, char *, char *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPAVTransport_GetDeviceCapabilities(void *upnptoken,
                                           unsigned int InstanceID) {
  printf("Invoke: UPnPAVTransport_GetDeviceCapabilities(%u);\r\n", InstanceID);
  UPnPResponse_AVTransport_GetDeviceCapabilities(
      upnptoken, "Sample String", "Sample String", "Sample String");
}


x86 assembly (clang, -O0):
<UPnPAVTransport_GetDeviceCapabilities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeec(%rip),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <UPnPResponse_AVTransport_GetDeviceCapabilities@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPAVTransport_GetDeviceCapabilities>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xefe(%rip),%rcx
mov    %rbx,%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
pop    %rbx
jmp    1030 <UPnPResponse_AVTransport_GetDeviceCapabilities@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Invoke: UPnPAVTransport_GetDeviceCapabilities(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPAVTransport_GetDeviceCapabilities(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_AVTransport_GetDeviceCapabilities(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Invoke: UPnPAVTransport_GetDeviceCapabilities(%u);\0D\0A\00"
@.str.1 = [14 x i8] c"Sample String\00"
define void @UPnPAVTransport_GetDeviceCapabilities(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_AVTransport_GetDeviceCapabilities(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct fdarray {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fdarray__exit(struct fdarray *);
int /*<<< orphan*/ free(struct fdarray *);
void fdarray__delete(struct fdarray *fda) {
  fdarray__exit(fda);
  free(fda);
}


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

x86 assembly (clang, -O2):
<fdarray__delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fdarray__exit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.fdarray = type { i32 }
define void @fdarray__delete(%struct.fdarray* %0) {
%2 = alloca %struct.fdarray*
store %struct.fdarray* %0, %struct.fdarray** %2
%3 = load %struct.fdarray*, %struct.fdarray** %2
%4 = call i32 @fdarray__exit(%struct.fdarray* %3)
%5 = load %struct.fdarray*, %struct.fdarray** %2
%6 = call i32 @free(%struct.fdarray* %5)
ret void
}

LLVM IR (-O2):
%struct.fdarray = type { i32 }
define void @fdarray__delete(%struct.fdarray* %0) {
%2 = tail call i32 @fdarray__exit(%struct.fdarray* %0)
%3 = tail call i32 @free(%struct.fdarray* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
unsigned char _mm_aesdecwide128kl_u8(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *, void const *);
unsigned char test__mm_aesdecwide128kl_u8(__m128i odata[8],
                                          const __m128i idata[8],
                                          const void *h) {
  return _mm_aesdecwide128kl_u8(odata, idata, h);
}


x86 assembly (clang, -O0):
<test__mm_aesdecwide128kl_u8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <_mm_aesdecwide128kl_u8@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test__mm_aesdecwide128kl_u8>:
jmp    1030 <_mm_aesdecwide128kl_u8@plt>

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

LLVM IR (-O2):
define zeroext i8 @test__mm_aesdecwide128kl_u8(i32* %0, i32* %1, i8* %2) {
%4 = tail call zeroext i8 @_mm_aesdecwide128kl_u8(i32* %0, i32* %1, i8* %2)
ret i8 %4
}
void ioctl_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @ioctl_stop() {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
char tolower(char);
char from_hex(char ch) {
  return (char)(isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10);
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <from_hex+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <from_hex+0x45>
movsbl -0x1(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <from_hex+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <tolower@plt>
add    $0xa9,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @from_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @from_hex(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %9
6: ; preds = %1
%7 = tail call signext i8 @tolower(i8 signext %0)
%8 = add i8 %7, -87
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %5, %4 ], [ %8, %6 ]
ret i8 %10
}