xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Reserved47_DriverIRQHandler();
__attribute__((weak)) void Reserved47_IRQHandler(void) {
  Reserved47_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved47_IRQHandler() {
%1 = call i32 (...) @Reserved47_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved47_IRQHandler() {
%1 = tail call i32 (...) @Reserved47_DriverIRQHandler()
ret void
}
int issentou(char a) {
  if (a >= 'a' && a <= 'z') {
    return 1;
  }
  if (a >= 'A' && a <= 'Z') {
    return 1;
  }
  if (a == '_') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<issentou>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <issentou+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <issentou+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1176 <issentou+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <issentou+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <issentou+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1176 <issentou+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    116f <issentou+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <issentou+0x76>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<issentou>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @issentou(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %27
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %27
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 95
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 1, i32* %2
br label %27
26: ; preds = %21
store i32 0, i32* %2
br label %27
27: ; preds = %26, %25, %20, %11
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @issentou(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
int scope_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @scope_shutdown() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CompileCondition();
int /*<<< orphan*/ ResetIf();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Custom(void) {
  WriteInstruction("ld b,CUSTOM");
  WriteInstruction("call tded");
  WriteInstruction("cp b");
  WriteInstruction("jp nz,      ");
  CompileCondition();
  ResetIf();
}


x86 assembly (clang, -O0):
<CR_Custom>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec5(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec3(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xebc(%rip),%rdi
call   1040 <WriteInstruction@plt>
mov    $0x0,%al
call   1050 <CompileCondition@plt>
mov    $0x0,%al
call   1030 <ResetIf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Custom>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec8(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec6(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xebf(%rip),%rdi
call   1040 <WriteInstruction@plt>
xor    %eax,%eax
call   1050 <CompileCondition@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ResetIf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"ld b,CUSTOM\00"
@.str.1 = [10 x i8] c"call tded\00"
@.str.2 = [5 x i8] c"cp b\00"
@.str.3 = [13 x i8] c"jp nz, \00"
define void @CR_Custom() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @WriteInstruction(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (...) @CompileCondition()
%6 = call i32 (...) @ResetIf()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"ld b,CUSTOM\00"
@.str.1 = [10 x i8] c"call tded\00"
@.str.2 = [5 x i8] c"cp b\00"
@.str.3 = [13 x i8] c"jp nz, \00"
define void @CR_Custom() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (...) @CompileCondition()
%6 = tail call i32 (...) @ResetIf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ signalFaultInterrupt();
void BusFaultISR() {
  signalFaultInterrupt();
  while (true) {
  }
}


x86 assembly (clang, -O0):
<BusFaultISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <signalFaultInterrupt@plt>
jmp    111b <BusFaultISR+0xb>

x86 assembly (clang, -O2):
<BusFaultISR>:
push   %rax
xor    %eax,%eax
call   1030 <signalFaultInterrupt@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <BusFaultISR+0x10>

LLVM IR (-O0):
define void @BusFaultISR() {
%1 = call i32 (...) @signalFaultInterrupt()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @BusFaultISR() {
%1 = tail call i32 (...) @signalFaultInterrupt()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EEPROMBlockHide(uint32_t ui32Block) {
  ;
  ;
  (*((volatile uint32_t *)(0x400AF050))) = (1 << ui32Block);
}


x86 assembly (clang, -O0):
<EEPROMBlockHide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400af050,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockHide>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400af050
ret

LLVM IR (-O0):
define void @EEPROMBlockHide(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
store volatile i32 %4, i32* inttoptr (i64 1074458704 to i32*)
ret void
}

LLVM IR (-O2):
define void @EEPROMBlockHide(i32 %0) {
%2 = shl nuw i32 1, %0
store volatile i32 %2, i32* inttoptr (i64 1074458704 to i32*)
ret void
}
int fibonacci(int n) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  else {
    int first = fibonacci(n - 2);
    int second = fibonacci(n - 1);
    return first + second;
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116c <fibonacci+0x5c>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116c <fibonacci+0x5c>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x2(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -2
%8 = tail call i32 @fibonacci(i32 %7)
%9 = add nsw i32 %4, -1
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *const);
void h(char *const input) {
  input[0] = 'H';
  printf("%s\n", input);
}


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

x86 assembly (clang, -O2):
<h>:
mov    %rdi,%rsi
movb   $0x48,(%rdi)
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @h(i8* %0) {
store i8 72, i8* %0
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
long func1();
int /*<<< orphan*/ printf(char *, long);
int main(int c, const char **argv) {
  long int x = func1();
  printf("%d\n", x);
  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)
mov    $0x0,%al
call   1030 <func1@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @func1()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}
/* Variables and functions */
void *pig_newseg(int);
int to_int(char const *);
void *int_to_voidp(const char *data, size_t *dsize) {
  void *retval = NULL;
  if (data == NULL || dsize == NULL) {
    return NULL;
  }
  retval = pig_newseg(sizeof(int));
  *dsize = sizeof(int);
  *(int *)retval = to_int(data);
  return retval;
}


x86 assembly (clang, -O0):
<int_to_voidp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <int_to_voidp+0x2e>
cmpq   $0x0,-0x18(%rbp)
jne    115b <int_to_voidp+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    118d <int_to_voidp+0x6d>
mov    $0x4,%edi
call   1040 <pig_newseg@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x4,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <to_int@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_voidp>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
test   %rdi,%rdi
je     1155 <int_to_voidp+0x35>
mov    %rsi,%r15
test   %rsi,%rsi
je     1155 <int_to_voidp+0x35>
mov    %rdi,%r14
mov    $0x4,%edi
call   1040 <pig_newseg@plt>
mov    %rax,%rbx
movq   $0x4,(%r15)
mov    %r14,%rdi
call   1030 <to_int@plt>
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @int_to_voidp(i8* %0, i64* writeonly %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i64* %1, null
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i8* @pig_newseg(i32 4)
store i64 4, i64* %1
%8 = tail call i32 @to_int(i8* %0)
%9 = bitcast i8* %7 to i32*
store i32 %8, i32* %9
br label %10
10: ; preds = %2, %6
%11 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  (void)printf("%s", "C Data Structures.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [19 x i8] c"C Data Structures.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [19 x i8] c"C Data Structures.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ doscmd(char *);
void mainCRTStartup(void) {
  char buf[4096 - 256];
  doscmd(buf);
}


x86 assembly (clang, -O0):
<mainCRTStartup>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf00,%rsp
lea    -0xf00(%rbp),%rdi
call   1030 <doscmd@plt>
add    $0xf00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainCRTStartup>:
sub    $0xf08,%rsp
mov    %rsp,%rdi
call   1030 <doscmd@plt>
add    $0xf08,%rsp
ret

LLVM IR (-O0):
define void @mainCRTStartup() {
%1 = alloca [3840 x i8]
%2 = getelementptr inbounds [3840 x i8], [3840 x i8]* %1, i64 0, i64 0
%3 = call i32 @doscmd(i8* %2)
ret void
}

LLVM IR (-O2):
define void @mainCRTStartup() {
%1 = alloca [3840 x i8]
%2 = getelementptr inbounds [3840 x i8], [3840 x i8]* %1, i64 0, i64 0
%3 = call i32 @doscmd(i8* %2)
ret void
}
int inter_sort_compare(const void *a, const void *b) {
  double aa = *(double *)a;
  double bb = *(double *)b;
  if (aa < bb)
    return -1;
  if (aa > bb)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<inter_sort_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <inter_sort_compare+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <inter_sort_compare+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <inter_sort_compare+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <inter_sort_compare+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_sort_compare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @inter_sort_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @inter_sort_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ mode_t;

/* Variables and functions */
scalar_t__ S_IFDIR;
scalar_t__ S_IFREG;
int supported_type(mode_t type) {
  if (type == S_IFDIR || type == S_IFREG) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<supported_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ebd(%rip),%rcx
cmp    (%rcx),%rax
je     1130 <supported_type+0x30>
mov    -0x10(%rbp),%rax
mov    0x2ec1(%rip),%rcx
cmp    (%rcx),%rax
jne    113c <supported_type+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <supported_type+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<supported_type>:
mov    0x2ec9(%rip),%rax
cmp    %rdi,(%rax)
sete   %al
mov    0x2ed4(%rip),%rcx
cmp    %rdi,(%rcx)
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@S_IFDIR = global i64 0
@S_IFREG = global i64 0
define i32 @supported_type(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = load i64, i64* @S_IFDIR
%6 = icmp eq i64 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i64, i64* %3
%9 = load i64, i64* @S_IFREG
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@S_IFDIR = global i64 0
@S_IFREG = global i64 0
define i32 @supported_type(i64 %0) {
%2 = load i64, i64* @S_IFDIR
%3 = icmp eq i64 %2, %0
%4 = load i64, i64* @S_IFREG
%5 = icmp eq i64 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int gltfmain(int argc, char *argv[]) {}


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

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

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

LLVM IR (-O2):
define i32 @gltfmain(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int median(int n, int hex) {
  printf("--\n");
  int i = hex;
  while (n % i != n)
    i *= hex;
  return i / hex;
}


x86 assembly (clang, -O0):
<median>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    -0x4(%rbp),%edx
je     114f <median+0x3f>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <median+0x20>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %ebx,%ecx
cmp    %ebp,%edx
je     113c <median+0x2c>
mov    %ebx,%ecx
imul   %ebx,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
cmp    %ebp,%edx
jne    1130 <median+0x20>
mov    %ecx,%eax
cltd
idiv   %ebx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"--\00"
define i32 @median(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%4 = srem i32 %0, %1
%5 = icmp eq i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %8, %6 ], [ %1, %2 ]
%8 = mul nsw i32 %7, %1
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = phi i32 [ %1, %2 ], [ %8, %6 ]
%13 = sdiv i32 %12, %1
ret i32 %13
}
/* Variables and functions */
int partition(int, int);
void quickSort(int low, int high) {
  int pivot;
  if (low <= high) {
    pivot = partition(low, high);
    quickSort(low, pivot - 1);
    quickSort(pivot + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1164 <quickSort+0x44>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <quickSort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <quickSort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jg     114e <quickSort+0x2e>
mov    %esi,%r14d
mov    %edi,%ebp
nopl   (%rax)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%esi
mov    %ebp,%edi
call   1040 <quickSort@plt>
lea    0x1(%rbx),%ebp
cmp    %r14d,%ebx
jl     1130 <quickSort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = tail call i32 @partition(i32 %5, i32 %1)
%7 = add nsw i32 %6, -1
tail call void @quickSort(i32 %5, i32 %7)
%8 = add nsw i32 %6, 1
%9 = icmp slt i32 %6, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RotShift_instr(int);
void SRA(void) { RotShift_instr(5); }


x86 assembly (clang, -O0):
<SRA>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <RotShift_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SRA>:
mov    $0x5,%edi
jmp    1030 <RotShift_instr@plt>

LLVM IR (-O0):
define void @SRA() {
%1 = call i32 @RotShift_instr(i32 5)
ret void
}

LLVM IR (-O2):
define void @SRA() {
%1 = tail call i32 @RotShift_instr(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x4c() {
  Assert_real((isascii(76)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              385, ("isascii should be 1 for L"));
}


x86 assembly (clang, -O0):
<t_isascii_0x4c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4c,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x181,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x4c>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x181,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for L\00"
define void @t_isascii_0x4c() {
%1 = call i32 @isascii(i32 76)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for L\00"
define void @t_isascii_0x4c() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned char readb(const volatile void *addr) {
  unsigned char ret;
  asm volatile("mov"
               "b"
               " %1,%0"
               : "=q"(ret)
               : "m"(*(volatile unsigned char *)addr)
               : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<readb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readb>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @readb(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8 asm sideeffect "movb $1,$0", "=q,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @readb(i8* %0) {
%2 = tail call i8 asm sideeffect "movb $1,$0", "=q,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int psector_Read_ISP_protocol_key(uint8_t key[16]) {
  int (*p_psector_Read_ISP_protocol_key)(uint8_t key[16]);
  p_psector_Read_ISP_protocol_key = (int (*)(uint8_t key[16]))0x03005355U;
  return p_psector_Read_ISP_protocol_key(key);
}


x86 assembly (clang, -O0):
<psector_Read_ISP_protocol_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3005355,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psector_Read_ISP_protocol_key>:
mov    $0x3005355,%eax
jmp    *%rax

LLVM IR (-O0):
define i32 @psector_Read_ISP_protocol_key(i32* %0) {
%2 = alloca i32*
%3 = alloca i32 (i32*)*
store i32* %0, i32** %2
store i32 (i32*)* inttoptr (i64 50352981 to i32 (i32*)*), i32 (i32*)** %3
%4 = load i32 (i32*)*, i32 (i32*)** %3
%5 = load i32*, i32** %2
%6 = call i32 %4(i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @psector_Read_ISP_protocol_key(i32* %0) {
%2 = tail call i32 inttoptr (i64 50352981 to i32 (i32*)*)(i32* %0)
ret i32 %2
}
__attribute__((section(".after_vectors"))) void IntDefaultHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<IntDefaultHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <IntDefaultHandler+0x9>
jmp    1109 <IntDefaultHandler+0x9>

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

LLVM IR (-O0):
define void @IntDefaultHandler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @IntDefaultHandler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int handle_clients(int list_s, int udpsock0) {
  int conn_s;
  if ((conn_s = accept(list_s, NULL, NULL)) < 0) {
    fprintf(stderr, "SERV: Error calling accept()\n");
    return -1;
  }
  return conn_s;
}


x86 assembly (clang, -O0):
<handle_clients>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1040 <accept@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    116a <handle_clients+0x4a>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <handle_clients+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_clients>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1040 <accept@plt>
test   %eax,%eax
js     1130 <handle_clients+0x10>
pop    %rcx
ret
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"SERV: Error calling accept()\0A\00"
define i32 @handle_clients(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = call i32 @accept(i32 %7, i32* null, i32* null)
store i32 %8, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
13: ; preds = %2
%14 = load i32, i32* %6
store i32 %14, i32* %3
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"SERV: Error calling accept()\0A\00"
define i32 @handle_clients(i32 %0, i32 %1) {
%3 = tail call i32 @accept(i32 %0, i32* null, i32* null)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %9
}
void baz_1() { printf("%s\n", __func__); }


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

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

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

LLVM IR (-O2):
@__func__.baz_1 = [6 x i8] c"baz_1\00"
define void @baz_1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.baz_1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, ...);
int writeValueToFile(char *, char *);
int unexportPin(unsigned int pin) {
  char fullPath[250];
  char fullValue[4];
  sprintf(fullPath, "/sys/class/gpio/unexport");
  sprintf(fullValue, "%u", pin);
  return writeValueToFile(fullPath, fullValue);
}


x86 assembly (clang, -O0):
<unexportPin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0x104(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0x100(%rbp),%rdi
lea    -0x104(%rbp),%rsi
call   1040 <writeValueToFile@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unexportPin>:
push   %rbx
sub    $0x110,%rsp
mov    %edi,%edx
movups 0xecf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xecc(%rip),%xmm0
movups %xmm0,0x19(%rsp)
lea    0xed0(%rip),%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <writeValueToFile@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.1 = [3 x i8] c"%u\00"
define i32 @unexportPin(i32 %0) {
%2 = alloca i32
%3 = alloca [250 x i8]
%4 = alloca [4 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%12 = call i32 @writeValueToFile(i8* %10, i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.1 = [3 x i8] c"%u\00"
define i32 @unexportPin(i32 %0) {
%2 = alloca [250 x i8]
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%7 = call i32 @writeValueToFile(i8* %4, i8* %5)
ret i32 %7
}
void g_list_find_custom() {}


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

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

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

LLVM IR (-O2):
define void @g_list_find_custom() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _ctap_eval_test_run();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void done_testing(void) { exit(_ctap_eval_test_run()); }


x86 assembly (clang, -O0):
<done_testing>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_ctap_eval_test_run@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<done_testing>:
push   %rax
xor    %eax,%eax
call   1030 <_ctap_eval_test_run@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @done_testing() {
%1 = call i32 (...) @_ctap_eval_test_run()
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
define void @done_testing() {
%1 = tail call i32 (...) @_ctap_eval_test_run()
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *newnode) {
  list_replace(old, newnode);
  INIT_LIST_HEAD(old);
}


x86 assembly (clang, -O0):
<list_replace_init>:
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   1040 <list_replace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_LIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ log_unix_error(char *);
int Bind(int sockfd, struct sockaddr *my_addr, int addrlen) {
  int rc;
  if ((rc = bind(sockfd, my_addr, addrlen)) < 0)
    log_unix_error("Bind error");
  return rc;
}


x86 assembly (clang, -O0):
<Bind>:
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   1040 <bind@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1159 <Bind+0x39>
lea    0xeac(%rip),%rdi
call   1030 <log_unix_error@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bind>:
push   %rbx
call   1040 <bind@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Bind+0x18>
lea    0xecd(%rip),%rdi
call   1030 <log_unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [11 x i8] c"Bind error\00"
define i32 @Bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @bind(i32 %8, %struct.sockaddr* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @log_unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [11 x i8] c"Bind error\00"
define i32 @Bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @log_unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mystery(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number;
  printf("\nEnter a number and... something .. will happen.. : ");
  scanf("%d", &number);
  mystery(number);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"\0AEnter a number and... something .. will happen.. : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @mystery(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"\0AEnter a number and... something .. will happen.. : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @mystery(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
int free1d(float **a, int n) {
  free(*a);
  return 0;
}


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

x86 assembly (clang, -O2):
<free1d>:
push   %rax
mov    (%rdi),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @free1d(float** nocapture %0, i32 %1) {
%3 = load float*, float** %0
%4 = tail call i32 @free(float* %3)
ret i32 0
}
/* Variables and functions */
unsigned long _decomp_exec_internal(unsigned char *, unsigned long,
                                    unsigned char *);
unsigned long decomp_exec(unsigned char *ind, unsigned long inl,
                          unsigned char *outd) {
  return _decomp_exec_internal(ind, inl, outd);
}


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

x86 assembly (clang, -O2):
<decomp_exec>:
jmp    1030 <_decomp_exec_internal@plt>

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

LLVM IR (-O2):
define i64 @decomp_exec(i8* %0, i64 %1, i8* %2) {
%4 = tail call i64 @_decomp_exec_internal(i8* %0, i64 %1, i8* %2)
ret i64 %4
}
int f(int a, int b) {
  a = (a & ~(0xfffu << 24)) | ((b << 24) & (0xfffu << 24));
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    -0x8(%rbp),%ecx
shl    $0x18,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
and    $0xffffff,%edi
shl    $0x18,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 16777215
%7 = load i32, i32* %4
%8 = shl i32 %7, 24
%9 = and i32 %8, -16777216
%10 = or i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = and i32 %0, 16777215
%4 = shl i32 %1, 24
%5 = or i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ c3(int);
void c2(int n) { c3(n); }


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

x86 assembly (clang, -O2):
<c2>:
jmp    1030 <c3@plt>

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

LLVM IR (-O2):
define void @c2(i32 %0) {
%2 = tail call i32 @c3(i32 %0)
ret void
}
void vbox_slirp_fprintf(void *ignored, char *format, ...) {}


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

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

LLVM IR (-O0):
define void @vbox_slirp_fprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @vbox_slirp_fprintf(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
void kpp_iomux_config(void) {}


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

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

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

LLVM IR (-O2):
define void @kpp_iomux_config() {
ret void
}