xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ momrand_genrand_int32();
double momrand_genrand_real3(void) {
  return (((double)momrand_genrand_int32()) + 0.5) * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<momrand_genrand_real3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <momrand_genrand_int32@plt>
cvtsi2sd %rax,%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<momrand_genrand_real3>:
push   %rax
xor    %eax,%eax
call   1030 <momrand_genrand_int32@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @momrand_genrand_real3() {
%1 = call i64 (...) @momrand_genrand_int32()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}

LLVM IR (-O2):
define double @momrand_genrand_real3() {
%1 = tail call i64 (...) @momrand_genrand_int32()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a, b, temp;
  a = 42;
  b = 69;
  temp = a;
  a = b;
  b = temp;
  printf("a=%d, b=%d w/ temp\n", a, b);
  a = 42;
  b = 69;
  a += b;
  b = a - b;
  a -= b;
  printf("a=%d, b=%d w/o temp\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0x45,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2a,-0x8(%rbp)
movl   $0x45,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"a=%d, b=%d w/ temp\0A\00"
@.str.1 = [21 x i8] c"a=%d, b=%d w/o temp\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
store i32 69, i32* %3
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %2
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
store i32 42, i32* %2
store i32 69, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = add nsw i32 %12, %11
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, %17
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"a=%d, b=%d w/ temp\0A\00"
@.str.1 = [21 x i8] c"a=%d, b=%d w/o temp\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 69, i32 42)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 69, i32 42)
ret i32 0
}
unsigned short CS_(void) {
  unsigned short ret;
  asm volatile("mov %%cs, %0" : "=rm"(ret));
  return ret;
}


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

x86 assembly (clang, -O2):
<CS_>:
mov    %cs,-0x2(%rsp)
movzwl -0x2(%rsp),%eax
ret

LLVM IR (-O0):
define zeroext i16 @CS_() {
%1 = alloca i16
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @CS_() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = load i16, i16* %1
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ synchronize_rcu();
void synchronize_rcu_expedited(void) { synchronize_rcu(); }


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

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

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

LLVM IR (-O2):
define void @synchronize_rcu_expedited() {
%1 = tail call i32 (...) @synchronize_rcu()
ret void
}
/* Variables and functions */
int is_dir_c4_(char *, long);
int is_dir_c8_(char *name, long len_name) { return is_dir_c4_(name, len_name); }


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

x86 assembly (clang, -O2):
<is_dir_c8_>:
jmp    1030 <is_dir_c4_@plt>

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

LLVM IR (-O2):
define i32 @is_dir_c8_(i8* %0, i64 %1) {
%3 = tail call i32 @is_dir_c4_(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ cgc_exit(int);
int /*<<< orphan*/ cgc_strlen(char *);
int /*<<< orphan*/ transmit(int, char *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *);
void *xcalloc(size_t nmemb, size_t size) {
  void *mem = calloc(nmemb, size);
  if (!mem) {
    transmit(2, "calloc failed\n", cgc_strlen("calloc_failed\n"), NULL);
    cgc_exit(1);
  }
  return mem;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1199 <xcalloc+0x59>
lea    0xe9c(%rip),%rdi
call   1030 <cgc_strlen@plt>
mov    %eax,%edx
mov    $0x2,%edi
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1060 <transmit@plt>
mov    $0x1,%edi
call   1040 <cgc_exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1050 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1179 <xcalloc+0x39>
lea    0xeba(%rip),%rdi
call   1030 <cgc_strlen@plt>
lea    0xe9f(%rip),%rsi
mov    $0x2,%edi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <transmit@plt>
mov    $0x1,%edi
call   1040 <cgc_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"calloc failed\0A\00"
@.str.1 = [15 x i8] c"calloc_failed\0A\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = call i32 @cgc_strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @transmit(i32 2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12, i32* null)
%14 = call i32 @cgc_exit(i32 1)
br label %15
15: ; preds = %11, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [15 x i8] c"calloc failed\0A\00"
@.str.1 = [15 x i8] c"calloc_failed\0A\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @cgc_strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @transmit(i32 2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32* null)
%8 = tail call i32 @cgc_exit(i32 1)
br label %9
9: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int is_valid_varchar(int c) {
  if (isdigit(c) || isalpha(c) || c == '_') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_varchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    1159 <is_valid_varchar+0x39>
mov    -0x8(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
jne    1159 <is_valid_varchar+0x39>
cmpl   $0x5f,-0x8(%rbp)
jne    1165 <is_valid_varchar+0x45>
movl   $0x1,-0x4(%rbp)
jmp    116c <is_valid_varchar+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_varchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_valid_varchar+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_valid_varchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @isalpha(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 95
br i1 %13, label %14, label %15
14: ; preds = %11, %7, %1
store i32 1, i32* %2
br label %16
15: ; preds = %11
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_valid_varchar(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @isalpha(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = icmp eq i32 %0, 95
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %9, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __xchg_called_with_bad_pointer();
scalar_t__ xchg_u32(void *, unsigned long);
scalar_t__ xchg_u64(void *, unsigned long);
unsigned long __xchg(unsigned long x, void *ptr, int size) {
  switch (size) {
  case 4:
    return (unsigned long)xchg_u32(ptr, x);
  case 8:
    return (unsigned long)xchg_u64(ptr, x);
  }
  __xchg_called_with_bad_pointer();
  return x;
}


x86 assembly (clang, -O0):
<__xchg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x4,%eax
je     1168 <__xchg+0x38>
jmp    1157 <__xchg+0x27>
mov    -0x20(%rbp),%eax
sub    $0x8,%eax
je     117e <__xchg+0x4e>
jmp    1194 <__xchg+0x64>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <xchg_u32@plt>
mov    %rax,-0x8(%rbp)
jmp    11a3 <__xchg+0x73>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <xchg_u64@plt>
mov    %rax,-0x8(%rbp)
jmp    11a3 <__xchg+0x73>
mov    $0x0,%al
call   1050 <__xchg_called_with_bad_pointer@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xchg>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x8,%edx
je     114a <__xchg+0x1a>
cmp    $0x4,%edx
jne    1156 <__xchg+0x26>
mov    %rsi,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <xchg_u32@plt>
mov    %rsi,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <xchg_u64@plt>
xor    %eax,%eax
call   1050 <__xchg_called_with_bad_pointer@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__xchg(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i64 %0, i64* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
switch i32 %8, label %17 [
i32 4, label %9
i32 8, label %13
]
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i64, i64* %5
%12 = call i64 @xchg_u32(i8* %10, i64 %11)
store i64 %12, i64* %4
br label %20
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = load i64, i64* %5
%16 = call i64 @xchg_u64(i8* %14, i64 %15)
store i64 %16, i64* %4
br label %20
17: ; preds = %3
%18 = call i32 (...) @__xchg_called_with_bad_pointer()
%19 = load i64, i64* %5
store i64 %19, i64* %4
br label %20
20: ; preds = %17, %13, %9
%21 = load i64, i64* %4
ret i64 %21
}

LLVM IR (-O2):
define i64 @__xchg(i64 %0, i8* %1, i32 %2) {
switch i32 %2, label %8 [
i32 4, label %4
i32 8, label %6
]
4: ; preds = %3
%5 = tail call i64 @xchg_u32(i8* %1, i64 %0)
br label %10
6: ; preds = %3
%7 = tail call i64 @xchg_u64(i8* %1, i64 %0)
br label %10
8: ; preds = %3
%9 = tail call i32 (...) @__xchg_called_with_bad_pointer()
br label %10
10: ; preds = %8, %6, %4
%11 = phi i64 [ %0, %8 ], [ %7, %6 ], [ %5, %4 ]
ret i64 %11
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ pci_dummy_write(int, int, void *);
void pci_dummy_writew(uint16_t Port, uint16_t Val, void *p) {
  pci_dummy_write(Port, Val & 0xFF, p);
}


x86 assembly (clang, -O0):
<pci_dummy_writew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    -0x10(%rbp),%rdx
call   1030 <pci_dummy_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_dummy_writew>:
movzbl %sil,%esi
jmp    1030 <pci_dummy_write@plt>

LLVM IR (-O0):
define void @pci_dummy_writew(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 = and i32 %8, 255
%10 = load i8*, i8** %6
%11 = call i32 @pci_dummy_write(i32 %7, i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @pci_dummy_writew(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %1, 255
%5 = tail call i32 @pci_dummy_write(i32 %0, i32 %4, i8* %2)
ret void
}
int abs(int val) { return val < 0 ? -val : val; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int *malloc(int);
void main() {
  int *x;
  int *y;
  x = malloc(sizeof(int));
  *x = 42;
  *y = 13;
  y = x;
  *y = 13;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 42, i32* %4
%5 = load i32*, i32** %2
store i32 13, i32* %5
%6 = load i32*, i32** %1
store i32* %6, i32** %2
%7 = load i32*, i32** %2
store i32 13, i32* %7
ret void
}

LLVM IR (-O2):
int need_rewrite(unsigned previous_tstamp) { return previous_tstamp >= 0xffff; }


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

x86 assembly (clang, -O2):
<need_rewrite>:
xor    %eax,%eax
cmp    $0xffff,%edi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @need_rewrite(i32 %0) {
%2 = icmp ugt i32 %0, 65534
%3 = zext i1 %2 to i32
ret i32 %3
}
float CG_OpFuncDivide(const float a, const float b) { return a / b; }


x86 assembly (clang, -O0):
<CG_OpFuncDivide>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_OpFuncDivide>:
divss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @CG_OpFuncDivide(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Variables and functions */
scalar_t__ rand();
void random_vector_short(short *a, const unsigned int n) {
  for (unsigned int i = 0; i < n; i++) {
    a[i] = (short)rand();
  }
}


x86 assembly (clang, -O0):
<random_vector_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1155 <random_vector_short+0x45>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %ax,%dx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %dx,(%rax,%rcx,2)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <random_vector_short+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_vector_short>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1145 <random_vector_short+0x35>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %ax,(%r14,%rbx,2)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_vector_short+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @random_vector_short(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = call i64 (...) @rand()
%12 = trunc i64 %11 to i16
%13 = load i16*, i16** %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i16, i16* %13, i64 %15
store i16 %12, i16* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @random_vector_short(i16* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = tail call i64 (...) @rand()
%10 = trunc i64 %9 to i16
%11 = getelementptr inbounds i16, i16* %0, i64 %8
store i16 %10, i16* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
func_with_args(moo, yo, dawg) {
  echo("func_with_args");
  echo(moo, " is ", yo, " under ", dawg);
  other_func(77777);
}


x86 assembly (clang, -O0):
<func_with_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%r8d
lea    0xebf(%rip),%rsi
lea    0xebd(%rip),%rcx
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x12fd1,%edi
mov    $0x0,%al
call   1040 <other_func@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_with_args>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <echo@plt>
lea    0xecf(%rip),%rsi
lea    0xecd(%rip),%rcx
mov    %ebx,%edi
mov    %ebp,%edx
mov    %r14d,%r8d
xor    %eax,%eax
call   1030 <echo@plt>
mov    $0x12fd1,%edi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <other_func@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"func_with_args\00"
@.str.1 = [5 x i8] c" is \00"
@.str.2 = [8 x i8] c" under \00"
define i32 @func_with_args(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @echo to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 (i32, i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @echo to i32 (i32, i8*, i32, i8*, i32, ...)*)(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @other_func to i32 (i32, ...)*)(i32 77777)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"func_with_args\00"
@.str.1 = [5 x i8] c" is \00"
@.str.2 = [8 x i8] c" under \00"
define i32 @func_with_args(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @echo to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i32, i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @echo to i32 (i32, i8*, i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @other_func to i32 (i32, ...)*)(i32 77777)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert_true(int, char *, int, char *);
void __ctest_suite2_test1_run(void) {
  assert_true(1 == 1,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/madphage/mpcstl/refs/heads/master/"
              "testlib/example_suite2.c",
              4, "1 == 1");
}


x86 assembly (clang, -O0):
<__ctest_suite2_test1_run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x4,%edx
lea    0xf69(%rip),%rcx
call   1030 <assert_true@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ctest_suite2_test1_run>:
lea    0xee9(%rip),%rsi
lea    0xf77(%rip),%rcx
mov    $0x1,%edi
mov    $0x4,%edx
jmp    1030 <assert_true@plt>

LLVM IR (-O0):
@.str = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/madphage/mpcstl/refs/heads/master/testlib/example_suite2.c\00"
@.str.1 = [7 x i8] c"1 == 1\00"
define void @__ctest_suite2_test1_run() {
%1 = call i32 @assert_true(i32 1, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/madphage/mpcstl/refs/heads/master/testlib/example_suite2.c\00"
@.str.1 = [7 x i8] c"1 == 1\00"
define void @__ctest_suite2_test1_run() {
%1 = tail call i32 @assert_true(i32 1, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void function(char *p) { *p = 10; }


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

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

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

LLVM IR (-O2):
define void @function(i8* nocapture writeonly %0) {
store i8 10, i8* %0
ret void
}
int DRV_DSP_DRX_GPIO_VAL_SET(unsigned int u32Data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_DSP_DRX_GPIO_VAL_SET(i32 %0) {
ret i32 0
}
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  i = 0;
  while (*(s + i)) {
    (*f)(s + i);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1148 <ft_striter+0x48>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rcx
add    %rcx,%rdi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <ft_striter+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1120 <ft_striter+0x20>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1110 <ft_striter+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
tail call void %1(i8* %7)
%8 = add nuw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
void gendebug() {}


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

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

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

LLVM IR (-O2):
define void @gendebug() {
ret void
}
/* Variables and functions */
int W_CheckNumForName(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int W_GetNumForName(const char *name) {
  int i;
  i = W_CheckNumForName(name);
  if (i == -1) {
    fprintf(stderr, "W_GetNumForName: %s not found!", name);
  }
  return i;
}


x86 assembly (clang, -O0):
<W_GetNumForName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <W_CheckNumForName@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    115b <W_GetNumForName+0x3b>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<W_GetNumForName>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <W_CheckNumForName@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    114a <W_GetNumForName+0x2a>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"W_GetNumForName: %s not found!\00"
define i32 @W_GetNumForName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @W_CheckNumForName(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"W_GetNumForName: %s not found!\00"
define i32 @W_GetNumForName(i8* %0) {
%2 = tail call i32 @W_CheckNumForName(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sha3_512(int /*<<< orphan*/ *const, int,
                            int /*<<< orphan*/ const *, size_t const);
void SHA3_512(uint8_t *const ret, uint8_t const *data, const size_t size) {
  sha3_512(ret, 64, data, size);
}


x86 assembly (clang, -O0):
<SHA3_512>:
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),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x40,%esi
call   1030 <sha3_512@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA3_512>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x40,%esi
jmp    1030 <sha3_512@plt>

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

LLVM IR (-O2):
define void @SHA3_512(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @sha3_512(i32* %0, i32 64, i32* %1, i64 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_int32_t(int32_t const k1, int32_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_int32_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_int32_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_int32_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int getgid();
int getpgrp() { return getgid(); }


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

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

LLVM IR (-O0):
define i32 @getpgrp() {
%1 = call i32 (...) @getgid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpgrp() {
%1 = tail call i32 (...) @getgid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ commnds();
int /*<<< orphan*/ init(int, char **);
int main(int argc, char *argv[]) {
  init(argc, argv);
  commnds();
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <init@plt>
mov    $0x0,%al
call   1040 <commnds@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <init@plt>
xor    %eax,%eax
call   1040 <commnds@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @init(i32 %6, i8** %7)
%9 = call i32 (...) @commnds()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init(i32 %0, i8** %1)
%4 = tail call i32 (...) @commnds()
ret i32 0
}
__complex__ float __attribute__((no)) foo(__complex__ float x) { return x; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define <2 x float> @foo(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %6, float* %9
store float %8, float* %10
%11 = bitcast { float, float }* %2 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
ret <2 x float> %12
}

LLVM IR (-O2):
define <2 x float> @foo(<2 x float> returned %0) {
ret <2 x float> %0
}
int do_539() { return 539; }


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

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

LLVM IR (-O0):
define i32 @do_539() {
ret i32 539
}

LLVM IR (-O2):
define i32 @do_539() {
ret i32 539
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;
typedef int ordinal;

/* Variables and functions */
void SET_LIBRARY_ORDINAL(uint16_t *n_desc, uint8_t ordinal) {
  *n_desc = (((*n_desc) & 0x00ff) | (((ordinal)&0xff) << 8));
}


x86 assembly (clang, -O0):
<SET_LIBRARY_ORDINAL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xff,%ecx
mov    -0xc(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SET_LIBRARY_ORDINAL>:
movzbl (%rdi),%eax
shl    $0x8,%esi
movzwl %si,%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @SET_LIBRARY_ORDINAL(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* %5
%7 = and i32 %6, 255
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = load i32*, i32** %3
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @SET_LIBRARY_ORDINAL(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 255
%5 = shl i32 %1, 8
%6 = and i32 %5, 65280
%7 = or i32 %4, %6
store i32 %7, i32* %0
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char const *, struct stat *);
int isFile(const char *path) {
  struct stat path_stat;
  stat(path, &path_stat);
  return S_ISREG(path_stat.st_mode);
}


x86 assembly (clang, -O0):
<isFile>:
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    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFile>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <S_ISREG@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isFile(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @S_ISREG(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isFile(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @S_ISREG(i32 %6)
ret i32 %7
}
/* Variables and functions */
int e_inline_baz();
int foo(void) { return e_inline_baz(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @e_inline_baz()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @e_inline_baz()
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long killid;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
void set_XStandardColormap_killid(void *_p, unsigned long _v) {
  ((XStandardColormap *)_p)->killid = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XStandardColormap_killid(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int solveMeFirst(int, int);
int main() {
  int num1, num2;
  scanf("%d %d", &num1, &num2);
  int sum;
  sum = solveMeFirst(num1, num2);
  printf("%d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <solveMeFirst@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <solveMeFirst@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @solveMeFirst(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int function2(void) {
  printf("Hello, world! from original library\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Hello, world! from original library\0A\00"
define i32 @function2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [36 x i8] c"Hello, world! from original library\00"
define i32 @function2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, z;
  x = 0;
  y = 100;
  z = __VERIFIER_nondet_int();
  while (x < 40) {
    if (z == 0) {
      x = x + 1;
    } else {
      x = x + 2;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x28,-0x8(%rbp)
jge    1167 <main+0x57>
cmpl   $0x0,-0x10(%rbp)
jne    1159 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x52>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <main+0x27>
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
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int row_count_for_process(int process_count, int row_count, int tile_row,
                          int current_id) {
  int tile_count = row_count / tile_row;
  int remain = tile_count % process_count;
  int base = tile_count / process_count;
  int row = base * tile_row;
  if (current_id < remain) {
    row += tile_row;
  }
  return row;
}


x86 assembly (clang, -O0):
<row_count_for_process>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    114d <row_count_for_process+0x4d>
mov    -0xc(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_count_for_process>:
mov    %edx,%r8d
mov    %esi,%eax
cltd
idiv   %r8d
cltd
idiv   %edi
imul   %r8d,%eax
xor    %esi,%esi
cmp    %ecx,%edx
cmovg  %r8d,%esi
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @row_count_for_process(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = sdiv i32 %13, %14
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = load i32, i32* %5
%18 = srem i32 %16, %17
store i32 %18, i32* %10
%19 = load i32, i32* %9
%20 = load i32, i32* %5
%21 = sdiv i32 %19, %20
store i32 %21, i32* %11
%22 = load i32, i32* %11
%23 = load i32, i32* %7
%24 = mul nsw i32 %22, %23
store i32 %24, i32* %12
%25 = load i32, i32* %8
%26 = load i32, i32* %10
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %32
28: ; preds = %4
%29 = load i32, i32* %7
%30 = load i32, i32* %12
%31 = add nsw i32 %30, %29
store i32 %31, i32* %12
br label %32
32: ; preds = %28, %4
%33 = load i32, i32* %12
ret i32 %33
}

LLVM IR (-O2):
define i32 @row_count_for_process(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sdiv i32 %1, %2
%6 = srem i32 %5, %0
%7 = sdiv i32 %5, %0
%8 = mul nsw i32 %7, %2
%9 = icmp sgt i32 %6, %3
%10 = select i1 %9, i32 %2, i32 0
%11 = add nsw i32 %8, %10
ret i32 %11
}