xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
void bitmap_set(uint64_t *map, unsigned bitno) {
  int pos = bitno / 64;
  int bit = bitno % 64;
  map[pos] |= 1ULL << bit;
}


x86 assembly (clang, -O0):
<bitmap_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_set>:
mov    %esi,%ecx
mov    %esi,%eax
mov    $0x1,%edx
shl    %cl,%rdx
shr    $0x6,%eax
or     %rdx,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @bitmap_set(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = udiv i32 %7, 64
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = urem i32 %9, 64
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = zext i32 %11 to i64
%13 = shl i64 1, %12
%14 = load i64*, i64** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
%18 = load i64, i64* %17
%19 = or i64 %18, %13
store i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @bitmap_set(i64* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 6
%4 = and i32 %1, 63
%5 = zext i32 %4 to i64
%6 = shl nuw i64 1, %5
%7 = zext i32 %3 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %6
store i64 %10, i64* %8
ret void
}
void os_restore_mode(fd) int fd;
{ return; }


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

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

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

LLVM IR (-O2):
define void @os_restore_mode(i32 %0) {
ret void
}
/* Variables and functions */
int _InterlockedCompareExchange(int volatile *, int, int);
int test_InterlockedCompareExchange(int volatile *Destination, int Exchange,
                                    int Comperand) {
  return _InterlockedCompareExchange(Destination, Exchange, Comperand);
}


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

x86 assembly (clang, -O2):
<test_InterlockedCompareExchange>:
jmp    1030 <_InterlockedCompareExchange@plt>

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

LLVM IR (-O2):
define i32 @test_InterlockedCompareExchange(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @_InterlockedCompareExchange(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int listen_ip_addr_change();
int main(int argc, char **argv) { return listen_ip_addr_change(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @listen_ip_addr_change()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
int /*<<< orphan*/ Me();
int /*<<< orphan*/ SetInMsg(int /*<<< orphan*/, char *);
char *TextOf(int /*<<< orphan*/);
void Act_SetIn(void) {
  char *x = TextOf(ArgText());
  SetInMsg(Me(), x);
}


x86 assembly (clang, -O0):
<Act_SetIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <Me@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <SetInMsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_SetIn>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <Me@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <SetInMsg@plt>

LLVM IR (-O0):
define void @Act_SetIn() {
%1 = alloca i8*
%2 = call i32 (...) @ArgText()
%3 = call i8* @TextOf(i32 %2)
store i8* %3, i8** %1
%4 = call i32 (...) @Me()
%5 = load i8*, i8** %1
%6 = call i32 @SetInMsg(i32 %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @Act_SetIn() {
%1 = tail call i32 (...) @ArgText()
%2 = tail call i8* @TextOf(i32 %1)
%3 = tail call i32 (...) @Me()
%4 = tail call i32 @SetInMsg(i32 %3, i8* %2)
ret void
}
/* Variables and functions */
long count1sposnos(long, int /*<<< orphan*/);
long count1snegnos(long n) {
  if (n == 0)
    return 0;
  long N = (-1 * n);
  if (N - 1 == 0)
    return 32;
  else
    return (N * 32) - count1sposnos(N, 0);
}


x86 assembly (clang, -O0):
<count1snegnos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <count1snegnos+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1181 <count1snegnos+0x71>
imul   $0xffffffffffffffff,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
cmp    $0x0,%rax
jne    115c <count1snegnos+0x4c>
movq   $0x20,-0x8(%rbp)
jmp    1181 <count1snegnos+0x71>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <count1sposnos@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count1snegnos>:
push   %rbx
test   %rdi,%rdi
je     1132 <count1snegnos+0x22>
cmp    $0xffffffffffffffff,%rdi
je     1136 <count1snegnos+0x26>
neg    %rdi
mov    %rdi,%rbx
shl    $0x5,%rbx
xor    %esi,%esi
call   1030 <count1sposnos@plt>
sub    %rax,%rbx
jmp    113b <count1snegnos+0x2b>
xor    %ebx,%ebx
jmp    113b <count1snegnos+0x2b>
mov    $0x20,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @count1snegnos(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 0, i64* %2
br label %21
8: ; preds = %1
%9 = load i64, i64* %3
%10 = mul nsw i64 -1, %9
store i64 %10, i64* %4
%11 = load i64, i64* %4
%12 = sub nsw i64 %11, 1
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
store i64 32, i64* %2
br label %21
15: ; preds = %8
%16 = load i64, i64* %4
%17 = mul nsw i64 %16, 32
%18 = load i64, i64* %4
%19 = call i64 @count1sposnos(i64 %18, i32 0)
%20 = sub nsw i64 %17, %19
store i64 %20, i64* %2
br label %21
21: ; preds = %15, %14, %7
%22 = load i64, i64* %2
ret i64 %22
}

LLVM IR (-O2):
define i64 @count1snegnos(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = sub nsw i64 0, %0
%5 = icmp eq i64 %0, -1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = shl nsw i64 %4, 5
%8 = tail call i64 @count1sposnos(i64 %4, i32 0)
%9 = sub nsw i64 %7, %8
br label %10
10: ; preds = %6, %3, %1
%11 = phi i64 [ 0, %1 ], [ %9, %6 ], [ 32, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
int COPY_REG(int src_reg) {
  if (src_reg & 8)
    addbyte(0x44);
  addbyte(0x89);
  addbyte(0xc0 | 1 | ((src_reg & 7) << 3));
  return 1 | (src_reg & 0x10);
}


x86 assembly (clang, -O0):
<COPY_REG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1134 <COPY_REG+0x24>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
or     $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COPY_REG>:
push   %rbx
mov    %edi,%ebx
test   $0x8,%bl
je     1122 <COPY_REG+0x12>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
lea    0x0(,%rbx,8),%eax
or     $0xc1,%eax
movzbl %al,%edi
call   1030 <addbyte@plt>
and    $0x10,%ebx
or     $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @COPY_REG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @addbyte(i32 68)
br label %8
8: ; preds = %6, %1
%9 = call i32 @addbyte(i32 137)
%10 = load i32, i32* %2
%11 = and i32 %10, 7
%12 = shl i32 %11, 3
%13 = or i32 193, %12
%14 = call i32 @addbyte(i32 %13)
%15 = load i32, i32* %2
%16 = and i32 %15, 16
%17 = or i32 1, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @COPY_REG(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @addbyte(i32 68)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @addbyte(i32 137)
%8 = shl i32 %0, 3
%9 = and i32 %8, 56
%10 = or i32 %9, 193
%11 = tail call i32 @addbyte(i32 %10)
%12 = and i32 %0, 16
%13 = or i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf_hexdigit(unsigned int);
void printf_hex(unsigned int i) {
  int j;
  for (j = 28; j >= 0; j = j - 4) {
    printf_hexdigit((i >> j) & 0x0f);
  }
}


x86 assembly (clang, -O0):
<printf_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1c,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114a <printf_hex+0x3a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
shr    %cl,%edi
and    $0xf,%edi
call   1030 <printf_hexdigit@plt>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printf_hex+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_hex>:
push   %rbx
mov    %edi,%ebx
shr    $0x1c,%edi
call   1030 <printf_hexdigit@plt>
mov    %ebx,%edi
shr    $0x18,%edi
and    $0xf,%edi
call   1030 <printf_hexdigit@plt>
mov    %ebx,%edi
shr    $0x14,%edi
and    $0xf,%edi
call   1030 <printf_hexdigit@plt>
mov    %ebx,%edi
shr    $0x10,%edi
and    $0xf,%edi
call   1030 <printf_hexdigit@plt>
mov    %ebx,%edi
shr    $0xc,%edi
and    $0xf,%edi
call   1030 <printf_hexdigit@plt>
mov    %ebx,%edi
shr    $0x8,%edi
and    $0xf,%edi
call   1030 <printf_hexdigit@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0xf,%edi
call   1030 <printf_hexdigit@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <printf_hexdigit@plt>

LLVM IR (-O0):
define void @printf_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 28, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = lshr i32 %8, %9
%11 = and i32 %10, 15
%12 = call i32 @printf_hexdigit(i32 %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 4
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @printf_hex(i32 %0) {
%2 = lshr i32 %0, 28
%3 = tail call i32 @printf_hexdigit(i32 %2)
%4 = lshr i32 %0, 24
%5 = and i32 %4, 15
%6 = tail call i32 @printf_hexdigit(i32 %5)
%7 = lshr i32 %0, 20
%8 = and i32 %7, 15
%9 = tail call i32 @printf_hexdigit(i32 %8)
%10 = lshr i32 %0, 16
%11 = and i32 %10, 15
%12 = tail call i32 @printf_hexdigit(i32 %11)
%13 = lshr i32 %0, 12
%14 = and i32 %13, 15
%15 = tail call i32 @printf_hexdigit(i32 %14)
%16 = lshr i32 %0, 8
%17 = and i32 %16, 15
%18 = tail call i32 @printf_hexdigit(i32 %17)
%19 = lshr i32 %0, 4
%20 = and i32 %19, 15
%21 = tail call i32 @printf_hexdigit(i32 %20)
%22 = and i32 %0, 15
%23 = tail call i32 @printf_hexdigit(i32 %22)
ret void
}
int issep(char *ch) {
  int ret;
  if ((*ch == ' ') || (*ch == ','))
    ret = 1;
  else
    ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<issep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1128 <issep+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1134 <issep+0x34>
movl   $0x1,-0xc(%rbp)
jmp    113b <issep+0x3b>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<issep>:
mov    (%rdi),%al
cmp    $0x20,%al
sete   %cl
cmp    $0x2c,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @issep(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 44
br i1 %12, label %13, label %14
13: ; preds = %8, %1
store i32 1, i32* %3
br label %15
14: ; preds = %8
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @issep(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 32
%4 = icmp eq i8 %2, 44
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int get_MemDesc(int array, int dimm, char *desc, int *psz) { return -1; }


x86 assembly (clang, -O0):
<get_MemDesc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_MemDesc(i32 %0, i32 %1, i8* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 -1
}
void *(*moost_pdl_symbol_to_function_cast_(void *p))() { return p; }


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

x86 assembly (clang, -O2):
<moost_pdl_symbol_to_function_cast_>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* (...)* @moost_pdl_symbol_to_function_cast_(i8* readnone %0) {
%2 = bitcast i8* %0 to i8* (...)*
ret i8* (...)* %2
}
void free_3d_int(int ***ptr) {
  free(ptr[0][0]);
  free(ptr[0]);
  free(ptr);
}


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

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

LLVM IR (-O0):
define void @free_3d_int(i32*** %0) {
%2 = alloca i32***
store i32*** %0, i32**** %2
%3 = load i32***, i32**** %2
%4 = getelementptr inbounds i32**, i32*** %3, i64 0
%5 = load i32**, i32*** %4
%6 = getelementptr inbounds i32*, i32** %5, i64 0
%7 = load i32*, i32** %6
%8 = bitcast i32* %7 to i8*
%9 = load i32***, i32**** %2
%10 = getelementptr inbounds i32**, i32*** %9, i64 0
%11 = load i32**, i32*** %10
%12 = bitcast i32** %11 to i8*
%13 = load i32***, i32**** %2
%14 = bitcast i32*** %13 to i8*
ret void
}

LLVM IR (-O2):
define void @free_3d_int(i32*** nocapture %0) {
%2 = bitcast i32*** %0 to i8***
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = bitcast i32*** %0 to i8**
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = bitcast i32*** %0 to i8*
tail call void @free(i8* %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_extract_epi16(int /*<<< orphan*/, int);
void test_extract_epi16(__m128i __a) { _mm_extract_epi16(__a, 8); }


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

x86 assembly (clang, -O2):
<test_extract_epi16>:
mov    $0x8,%esi
jmp    1030 <_mm_extract_epi16@plt>

LLVM IR (-O0):
define void @test_extract_epi16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm_extract_epi16(i32 %3, i32 8)
ret void
}

LLVM IR (-O2):
define void @test_extract_epi16(i32 %0) {
%2 = tail call i32 @_mm_extract_epi16(i32 %0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debloquerJeux(int);
int /*<<< orphan*/ menuSolo();
int /*<<< orphan*/ quitter();
void actionMagasin(int choix) {
  switch (choix) {
  case -1:
    menuSolo();
    break;
  case 0:
    quitter();
    break;
  default:
    debloquerJeux(choix);
    break;
  }
}


x86 assembly (clang, -O0):
<actionMagasin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xffffffff,%eax
je     115f <actionMagasin+0x2f>
jmp    114f <actionMagasin+0x1f>
mov    -0x8(%rbp),%eax
test   %eax,%eax
je     116b <actionMagasin+0x3b>
jmp    1177 <actionMagasin+0x47>
mov    $0x0,%al
call   1050 <menuSolo@plt>
jmp    117f <actionMagasin+0x4f>
mov    $0x0,%al
call   1030 <quitter@plt>
jmp    117f <actionMagasin+0x4f>
mov    -0x4(%rbp),%edi
call   1040 <debloquerJeux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<actionMagasin>:
test   %edi,%edi
je     1140 <actionMagasin+0x10>
cmp    $0xffffffff,%edi
jne    1147 <actionMagasin+0x17>
xor    %eax,%eax
jmp    1050 <menuSolo@plt>
xor    %eax,%eax
jmp    1030 <quitter@plt>
jmp    1040 <debloquerJeux@plt>

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

LLVM IR (-O2):
define void @actionMagasin(i32 %0) {
switch i32 %0, label %6 [
i32 -1, label %2
i32 0, label %4
]
2: ; preds = %1
%3 = tail call i32 (...) @menuSolo()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @quitter()
br label %8
6: ; preds = %1
%7 = tail call i32 @debloquerJeux(i32 %0)
br label %8
8: ; preds = %6, %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FWD_check_drop();
int /*<<< orphan*/ FWD_check_timeout();
int /*<<< orphan*/ FWD_network_update();
void FWD_update_peers(void) {
  FWD_network_update();
  FWD_check_timeout();
  FWD_check_drop();
}


x86 assembly (clang, -O0):
<FWD_update_peers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FWD_network_update@plt>
mov    $0x0,%al
call   1040 <FWD_check_timeout@plt>
mov    $0x0,%al
call   1050 <FWD_check_drop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FWD_update_peers>:
push   %rax
xor    %eax,%eax
call   1030 <FWD_network_update@plt>
xor    %eax,%eax
call   1040 <FWD_check_timeout@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <FWD_check_drop@plt>

LLVM IR (-O0):
define void @FWD_update_peers() {
%1 = call i32 (...) @FWD_network_update()
%2 = call i32 (...) @FWD_check_timeout()
%3 = call i32 (...) @FWD_check_drop()
ret void
}

LLVM IR (-O2):
define void @FWD_update_peers() {
%1 = tail call i32 (...) @FWD_network_update()
%2 = tail call i32 (...) @FWD_check_timeout()
%3 = tail call i32 (...) @FWD_check_drop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *internal_type(char *);
int /*<<< orphan*/ printf(char *, char *);
void cmd_type(char *str) {
  char *output;
  output = internal_type(str);
  printf("%s\n", output);
  free(output);
}


x86 assembly (clang, -O0):
<cmd_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <internal_type@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_type>:
push   %rbx
call   1050 <internal_type@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @cmd_type(i8* %0) {
%2 = tail call i8* @internal_type(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
void g_object_new() {}


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

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

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

LLVM IR (-O2):
define void @g_object_new() {
ret void
}
int play_state_resume(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @play_state_resume() {
ret i32 0
}

LLVM IR (-O2):
define i32 @play_state_resume() {
ret i32 0
}
/* Variables and functions */
size_t UINT_MAX;
void *memalign(size_t, size_t);
void *_xmalloc_array(size_t size, size_t align, size_t num) {
  if (size && num > UINT_MAX / size)
    return NULL;
  return memalign(align, size * num);
}


x86 assembly (clang, -O0):
<_xmalloc_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <_xmalloc_array+0x56>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    1166 <_xmalloc_array+0x56>
movq   $0x0,-0x8(%rbp)
jmp    117c <_xmalloc_array+0x6c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1030 <memalign@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xmalloc_array>:
mov    %rdx,%rcx
test   %rdi,%rdi
je     1144 <_xmalloc_array+0x34>
mov    0x2ec9(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rdx
or     %rdi,%rdx
shr    $0x20,%rdx
je     113b <_xmalloc_array+0x2b>
xor    %edx,%edx
div    %rdi
cmp    %rcx,%rax
jae    1144 <_xmalloc_array+0x34>
xor    %eax,%eax
ret
xor    %edx,%edx
div    %edi
cmp    %rcx,%rax
jb     1138 <_xmalloc_array+0x28>
imul   %rdi,%rcx
mov    %rsi,%rdi
mov    %rcx,%rsi
jmp    1030 <memalign@plt>

LLVM IR (-O0):
@UINT_MAX = global i64 0
define i8* @_xmalloc_array(i64 %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %5
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i64, i64* %7
%12 = load i64, i64* @UINT_MAX
%13 = load i64, i64* %5
%14 = udiv i64 %12, %13
%15 = icmp ugt i64 %11, %14
br i1 %15, label %16, label %17
16: ; preds = %10
store i8* null, i8** %4
br label %23
17: ; preds = %10, %3
%18 = load i64, i64* %6
%19 = load i64, i64* %5
%20 = load i64, i64* %7
%21 = mul i64 %19, %20
%22 = call i8* @memalign(i64 %18, i64 %21)
store i8* %22, i8** %4
br label %23
23: ; preds = %17, %16
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
@UINT_MAX = global i64 0
define noalias i8* @_xmalloc_array(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = load i64, i64* @UINT_MAX
%7 = udiv i64 %6, %0
%8 = icmp ult i64 %7, %2
br i1 %8, label %12, label %9
9: ; preds = %5, %3
%10 = mul i64 %2, %0
%11 = tail call i8* @memalign(i64 %1, i64 %10)
br label %12
12: ; preds = %5, %9
%13 = phi i8* [ %11, %9 ], [ null, %5 ]
ret i8* %13
}
/* Variables and functions */
int lpc_uart_reg_read(int /*<<< orphan*/);
scalar_t__ lpc_uart_rx_empty();
int mp_hal_stdin_rx_chr(void) {
  while (lpc_uart_rx_empty()) {
    ;
  }
  return lpc_uart_reg_read(0);
}


x86 assembly (clang, -O0):
<mp_hal_stdin_rx_chr>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <mp_hal_stdin_rx_chr+0x9>
mov    $0x0,%al
call   1040 <lpc_uart_rx_empty@plt>
cmp    $0x0,%rax
je     113f <mp_hal_stdin_rx_chr+0x1f>
jmp    1129 <mp_hal_stdin_rx_chr+0x9>
xor    %edi,%edi
call   1030 <lpc_uart_reg_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_hal_stdin_rx_chr>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <lpc_uart_rx_empty@plt>
test   %rax,%rax
jne    1130 <mp_hal_stdin_rx_chr+0x10>
xor    %edi,%edi
pop    %rax
jmp    1030 <lpc_uart_reg_read@plt>

LLVM IR (-O0):
define i32 @mp_hal_stdin_rx_chr() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @lpc_uart_rx_empty()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
%6 = call i32 @lpc_uart_reg_read(i32 0)
ret i32 %6
}

LLVM IR (-O2):
define i32 @mp_hal_stdin_rx_chr() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @lpc_uart_rx_empty()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 @lpc_uart_reg_read(i32 0)
ret i32 %5
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
float vec2_length_squared(float *);
__attribute__((always_)) float psvec2_length_squared(struct vec2 *a) {
  return vec2_length_squared((float *)a);
}


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

x86 assembly (clang, -O2):
<psvec2_length_squared>:
jmp    1030 <vec2_length_squared@plt>

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define float @psvec2_length_squared(%struct.vec2* %0) {
%2 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %2
%3 = load %struct.vec2*, %struct.vec2** %2
%4 = bitcast %struct.vec2* %3 to float*
%5 = call float @vec2_length_squared(float* %4)
ret float %5
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define float @psvec2_length_squared(%struct.vec2* %0) {
%2 = bitcast %struct.vec2* %0 to float*
%3 = tail call float @vec2_length_squared(float* %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ difftime();
void dummy() { difftime(); }


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

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

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

LLVM IR (-O2):
define void @dummy() {
%1 = tail call i32 (...) @difftime()
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ srandom(unsigned int);
void initrandom() {
  unsigned int seed = 0x23468676;
  struct timeval tv;
  gettimeofday(&tv, 0);
  seed ^= (int)tv.tv_sec;
  seed ^= (int)tv.tv_usec;
  seed ^= (int)getpid() * 37;
  srandom(seed);
}


x86 assembly (clang, -O0):
<initrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x23468676,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
imul   $0x25,%eax,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <srandom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initrandom>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1050 <gettimeofday@plt>
mov    (%rsp),%ebx
xor    0x8(%rsp),%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,4),%edi
xor    %ebx,%edi
xor    $0x23468676,%edi
call   1030 <srandom@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @initrandom() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 591824502, i32* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i32, i32* %1
%8 = xor i32 %7, %6
store i32 %8, i32* %1
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = load i32, i32* %1
%13 = xor i32 %12, %11
store i32 %13, i32* %1
%14 = call i64 (...) @getpid()
%15 = trunc i64 %14 to i32
%16 = mul nsw i32 %15, 37
%17 = load i32, i32* %1
%18 = xor i32 %17, %16
store i32 %18, i32* %1
%19 = load i32, i32* %1
%20 = call i32 @srandom(i32 %19)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @initrandom() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = xor i64 %7, %5
%9 = trunc i64 %8 to i32
%10 = call i64 (...) @getpid()
%11 = trunc i64 %10 to i32
%12 = mul nsw i32 %11, 37
%13 = xor i32 %12, %9
%14 = xor i32 %13, 591824502
%15 = call i32 @srandom(i32 %14)
ret void
}
/* Type definitions */
struct Trie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ logger_impl(int, char *, int, char *);
int sel_trie(struct Trie *root, char *p) {
  {
    logger_impl(
        0x08,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c",
        44, "NotImplementedError\n");
  };
}


x86 assembly (clang, -O0):
<sel_trie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x8,%edi
lea    0xed4(%rip),%rsi
mov    $0x2c,%edx
lea    0xf4a(%rip),%rcx
call   1030 <logger_impl@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sel_trie>:
lea    0xee9(%rip),%rsi
lea    0xf64(%rip),%rcx
mov    $0x8,%edi
mov    $0x2c,%edx
jmp    1030 <logger_impl@plt>

LLVM IR (-O0):
%struct.Trie = type { i32 }
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c\00"
@.str.1 = [21 x i8] c"NotImplementedError\0A\00"
define i32 @sel_trie(%struct.Trie* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.Trie*
%5 = alloca i8*
store %struct.Trie* %0, %struct.Trie** %4
store i8* %1, i8** %5
%6 = call i32 @logger_impl(i32 8, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 44, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct.Trie = type { i32 }
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c\00"
@.str.1 = [21 x i8] c"NotImplementedError\0A\00"
define i32 @sel_trie(%struct.Trie* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @logger_impl(i32 8, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 44, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
void gdk_display_get_default_screen() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_get_default_screen() {
ret void
}
void shellLogNoop(void *pNotUsed, int iErrCode, const char *zMsg) { return; }


x86 assembly (clang, -O0):
<shellLogNoop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @shellLogNoop(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc32_gzip_refl_base(int /*<<< orphan*/,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
uint32_t crc32_gzip_refl(uint32_t seed, const unsigned char *buf,
                         uint64_t len) {
  return crc32_gzip_refl_base(seed, (uint8_t *)buf, len);
}


x86 assembly (clang, -O0):
<crc32_gzip_refl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <crc32_gzip_refl_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32_gzip_refl>:
jmp    1030 <crc32_gzip_refl_base@plt>

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

LLVM IR (-O2):
define i32 @crc32_gzip_refl(i32 %0, i8* %1, i32 %2) {
%4 = bitcast i8* %1 to i32*
%5 = tail call i32 @crc32_gzip_refl_base(i32 %0, i32* %4, i32 %2)
ret i32 %5
}
void release_fpu_trap() { asm("clts"); }


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

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

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

LLVM IR (-O2):
define void @release_fpu_trap() {
tail call void asm sideeffect "clts", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int pidfile_read(const char *pidfile) {
  FILE *file;
  int pid;
  if (!(file = fopen(pidfile, "r"))) {
    return 0;
  }
  fscanf(file, "%d", &pid);
  fclose(file);
  return pid;
}


x86 assembly (clang, -O0):
<pidfile_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1166 <pidfile_read+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1189 <pidfile_read+0x59>
mov    -0x18(%rbp),%rdi
lea    0xe91(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pidfile_read>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116b <pidfile_read+0x3b>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0xc(%rsp),%eax
jmp    116d <pidfile_read+0x3d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @pidfile_read(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %16
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i32 @fscanf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%13 = load i32*, i32** %4
%14 = call i32 @fclose(i32* %13)
%15 = load i32, i32* %5
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @pidfile_read(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @fclose(i32* %4)
%9 = load i32, i32* %2
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
main() {
  int myfprintf(FILE *, char *, ...);
  myfprintf(NULL, "%d %d %d", 2, 2, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
lea    0xee1(%rip),%rsi
mov    $0x2,%ecx
mov    $0x5,%r8d
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <myfprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
mov    $0x2,%edx
mov    $0x2,%ecx
mov    $0x5,%r8d
xor    %eax,%eax
call   1030 <myfprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = call i32 (i32*, i8*, ...) @myfprintf(i32* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = tail call i32 (i32*, i8*, ...) @myfprintf(i32* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 5)
ret i32 0
}
/* Variables and functions */
unsigned char *four_numbering_system_decode(unsigned char *, int);
unsigned char *mincrypt_convert_from_four_system(unsigned char *data, int len) {
  return four_numbering_system_decode(data, len);
}


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

x86 assembly (clang, -O2):
<mincrypt_convert_from_four_system>:
jmp    1030 <four_numbering_system_decode@plt>

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

LLVM IR (-O2):
define i8* @mincrypt_convert_from_four_system(i8* %0, i32 %1) {
%3 = tail call i8* @four_numbering_system_decode(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mailimf_word_free(char *word) { free(word); }


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

x86 assembly (clang, -O2):
<mailimf_word_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mailimf_word_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void print_error(char *error_msg) { perror(error_msg); }


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

x86 assembly (clang, -O2):
<print_error>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @print_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
char const *weak_n3();
const char *__attribute__((section(".test.c"))) call_weak_n3(void) {
  return weak_n3() + 1;
}


x86 assembly (clang, -O0):
<call_weak_n3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <weak_n3@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_weak_n3>:
push   %rax
xor    %eax,%eax
call   1030 <weak_n3@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_weak_n3() section ".test.c" {
%1 = call i8* (...) @weak_n3()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_weak_n3() section ".test.c" {
%1 = tail call i8* (...) @weak_n3()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
int Operand_ars_entry_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0x3f) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_ars_entry_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xffffffc0,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_ars_entry_encode>:
xor    %eax,%eax
cmpl   $0x40,(%rdi)
setae  %al
ret

LLVM IR (-O0):
define i32 @Operand_ars_entry_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -64
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @Operand_ars_entry_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 63
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int nondet_int();
main() {
  int x = nondet_int();
  int y = nondet_int();
  if (y > 0) {
    while (x < 100) {
      x = x + y;
    }
  }
  assert(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    116f <main+0x4f>
jmp    1152 <main+0x32>
cmpl   $0x64,-0x8(%rbp)
jge    116a <main+0x4a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x32>
jmp    116f <main+0x4f>
xor    %edi,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <nondet_int@plt>
test   %eax,%eax
jle    1147 <main+0x27>
cmp    $0x63,%ebx
jg     1147 <main+0x27>
nopw   0x0(%rax,%rax,1)
add    %eax,%ebx
cmp    $0x64,%ebx
jl     1140 <main+0x20>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
%2 = tail call i32 (...) @nondet_int()
%3 = icmp sgt i32 %2, 0
%4 = icmp slt i32 %1, 100
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %1, %0 ]
%8 = add nsw i32 %7, %2
%9 = icmp slt i32 %8, 100
br i1 %9, label %6, label %10
10: ; preds = %6, %0
%11 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
long EINVAL;
long arch_ptrace(struct task_struct *child, long request, unsigned long addr,
                 unsigned long data) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<arch_ptrace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec3(%rip),%rcx
sub    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_ptrace>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%rax
ret

LLVM IR (-O0):
%struct.task_struct = type { i32 }
@EINVAL = global i64 0
define i64 @arch_ptrace(%struct.task_struct* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.task_struct*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store %struct.task_struct* %0, %struct.task_struct** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* @EINVAL
%10 = sub nsw i64 0, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
@EINVAL = global i64 0
define i64 @arch_ptrace(%struct.task_struct* nocapture readnone %0, i64 %1, i64 %2, i64 %3) {
%5 = load i64, i64* @EINVAL
%6 = sub nsw i64 0, %5
ret i64 %6
}