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

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void put_uint8(void *p, uint8_t x) { memcpy(p, (const void *)&x, sizeof(x)); }


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

x86 assembly (clang, -O2):
<put_uint8>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @put_uint8(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 = bitcast i32* %4 to i8*
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @put_uint8(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i8* %0, i8* %4, i32 4)
ret void
}
int (*y2(const int x[3][3]))[3] { return x; }


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

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

LLVM IR (-O0):
define [3 x i32]* @y2([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
%3 = load [3 x i32]*, [3 x i32]** %2
ret [3 x i32]* %3
}

LLVM IR (-O2):
define [3 x i32]* @y2([3 x i32]* readnone returned %0) {
ret [3 x i32]* %0
}
void PPP_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @PPP_IRQHandler() {
ret void
}
int isPrimo(long n) {
  int i, counter = 0;
  for (i = 2; i < n; i++) {
    if (n % i == 0) {
      counter++;
      break;
    }
  }
  return (counter == 0);
}


x86 assembly (clang, -O0):
<isPrimo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    115c <isPrimo+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1149 <isPrimo+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115c <isPrimo+0x5c>
jmp    114e <isPrimo+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <isPrimo+0x16>
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrimo>:
mov    $0x1,%eax
cmp    $0x3,%rdi
jl     1155 <isPrimo+0x55>
xor    %eax,%eax
test   $0x1,%dil
je     1155 <isPrimo+0x55>
mov    $0x3,%eax
jmp    112f <isPrimo+0x2f>
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
lea    0x1(%rcx),%rax
test   %rdx,%rdx
je     114d <isPrimo+0x4d>
mov    %rax,%rcx
cmp    %rax,%rdi
je     114d <isPrimo+0x4d>
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1120 <isPrimo+0x20>
mov    %rdi,%rax
cqto
idiv   %rcx
jmp    1126 <isPrimo+0x26>
xor    %eax,%eax
cmp    %rdi,%rcx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @isPrimo(i64 %0) {
%2 = icmp sgt i64 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = and i64 %0, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %9
%7 = phi i64 [ %12, %9 ], [ 3, %3 ]
%8 = icmp eq i64 %7, %0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = srem i64 %0, %7
%11 = icmp eq i64 %10, 0
%12 = add nuw nsw i64 %7, 1
br i1 %11, label %13, label %6
13: ; preds = %6, %9
%14 = icmp sge i64 %7, %0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %3, %1
%17 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int /*<<< orphan*/, char *, char *, char *, int);
void gmx_tx_wait(int nodeid) {
  fatal_error(0, "Routine %s called in %s, %d", "gmx_tx_wait",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/"
              "tests/test_07/network.c",
              88);
}


x86 assembly (clang, -O0):
<gmx_tx_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
lea    0xef1(%rip),%rdx
lea    0xef6(%rip),%rcx
mov    $0x58,%r8d
call   1030 <fatal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmx_tx_wait>:
lea    0xee9(%rip),%rsi
lea    0xefe(%rip),%rdx
lea    0xf03(%rip),%rcx
xor    %edi,%edi
mov    $0x58,%r8d
jmp    1030 <fatal_error@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [12 x i8] c"gmx_tx_wait\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define void @gmx_tx_wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 88)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [12 x i8] c"gmx_tx_wait\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define void @gmx_tx_wait(i32 %0) {
%2 = tail call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 88)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ input(char *, int);
char tolower(char);
uint8_t yesno(void) {
  char b[2];
  input(b, 2);
  if (tolower(*b) == 'y')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<yesno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x6(%rbp),%rdi
mov    $0x2,%esi
call   1030 <input@plt>
movsbl -0x6(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
cmp    $0x79,%eax
jne    1157 <yesno+0x37>
movl   $0x1,-0x4(%rbp)
jmp    115e <yesno+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yesno>:
push   %rax
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <input@plt>
movsbl 0x6(%rsp),%edi
call   1040 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x79,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yesno() {
%1 = alloca i32
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @input(i8* %3, i32 2)
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = call signext i8 @tolower(i8 signext %6)
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 121
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @yesno() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @input(i8* %2, i32 2)
%4 = load i8, i8* %2
%5 = call signext i8 @tolower(i8 signext %4)
%6 = icmp eq i8 %5, 121
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ rdp_update();
__attribute__((visibility("default"))) void ProcessRDPList(void) {
  rdp_update();
}


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

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

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

LLVM IR (-O2):
define void @ProcessRDPList() {
%1 = tail call i32 (...) @rdp_update()
ret void
}
AR0RX1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (p0[10000000]) = (p1[x1]); }


x86 assembly (clang, -O0):
<AR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x989680(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,1),%al
mov    %al,0x989680(%r8)
ret

LLVM IR (-O0):
define i32 @AR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %13
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %12
%22 = getelementptr inbounds i8, i8* %21, i64 10000000
store i8 %20, i8* %22
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @AR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %4, i64 10000000
store i8 %9, i8* %10
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Dynfree(void *name) { free(name); }


x86 assembly (clang, -O0):
<Dynfree>:
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):
<Dynfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @Dynfree(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 @Dynfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int bits_clrb(uint8_t *vec, size_t size, uint8_t bit) {
  if (size <= (bit >> 3)) {
    return -1;
  }
  *(vec + (bit >> 3)) &= (uint8_t)(~(1 << (bit & 0x07)));
  return 1;
}


x86 assembly (clang, -O0):
<bits_clrb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
ja     1131 <bits_clrb+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <bits_clrb+0x5b>
mov    -0x1c(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_clrb>:
mov    %edx,%eax
sar    $0x3,%eax
movslq %eax,%r8
mov    $0xffffffff,%eax
cmp    %rsi,%r8
jae    1127 <bits_clrb+0x27>
and    $0x7,%dl
mov    $0xfffffffe,%eax
mov    %edx,%ecx
rol    %cl,%eax
and    %eax,(%rdi,%r8,4)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_clrb(i32* nocapture %0, i64 %1, i32 %2) {
%4 = ashr i32 %2, 3
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, %1
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = and i32 %2, 7
%9 = shl nuw nsw i32 1, %8
%10 = xor i32 %9, -1
%11 = getelementptr inbounds i32, i32* %0, i64 %5
%12 = load i32, i32* %11
%13 = and i32 %12, %10
store i32 %13, i32* %11
br label %14
14: ; preds = %3, %7
%15 = phi i32 [ 1, %7 ], [ -1, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void warn(const char *msg) { printf("WARN: %s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"WARN: %s\0A\00"
define void @warn(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void rop3_171_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_171_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_171_1_1>:
mov    %edx,%eax
or     %sil,%al
not    %al
mov    (%rdi),%cl
and    %cl,%sil
or     %al,%sil
and    %dl,%cl
or     %sil,%cl
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_171_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %1
%8 = or i8 %7, %5
%9 = and i8 %6, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
void HplCC2430InterruptsC$InterruptCCA$fired(void) {
  HplCC2430InterruptsC$InterruptCCA$default$fired();
}


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

x86 assembly (clang, -O2):
<HplCC2430InterruptsC$InterruptCCA$fired>:
xor    %eax,%eax
jmp    1030 <HplCC2430InterruptsC$InterruptCCA$default$fired@plt>

LLVM IR (-O0):
define void @"HplCC2430InterruptsC$InterruptCCA$fired"() {
%1 = call i32 (...) @"HplCC2430InterruptsC$InterruptCCA$default$fired"()
ret void
}

LLVM IR (-O2):
define void @"HplCC2430InterruptsC$InterruptCCA$fired"() {
%1 = tail call i32 (...) @"HplCC2430InterruptsC$InterruptCCA$default$fired"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetGreenVideoBlackLevel(void *,
                                                                         int);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPRenderingControl_GetGreenVideoBlackLevel(void *upnptoken,
                                                  unsigned int InstanceID) {
  printf("Invoke: UPnPRenderingControl_GetGreenVideoBlackLevel(%u);\r\n",
         InstanceID);
  UPnPResponse_RenderingControl_GetGreenVideoBlackLevel(upnptoken, 250);
}


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

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetGreenVideoBlackLevel>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_GetGreenVideoBlackLevel@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_ftruncate_rsp *);
void stor_ftruncate_rsp_free(struct _stor_ftruncate_rsp *ptr) {
  osapi_free(ptr);
}


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

x86 assembly (clang, -O2):
<stor_ftruncate_rsp_free>:
jmp    1030 <osapi_free@plt>

LLVM IR (-O0):
%struct._stor_ftruncate_rsp = type { i32 }
define void @stor_ftruncate_rsp_free(%struct._stor_ftruncate_rsp* %0) {
%2 = alloca %struct._stor_ftruncate_rsp*
store %struct._stor_ftruncate_rsp* %0, %struct._stor_ftruncate_rsp** %2
%3 = load %struct._stor_ftruncate_rsp*, %struct._stor_ftruncate_rsp** %2
%4 = call i32 @osapi_free(%struct._stor_ftruncate_rsp* %3)
ret void
}

LLVM IR (-O2):
%struct._stor_ftruncate_rsp = type { i32 }
define void @stor_ftruncate_rsp_free(%struct._stor_ftruncate_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_ftruncate_rsp* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int Fib(int val) {
  printf("Fib(%d)\n", val);
  if (val < 2)
    return 1;
  return Fib(val - 1) + Fib(val - 2);
}


x86 assembly (clang, -O0):
<Fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jge    1150 <Fib+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1173 <Fib+0x53>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <Fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1040 <Fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fib>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xed3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%ebp
cmp    $0x2,%ebx
jl     1170 <Fib+0x50>
add    $0x2,%ebx
xor    %ebp,%ebp
lea    0xeb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1040 <Fib@plt>
lea    -0x4(%rbx),%esi
add    %eax,%ebp
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1150 <Fib+0x30>
add    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"Fib(%d)\0A\00"
define i32 @Fib(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp slt i32 %0, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %0, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = add nsw i32 %5, -1
%8 = tail call i32 @Fib(i32 %7)
%9 = add nsw i32 %5, -2
%10 = add nsw i32 %8, %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
%12 = icmp ult i32 %5, 4
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FreeChar1D(char *s) {
  if (s)
    free((void *)s);
  return;
}


x86 assembly (clang, -O0):
<FreeChar1D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <FreeChar1D+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeChar1D>:
test   %rdi,%rdi
je     111a <FreeChar1D+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @FreeChar1D(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CRYPTO_RWLOCK;

/* Variables and functions */
int /*<<< orphan*/ *OPENSSL_zalloc(int);
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void) {
  CRYPTO_RWLOCK *lock = OPENSSL_zalloc(sizeof(unsigned int));
  if (lock == NULL)
    return NULL;
  *(unsigned int *)lock = 1;
  return lock;
}


x86 assembly (clang, -O0):
<CRYPTO_THREAD_lock_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <OPENSSL_zalloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113e <CRYPTO_THREAD_lock_new+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    1150 <CRYPTO_THREAD_lock_new+0x40>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_THREAD_lock_new>:
push   %rax
mov    $0x4,%edi
call   1030 <OPENSSL_zalloc@plt>
test   %rax,%rax
je     1126 <CRYPTO_THREAD_lock_new+0x16>
movl   $0x1,(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
define i32* @CRYPTO_THREAD_lock_new() {
%1 = tail call i32* @OPENSSL_zalloc(i32 4)
%2 = icmp eq i32* %1, null
br i1 %2, label %4, label %3
3: ; preds = %0
store i32 1, i32* %1
br label %4
4: ; preds = %0, %3
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ func(int *, int);
int main(int argc, char *argv[]) {
  int a[4] = {0};
  func(a, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1040 <func@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <func@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [4 x i32]* %6 to i8*
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%9 = call i32 @func(i32* %8, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @func(i32* %5, i32 3)
ret i32 0
}
void VideoInitGlut() {}


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

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

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

LLVM IR (-O2):
define void @VideoInitGlut() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_scala_comment_entities();
void all_scala_tests() { test_scala_comment_entities(); }


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

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

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

LLVM IR (-O2):
define void @all_scala_tests() {
%1 = tail call i32 (...) @test_scala_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M41_f(char *s) {
  debug("M41_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M41_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M41_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M41_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M41_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M41_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M41_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int EXIT_FAILURE;
int getpid();
scalar_t__ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  while (printf("%d\n", getpid()))
    sleep(5);
  return EXIT_FAILURE;
}


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 <getpid@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
cmp    $0x0,%rax
je     1174 <main+0x44>
mov    $0x5,%edi
call   1050 <sleep@plt>
jmp    1146 <main+0x16>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %rax,%rax
je     1180 <main+0x50>
lea    0xeae(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x5,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %rax,%rax
jne    1160 <main+0x30>
mov    0x2e59(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_FAILURE = global i32 0
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
br label %6
6: ; preds = %10, %2
%7 = call i32 (...) @getpid()
%8 = call i64 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @sleep(i32 5)
br label %6
12: ; preds = %6
%13 = load i32, i32* @EXIT_FAILURE
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i64 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = tail call i32 @sleep(i32 5)
%8 = tail call i32 (...) @getpid()
%9 = tail call i64 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = load i32, i32* @EXIT_FAILURE
ret i32 %12
}
/* Variables and functions */
scalar_t__ malloc(int);
void f1(int *p) { p = (int *)malloc(sizeof(int)); }


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

x86 assembly (clang, -O2):
<f1>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @f1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
ret void
}

LLVM IR (-O2):
define void @f1(i32* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 4)
ret void
}
double ran01(long *idum) {
  long k;
  double ans;
  k = (*idum) / 127773;
  *idum = 16807 * (*idum - k * 127773) - 2836 * k;
  if (*idum < 0)
    *idum += 2147483647;
  ans = (1.0 / 2147483647) * (*idum);
  return ans;
}


x86 assembly (clang, -O0):
<ran01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x1f31d,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
imul   $0x1f31d,-0x10(%rbp),%rcx
sub    %rcx,%rax
imul   $0x41a7,%rax,%rcx
imul   $0xb14,-0x10(%rbp),%rax
sub    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jge    1167 <ran01+0x67>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x7fffffff,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xe88(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ran01>:
mov    (%rdi),%rcx
movabs $0x41a705af1fe3fb79,%rdx
05 a7 41
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xf,%rdx
add    %rax,%rdx
imul   $0xfffffffffffe0ce3,%rdx,%rax
add    %rcx,%rax
imul   $0x41a7,%rax,%rax
imul   $0xfffffffffffff4ec,%rdx,%rcx
lea    (%rax,%rcx,1),%rdx
add    $0x7fffffff,%rdx
add    %rcx,%rax
cmovns %rax,%rdx
mov    %rdx,(%rdi)
cvtsi2sd %rdx,%xmm0
mulsd  0xea5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ran01(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca double
store i64* %0, i64** %2
%5 = load i64*, i64** %2
%6 = load i64, i64* %5
%7 = sdiv i64 %6, 127773
store i64 %7, i64* %3
%8 = load i64*, i64** %2
%9 = load i64, i64* %8
%10 = load i64, i64* %3
%11 = mul nsw i64 %10, 127773
%12 = sub nsw i64 %9, %11
%13 = mul nsw i64 16807, %12
%14 = load i64, i64* %3
%15 = mul nsw i64 2836, %14
%16 = sub nsw i64 %13, %15
%17 = load i64*, i64** %2
store i64 %16, i64* %17
%18 = load i64*, i64** %2
%19 = load i64, i64* %18
%20 = icmp slt i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %1
%22 = load i64*, i64** %2
%23 = load i64, i64* %22
%24 = add nsw i64 %23, 2147483647
store i64 %24, i64* %22
br label %25
25: ; preds = %21, %1
%26 = load i64*, i64** %2
%27 = load i64, i64* %26
%28 = sitofp i64 %27 to double
%29 = fmul double 0x3E00000000200000, %28
store double %29, double* %4
%30 = load double, double* %4
ret double %30
}

LLVM IR (-O2):
define double @ran01(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = sdiv i64 %2, 127773
%4 = mul nsw i64 %3, -127773
%5 = add i64 %4, %2
%6 = mul nsw i64 %5, 16807
%7 = mul nsw i64 %3, -2836
%8 = add i64 %6, %7
%9 = icmp slt i64 %8, 0
%10 = add nsw i64 %8, 2147483647
%11 = select i1 %9, i64 %10, i64 %8
store i64 %11, i64* %0
%12 = sitofp i64 %11 to double
%13 = fmul double %12, 0x3E00000000200000
ret double %13
}
int pinmux_map_to_setting(struct pinctrl_map const *map,
                          struct pinctrl_setting *setting) {
  return 0;
}


x86 assembly (clang, -O0):
<pinmux_map_to_setting>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pinctrl_map = type opaque
%struct.pinctrl_setting = type opaque
define i32 @pinmux_map_to_setting(%struct.pinctrl_map* %0, %struct.pinctrl_setting* %1) {
%3 = alloca %struct.pinctrl_map*
%4 = alloca %struct.pinctrl_setting*
store %struct.pinctrl_map* %0, %struct.pinctrl_map** %3
store %struct.pinctrl_setting* %1, %struct.pinctrl_setting** %4
ret i32 0
}

LLVM IR (-O2):
%struct.pinctrl_map = type opaque
%struct.pinctrl_setting = type opaque
define i32 @pinmux_map_to_setting(%struct.pinctrl_map* nocapture readnone %0, %struct.pinctrl_setting* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int value = atoi(argv[1]);
  if (value < 16) {
    printf("0%X", value);
  } else {
    printf("%X", value);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1164 <main+0x44>
mov    -0x14(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <main+0x53>
mov    -0x14(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
cmp    $0x10,%eax
lea    0xecc(%rip),%rcx
lea    0xec6(%rip),%rdi
cmovl  %rcx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"0%X\00"
@.str.1 = [3 x i8] c"%X\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 16
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %19
16: ; preds = %2
%17 = load i32, i32* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"0%X\00"
@.str.1 = [3 x i8] c"%X\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = icmp slt i32 %5, 16
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* %7, i32 %5)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
void bs_unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @bs_unlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void QSValuesCleanup(char **const values, size_t const count) {
  for (size_t i = 0; i < count; ++i) {
    free(values[i]);
    values[i] = NULL;
  }
}


x86 assembly (clang, -O0):
<QSValuesCleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <QSValuesCleanup+0x58>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <QSValuesCleanup+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QSValuesCleanup>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     114a <QSValuesCleanup+0x3a>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
movq   $0x0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <QSValuesCleanup+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delayus(int);
void delayms(int ms) { delayus(ms * 1000); }


x86 assembly (clang, -O0):
<delayms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <delayus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayms>:
imul   $0x3e8,%edi,%edi
jmp    1030 <delayus@plt>

LLVM IR (-O0):
define void @delayms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @delayus(i32 %4)
ret void
}

LLVM IR (-O2):
define void @delayms(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @delayus(i32 %2)
ret void
}
void hal_debug_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_debug_enable() {
ret void
}
/* Variables and functions */
long double haversine_distance(long double *, long double *);
int _isInsideCircle(long double *p, long double *shock) {
  return haversine_distance(p, shock) < shock[2];
}


x86 assembly (clang, -O0):
<_isInsideCircle>:
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 <haversine_distance@plt>
mov    -0x10(%rbp),%rax
fldt   0x20(%rax)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isInsideCircle>:
push   %rbx
mov    %rsi,%rbx
call   1030 <haversine_distance@plt>
fldt   0x20(%rbx)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_isInsideCircle(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = call x86_fp80 @haversine_distance(x86_fp80* %5, x86_fp80* %6)
%8 = load x86_fp80*, x86_fp80** %4
%9 = getelementptr inbounds x86_fp80, x86_fp80* %8, i64 2
%10 = load x86_fp80, x86_fp80* %9
%11 = fcmp olt x86_fp80 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_isInsideCircle(x86_fp80* %0, x86_fp80* %1) {
%3 = tail call x86_fp80 @haversine_distance(x86_fp80* %0, x86_fp80* %1)
%4 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 2
%5 = load x86_fp80, x86_fp80* %4
%6 = fcmp olt x86_fp80 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void foo438() {}


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

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

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

LLVM IR (-O2):
define void @foo438() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int target_function(int);
int main() {
  int n = 100;
  printf("%d", target_function(n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @target_function(i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int /*<<< orphan*/, scalar_t__);
void smbus_setup(void) { outb(0, 0x1000 + 0); }


x86 assembly (clang, -O0):
<smbus_setup>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1000,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_setup>:
mov    $0x1000,%esi
xor    %edi,%edi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @smbus_setup() {
%1 = call i32 @outb(i32 0, i64 4096)
ret void
}

LLVM IR (-O2):
define void @smbus_setup() {
%1 = tail call i32 @outb(i32 0, i64 4096)
ret void
}