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

/* Variables and functions */
int /*<<< orphan*/ rgph_u64_xxh64s_data64(int /*<<< orphan*/ const *, size_t,
                                          uintptr_t);
uint64_t rgph_u64_xxh64s_u64a(const uint64_t *key, size_t len, uintptr_t seed) {
  return rgph_u64_xxh64s_data64(key, len, seed);
}


x86 assembly (clang, -O0):
<rgph_u64_xxh64s_u64a>:
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 <rgph_u64_xxh64s_data64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u64_xxh64s_u64a>:
jmp    1030 <rgph_u64_xxh64s_data64@plt>

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

LLVM IR (-O2):
define i32 @rgph_u64_xxh64s_u64a(i32* %0, i64 %1, i64 %2) {
%4 = tail call i32 @rgph_u64_xxh64s_data64(i32* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Type definitions */
struct pt_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_profile(struct pt_regs *);
int /*<<< orphan*/ do_timer(struct pt_regs *);
void oki_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) {
  do {
    *((volatile unsigned int *)(((0xB7F000A0)) + (0x10))) = (0x01);
  } while (0);
  do_timer(regs);
  do_profile(regs);
}


x86 assembly (clang, -O0):
<oki_timer_interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xb7f000b0,%eax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <do_timer@plt>
mov    -0x18(%rbp),%rdi
call   1040 <do_profile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oki_timer_interrupt>:
push   %rbx
mov    %rdx,%rbx
mov    $0xb7f000b0,%eax
movl   $0x1,(%rax)
mov    %rdx,%rdi
call   1030 <do_timer@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <do_profile@plt>

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
define void @oki_timer_interrupt(i32 %0, i8* %1, %struct.pt_regs* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.pt_regs*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.pt_regs* %2, %struct.pt_regs** %6
br label %7
7: ; preds = %3
store volatile i32 1, i32* inttoptr (i64 3085959344 to i32*)
br label %8
8: ; preds = %7
%9 = load %struct.pt_regs*, %struct.pt_regs** %6
%10 = call i32 @do_timer(%struct.pt_regs* %9)
%11 = load %struct.pt_regs*, %struct.pt_regs** %6
%12 = call i32 @do_profile(%struct.pt_regs* %11)
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
define void @oki_timer_interrupt(i32 %0, i8* nocapture readnone %1, %struct.pt_regs* %2) {
store volatile i32 1, i32* inttoptr (i64 3085959344 to i32*)
%4 = tail call i32 @do_timer(%struct.pt_regs* %2)
%5 = tail call i32 @do_profile(%struct.pt_regs* %2)
ret void
}
/* Type definitions */
struct vfsmount {
  int dummy;
};
struct dentry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dbstart(struct dentry const *);
struct vfsmount *unionfs_lower_mnt_idx(struct dentry const *,
                                       int /*<<< orphan*/);
struct vfsmount *unionfs_lower_mnt(const struct dentry *dent) {
  return unionfs_lower_mnt_idx(dent, dbstart(dent));
}


x86 assembly (clang, -O0):
<unionfs_lower_mnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dbstart@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <unionfs_lower_mnt_idx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unionfs_lower_mnt>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dbstart@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <unionfs_lower_mnt_idx@plt>

LLVM IR (-O0):
%struct.vfsmount = type { i32 }
%struct.dentry = type { i32 }
define %struct.vfsmount* @unionfs_lower_mnt(%struct.dentry* %0) {
%2 = alloca %struct.dentry*
store %struct.dentry* %0, %struct.dentry** %2
%3 = load %struct.dentry*, %struct.dentry** %2
%4 = load %struct.dentry*, %struct.dentry** %2
%5 = call i32 @dbstart(%struct.dentry* %4)
%6 = call %struct.vfsmount* @unionfs_lower_mnt_idx(%struct.dentry* %3, i32 %5)
ret %struct.vfsmount* %6
}

LLVM IR (-O2):
%struct.vfsmount = type { i32 }
%struct.dentry = type { i32 }
define %struct.vfsmount* @unionfs_lower_mnt(%struct.dentry* %0) {
%2 = tail call i32 @dbstart(%struct.dentry* %0)
%3 = tail call %struct.vfsmount* @unionfs_lower_mnt_idx(%struct.dentry* %0, i32 %2)
ret %struct.vfsmount* %3
}
__attribute__((always_)) int test_and_set_bit(int nr,
                                              volatile unsigned long *addr) {
  int oldbit;
  asm volatile(""
               "bts %2,%1\n\t"
               "sbb %0,%0"
               : "=r"(oldbit), "+m"(*(volatile long *)(addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set_bit>:
bts    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "bts $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_and_set_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "bts $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ string1;

/* Variables and functions */
int S_IREAD;
int S_IWRITE;
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ sync();
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int fd;
  char *string1 = "Hello world";
  sync();
  fd = creat("foobar", S_IREAD | S_IWRITE);
  write(fd, string1, sizeof(string1) - 1);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <sync@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
mov    0x2e77(%rip),%rax
or     (%rax),%esi
lea    0xe92(%rip),%rdi
call   1060 <creat@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <sync@plt>
mov    0x2e89(%rip),%rax
mov    0x2e92(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeab(%rip),%rdi
call   1060 <creat@plt>
mov    %eax,%ebx
lea    0xe91(%rip),%rsi
mov    %eax,%edi
mov    $0x7,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
@.str.1 = [7 x i8] c"foobar\00"
@S_IREAD = global i32 0
@S_IWRITE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = call i32 (...) @sync()
%5 = load i32, i32* @S_IREAD
%6 = load i32, i32* @S_IWRITE
%7 = or i32 %5, %6
%8 = call i32 @creat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i8*, i8** %3
%11 = call i32 @write(i32 %9, i8* %10, i32 7)
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
@.str.1 = [7 x i8] c"foobar\00"
@S_IREAD = global i32 0
@S_IWRITE = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @sync()
%2 = load i32, i32* @S_IREAD
%3 = load i32, i32* @S_IWRITE
%4 = or i32 %3, %2
%5 = tail call i32 @creat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @write(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 7)
%7 = tail call i32 @close(i32 %5)
ret i32 0
}
void loop_general(void) {}


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

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

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

LLVM IR (-O2):
define void @loop_general() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
Linux(void) { printf("Hello, Linux\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, Linux\0A\00"
define i32 @Linux() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello, Linux\00"
define i32 @Linux() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ ft_strlen(char *);
int ft_totallen(char **tab, int l_t) {
  int total_len;
  int i;
  total_len = 0;
  i = 0;
  while (i < l_t) {
    total_len += (int)ft_strlen(tab[i]);
    i++;
  }
  return (total_len);
}


x86 assembly (clang, -O0):
<ft_totallen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <ft_totallen+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ft_strlen@plt>
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <ft_totallen+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_totallen>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <ft_totallen+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <ft_strlen@plt>
add    %eax,%ebp
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <ft_totallen+0x20>
jmp    1148 <ft_totallen+0x38>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_totallen(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %14, %6 ]
%8 = phi i32 [ 0, %4 ], [ %13, %6 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i64 @ft_strlen(i8* %10)
%12 = trunc i64 %11 to i32
%13 = add nsw i32 %8, %12
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i32 [ 0, %2 ], [ %13, %6 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c11_support() { printf("<C11 not support!!!>"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"<C11 not support!!!>\00"
define void @c11_support() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"<C11 not support!!!>\00"
define void @c11_support() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct adresse {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ ausgabe(struct adresse *);
struct adresse *eingabe();
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(void) {
  setbuf(stdout, NULL);
  struct adresse *adresse1;
  struct adresse *adresse2;
  adresse1 = eingabe();
  adresse2 = eingabe();
  ausgabe(adresse1);
  ausgabe(adresse2);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <setbuf@plt>
mov    $0x0,%al
call   1050 <eingabe@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <eingabe@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ausgabe@plt>
mov    -0x18(%rbp),%rdi
call   1030 <ausgabe@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
xor    %eax,%eax
call   1050 <eingabe@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <eingabe@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <ausgabe@plt>
mov    %rbx,%rdi
call   1030 <ausgabe@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.adresse = type { i32 }
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.adresse*
%3 = alloca %struct.adresse*
store i32 0, i32* %1
%4 = load i32, i32* @stdout
%5 = call i32 @setbuf(i32 %4, i32* null)
%6 = call %struct.adresse* (...) @eingabe()
store %struct.adresse* %6, %struct.adresse** %2
%7 = call %struct.adresse* (...) @eingabe()
store %struct.adresse* %7, %struct.adresse** %3
%8 = load %struct.adresse*, %struct.adresse** %2
%9 = call i32 @ausgabe(%struct.adresse* %8)
%10 = load %struct.adresse*, %struct.adresse** %3
%11 = call i32 @ausgabe(%struct.adresse* %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
%struct.adresse = type { i32 }
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
%3 = tail call %struct.adresse* (...) @eingabe()
%4 = tail call %struct.adresse* (...) @eingabe()
%5 = tail call i32 @ausgabe(%struct.adresse* %3)
%6 = tail call i32 @ausgabe(%struct.adresse* %4)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int count = 10, x;
  int *int_pointer;
  int_pointer = &count;
  x = *int_pointer;
  printf("count = %i, x = %i\n", count, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"count = %i, x = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10, i32 10)
ret i32 0
}
void update_round_score(int *round_score[], char *card[]) {
  for (int i = 0; i < 4; i++)
    *round_score[i] += *card[i];
}


x86 assembly (clang, -O0):
<update_round_score>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    114a <update_round_score+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%ecx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <update_round_score+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_round_score>:
mov    (%rsi),%rax
movsbl (%rax),%eax
mov    (%rdi),%rcx
add    %eax,(%rcx)
mov    0x8(%rsi),%rax
movsbl (%rax),%eax
mov    0x8(%rdi),%rcx
add    %eax,(%rcx)
mov    0x10(%rsi),%rax
movsbl (%rax),%eax
mov    0x10(%rdi),%rcx
add    %eax,(%rcx)
mov    0x18(%rsi),%rax
movsbl (%rax),%eax
mov    0x18(%rdi),%rcx
add    %eax,(%rcx)
ret

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

LLVM IR (-O2):
define void @update_round_score(i32** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = load i32*, i32** %0
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
store i32 %8, i32* %6
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = getelementptr inbounds i32*, i32** %0, i64 1
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, %12
store i32 %16, i32* %14
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = getelementptr inbounds i32*, i32** %0, i64 2
%22 = load i32*, i32** %21
%23 = load i32, i32* %22
%24 = add nsw i32 %23, %20
store i32 %24, i32* %22
%25 = getelementptr inbounds i8*, i8** %1, i64 3
%26 = load i8*, i8** %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = getelementptr inbounds i32*, i32** %0, i64 3
%30 = load i32*, i32** %29
%31 = load i32, i32* %30
%32 = add nsw i32 %31, %28
store i32 %32, i32* %30
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
uint float_as_uint(const float v) { return *((uint *)(&v)); }


x86 assembly (clang, -O0):
<float_as_uint>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_as_uint>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @float_as_uint(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @float_as_uint(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Variables and functions */
scalar_t__ kalle(int, int);
void _start(int a, int b) {
  if (kalle(a, b))
    return;
  kalle(9, 5);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <kalle@plt>
cmp    $0x0,%rax
je     1138 <_start+0x28>
jmp    1147 <_start+0x37>
mov    $0x9,%edi
mov    $0x5,%esi
call   1030 <kalle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
call   1030 <kalle@plt>
test   %rax,%rax
je     111d <_start+0xd>
pop    %rax
ret
mov    $0x9,%edi
mov    $0x5,%esi
pop    %rax
jmp    1030 <kalle@plt>

LLVM IR (-O0):
define void @_start(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 i64 @kalle(i32 %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %12
10: ; preds = %2
%11 = call i64 @kalle(i32 9, i32 5)
br label %12
12: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @_start(i32 %0, i32 %1) {
%3 = tail call i64 @kalle(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i64 @kalle(i32 9, i32 5)
br label %7
7: ; preds = %2, %5
ret void
}
/* Variables and functions */
int STC31xx_ReadByte8(int);
int /*<<< orphan*/ STC31xx_WriteByte8(int, int);
void STC311x_ForceVM(void) {
  int value;
  value = STC31xx_ReadByte8(0x00);
  STC31xx_WriteByte8(0x00, value | 0x40);
}


x86 assembly (clang, -O0):
<STC311x_ForceVM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <STC31xx_ReadByte8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
or     $0x40,%esi
xor    %edi,%edi
call   1040 <STC31xx_WriteByte8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC311x_ForceVM>:
push   %rax
xor    %edi,%edi
call   1030 <STC31xx_ReadByte8@plt>
or     $0x40,%eax
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <STC31xx_WriteByte8@plt>

LLVM IR (-O0):
define void @STC311x_ForceVM() {
%1 = alloca i32
%2 = call i32 @STC31xx_ReadByte8(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 64
%5 = call i32 @STC31xx_WriteByte8(i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
define void @STC311x_ForceVM() {
%1 = tail call i32 @STC31xx_ReadByte8(i32 0)
%2 = or i32 %1, 64
%3 = tail call i32 @STC31xx_WriteByte8(i32 0, i32 %2)
ret void
}
void irq_disable(void) { __asm__ __volatile__("cli"); }


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

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

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

LLVM IR (-O2):
define void @irq_disable() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
char *hypno(char *yes) {
  yes[4] += 6;
  return yes;
}


x86 assembly (clang, -O0):
<hypno>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%ecx
add    $0x6,%ecx
mov    %cl,0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypno>:
mov    %rdi,%rax
addb   $0x6,0x4(%rdi)
ret

LLVM IR (-O0):
define i8* @hypno(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, 6
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @hypno(i8* returned %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
%4 = add i8 %3, 6
store i8 %4, i8* %2
ret i8* %0
}
void Rename_REV_ARR(ii, jj) int ii, jj;
{
  int i, j;
  i = ii;
  j = jj;
  while (i < j) {
    Rename_SWP_ARR(i, j);
    i = i + 1;
    j = j - 1;
  };
}


x86 assembly (clang, -O0):
<Rename_REV_ARR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115a <Rename_REV_ARR+0x4a>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <Rename_SWP_ARR@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <Rename_REV_ARR+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rename_REV_ARR>:
push   %rbp
push   %rbx
push   %rax
cmp    %esi,%edi
jge    1135 <Rename_REV_ARR+0x25>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <Rename_SWP_ARR@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %ebx,%ebp
jl     1120 <Rename_REV_ARR+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Rename_REV_ARR(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32 [ %8, %4 ], [ %0, %2 ]
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Rename_SWP_ARR to i32 (i32, i32, ...)*)(i32 %6, i32 %5)
%8 = add nsw i32 %6, 1
%9 = add nsw i32 %5, -1
%10 = icmp slt i32 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
void skip_partial_line(FILE *file) {
  int c;
  do {
    c = fgetc(file);
  } while (c != EOF && c != '\n');
  return;
}


x86 assembly (clang, -O0):
<skip_partial_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    0x2eb4(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0xd(%rbp)
je     1149 <skip_partial_line+0x39>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111c <skip_partial_line+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_partial_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1132 <skip_partial_line+0x22>
cmp    (%r14),%eax
jne    1120 <skip_partial_line+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skip_partial_line(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 10
br label %14
14: ; preds = %11, %7
%15 = phi i1 [ false, %7 ], [ %13, %11 ]
br i1 %15, label %4, label %16
16: ; preds = %14
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_partial_line(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
br i1 %7, label %2, label %8
8: ; preds = %2
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int file_exists(char *path) {
  struct stat buf;
  return (0 == stat(path, &buf)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 0, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double RAND_MAX;
double rand();
int get_random(int max) {
  double val;
  val = (double)max * rand();
  val = val / (RAND_MAX + 1.0);
  return ((int)val);
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
mov    0x2e97(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec0(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xecc(%rip),%xmm1
mulsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @get_random(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call double (...) @rand()
%7 = fmul double %5, %6
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* @RAND_MAX
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double %8, %10
store double %11, double* %3
%12 = load double, double* %3
%13 = fptosi double %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @get_random(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double (...) @rand()
%4 = fmul double %3, %2
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_zmq_close(unsigned short _syslog, unsigned short _verbose,
                         const char *_function_name, const char *_file_name,
                         int _line_number, int _errno) {
  pfpanic("Unable to close ZeroMQ socket", _syslog, _verbose, _function_name,
          _file_name, _line_number, _errno, EX_SOFTWARE);
}


x86 assembly (clang, -O0):
<__pfpanic_zmq_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_zmq_close>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Unable to close ZeroMQ socket\00"
@EX_SOFTWARE = global i32 0
define void @__pfpanic_zmq_close(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_SOFTWARE
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Unable to close ZeroMQ socket\00"
@EX_SOFTWARE = global i32 0
define void @__pfpanic_zmq_close(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double getRandomZeroOne() { return (double)(rand()) / (double)(RAND_MAX); }


x86 assembly (clang, -O0):
<getRandomZeroOne>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomZeroOne>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @getRandomZeroOne() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @getRandomZeroOne() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ error_reason(char *, unsigned long long);
void *malloc(size_t);
void *misc_malloc(size_t size) {
  void *result;
  result = malloc(size);
  if (result == NULL) {
    error_reason("Could not allocate %lld bytes of memory",
                 (unsigned long long)size);
  }
  return result;
}


x86 assembly (clang, -O0):
<misc_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <misc_malloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <error_reason@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<misc_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <misc_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <error_reason@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Could not allocate %lld bytes of memory\00"
define i8* @misc_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @error_reason(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [40 x i8] c"Could not allocate %lld bytes of memory\00"
define noalias i8* @misc_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error_reason(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
scalar_t__ syscall(int, void *, size_t, int, int, int, int);
void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off) {
  if (sizeof(off_t) > sizeof(long))
    if (((long)off & 0xfff) |
        ((long)((unsigned long long)off >>
                (12 + 8 * (sizeof(off_t) - sizeof(long))))))
      start = (void *)-1;
  return (void *)syscall(192, start, len, prot, flags, fd, off >> 12);
}


x86 assembly (clang, -O0):
<__mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%eax
sar    $0xc,%eax
mov    $0xc0,%edi
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mmap>:
push   %rax
mov    %r8d,%eax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
sar    $0xc,%r9d
mov    %r9d,(%rsp)
mov    $0xc0,%edi
mov    %eax,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @__mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = ashr i32 %18, 12
%20 = call i64 @syscall(i32 192, i8* %13, i64 %14, i32 %15, i32 %16, i32 %17, i32 %19)
%21 = inttoptr i64 %20 to i8*
ret i8* %21
}

LLVM IR (-O2):
define i8* @__mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = ashr i32 %5, 12
%8 = tail call i64 @syscall(i32 192, i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ f1();
int /*<<< orphan*/ g();
int /*<<< orphan*/ r();
void main(void) {
  f1();
  f();
  g();
  r();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x0,%al
call   1040 <f@plt>
mov    $0x0,%al
call   1060 <g@plt>
mov    $0x0,%al
call   1030 <r@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
xor    %eax,%eax
call   1040 <f@plt>
xor    %eax,%eax
call   1060 <g@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <r@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @f1()
%2 = call i32 (...) @f()
%3 = call i32 (...) @g()
%4 = call i32 (...) @r()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @g()
%4 = tail call i32 (...) @r()
ret void
}
void strip_ending_dirseps(char *s) {
  char *end = s;
  while (*end)
    end++;
  while (end > s && *(--end) == '/')
    *end = '\0';
}


x86 assembly (clang, -O0):
<strip_ending_dirseps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strip_ending_dirseps+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strip_ending_dirseps+0x10>
jmp    1133 <strip_ending_dirseps+0x33>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x11(%rbp)
jbe    1162 <strip_ending_dirseps+0x62>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1172 <strip_ending_dirseps+0x72>
jmp    117e <strip_ending_dirseps+0x7e>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1133 <strip_ending_dirseps+0x33>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_ending_dirseps>:
lea    -0x1(%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x1(%rax)
lea    0x1(%rax),%rax
jne    1110 <strip_ending_dirseps+0x10>
jmp    1128 <strip_ending_dirseps+0x28>
nopl   0x0(%rax)
movb   $0x0,-0x1(%rax)
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
jbe    1133 <strip_ending_dirseps+0x33>
cmpb   $0x2f,-0x1(%rax)
je     1120 <strip_ending_dirseps+0x20>
ret

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

LLVM IR (-O2):
define void @strip_ending_dirseps(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = icmp ugt i8* %3, %0
br i1 %8, label %9, label %16
9: ; preds = %7, %14
%10 = phi i8* [ %11, %14 ], [ %3, %7 ]
%11 = getelementptr inbounds i8, i8* %10, i64 -1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 47
br i1 %13, label %14, label %16
14: ; preds = %9
store i8 0, i8* %11
%15 = icmp ugt i8* %11, %0
br i1 %15, label %9, label %16
16: ; preds = %9, %14, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int atgc, char *argv[]) {
  printf("Hello from %s!\n", argv[0]);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello from %s!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello from %s!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void delayMicroseconds(unsigned int micros) {
  struct timespec sleeper, dummy;
  sleeper.tv_sec = 0;
  sleeper.tv_nsec = (long)(micros * 1000);
  nanosleep(&sleeper, &dummy);
}


x86 assembly (clang, -O0):
<delayMicroseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayMicroseconds>:
sub    $0x28,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edi,%eax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @delayMicroseconds(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* %2
%7 = mul i32 %6, 1000
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @delayMicroseconds(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %6
%7 = mul i32 %0, 1000
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret void
}