xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t bigEndian32(unsigned char b[]) {
  return ((int32_t)b[0] << 24) | ((int32_t)b[1] << 16) | ((int32_t)b[2] << 8) |
         (int32_t)b[3];
}


x86 assembly (clang, -O0):
<bigEndian32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigEndian32>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @bigEndian32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int big_calc4(int id) { return id * 2; }


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

x86 assembly (clang, -O2):
<big_calc4>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @big_calc4(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int findNextSpace(char *pString) {
  int i = 0;
  while ((*(pString + i) != 0) && (*(pString + i) != ' '))
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<findNextSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     113e <findNextSpace+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114e <findNextSpace+0x4e>
jmp    115c <findNextSpace+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <findNextSpace+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNextSpace>:
xor    %eax,%eax
testb  $0xdf,(%rdi,%rax,1)
je     111a <findNextSpace+0x1a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
testb  $0xdf,(%rdi,%rax,1)
jne    1110 <findNextSpace+0x10>
ret

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

LLVM IR (-O2):
define i32 @findNextSpace(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 32, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int irand(int /*<<< orphan*/, int);
int signrand() { return irand(0, 1) * 2 - 1; }


x86 assembly (clang, -O0):
<signrand>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <irand@plt>
shl    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signrand>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <irand@plt>
add    %eax,%eax
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @signrand() {
%1 = call i32 @irand(i32 0, i32 1)
%2 = mul nsw i32 %1, 2
%3 = sub nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @signrand() {
%1 = tail call i32 @irand(i32 0, i32 1)
%2 = shl nsw i32 %1, 1
%3 = add nsw i32 %2, -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printBuf(char **p, int n) {
  int i = 0;
  for (i = 0; i < n; i++) {
    printf("%s\n", p[i]);
  }
}


x86 assembly (clang, -O0):
<printBuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <printBuf+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <printBuf+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBuf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printBuf+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printBuf+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printBuf(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
unsigned int UARTCharPutNonBlocking(unsigned int baseAdd,
                                    unsigned char byteWrite) {
  unsigned int retVal = 0;
  if ((*((volatile unsigned int *)(baseAdd + (0x14)))) &
      ((0x00000040u) | (0x00000020u))) {
    (*((volatile unsigned int *)(baseAdd + (0x0)))) = byteWrite;
    retVal = 1;
  }
  return retVal;
}


x86 assembly (clang, -O0):
<UARTCharPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x60,%eax
cmp    $0x0,%eax
je     113f <UARTCharPutNonBlocking+0x3f>
movzbl -0x5(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPutNonBlocking>:
lea    0x14(%rdi),%eax
testl  $0x60,(%rax)
je     1119 <UARTCharPutNonBlocking+0x19>
movzbl %sil,%eax
mov    %edi,%ecx
mov    %eax,(%rcx)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @UARTCharPutNonBlocking(i32 %0, i8 zeroext %1) {
%3 = add i32 %0, 20
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 96
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = zext i8 %1 to i32
%11 = zext i32 %0 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %10, i32* %12
br label %13
13: ; preds = %9, %2
%14 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %14
}
long sum_even_fibonacci() {
  const long threshold = 4000000;
  long sum = 0;
  int prev = 2;
  int prev_prev = 1;
  while (prev <= threshold) {
    if (prev % 2 == 0) {
      sum += prev;
    }
    int next = prev + prev_prev;
    prev_prev = prev;
    prev = next;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum_even_fibonacci>:
push   %rbp
mov    %rsp,%rbp
movq   $0x3d0900,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x3d0900,%rax
jg     116c <sum_even_fibonacci+0x6c>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1152 <sum_even_fibonacci+0x52>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1122 <sum_even_fibonacci+0x22>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_even_fibonacci>:
mov    $0x2,%ecx
mov    $0x1,%edx
xor    %eax,%eax
nopl   0x0(%rax)
test   $0x1,%cl
mov    $0x0,%esi
cmove  %ecx,%esi
movslq %esi,%rsi
add    %rsi,%rax
mov    %edx,%esi
add    %ecx,%esi
mov    %ecx,%edx
mov    %esi,%ecx
cmp    $0x3d0901,%esi
jl     1110 <sum_even_fibonacci+0x10>
ret

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

LLVM IR (-O2):
define i64 @sum_even_fibonacci() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %9, %1 ]
%3 = phi i32 [ 1, %0 ], [ %4, %1 ]
%4 = phi i32 [ 2, %0 ], [ %10, %1 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 %4, i32 0
%8 = sext i32 %7 to i64
%9 = add nsw i64 %2, %8
%10 = add nsw i32 %3, %4
%11 = icmp slt i32 %10, 4000001
br i1 %11, label %1, label %12
12: ; preds = %1
ret i64 %9
}
/* Variables and functions */
int pt_iw_cmd_sn(int, char const *, int);
int pt_wrk_cmd(const char *s, int n) { return pt_iw_cmd_sn(1, s, n); }


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

x86 assembly (clang, -O2):
<pt_wrk_cmd>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <pt_iw_cmd_sn@plt>

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

LLVM IR (-O2):
define i32 @pt_wrk_cmd(i8* %0, i32 %1) {
%3 = tail call i32 @pt_iw_cmd_sn(i32 1, i8* %0, i32 %1)
ret i32 %3
}
unsigned int print_disasm_arm_instruction(unsigned int opcode) {
  unsigned int condition = opcode >> 28;
  switch ((opcode >> 25) & 0x07) {
  case 0x0:
  case 0x1:
  case 0x2:
  case 0x3:
  case 0x4:
  case 0x5:
  case 0x6:
  case 0x7:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_disasm_arm_instruction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1c,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x19,%eax
and    $0x7,%eax
sub    $0x7,%eax
ja     112c <print_disasm_arm_instruction+0x2c>
jmp    1127 <print_disasm_arm_instruction+0x27>
jmp    112c <print_disasm_arm_instruction+0x2c>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @print_disasm_arm_instruction(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 28
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = lshr i32 %6, 25
%8 = and i32 %7, 7
switch i32 %8, label %10 [
i32 0, label %9
i32 1, label %9
i32 2, label %9
i32 3, label %9
i32 4, label %9
i32 5, label %9
i32 6, label %9
i32 7, label %9
]
9: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
br label %10
10: ; preds = %1, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @print_disasm_arm_instruction(i32 %0) {
ret i32 0
}
void not_required_by_rtems(void) {}


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

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

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

LLVM IR (-O2):
define void @not_required_by_rtems() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int check_string(char *str) {
  if (NULL == str)
    return 0;
  if (0 == strcmp(str, ""))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1134 <check_string+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1165 <check_string+0x55>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    115e <check_string+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <check_string+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_string>:
test   %rdi,%rdi
je     1132 <check_string+0x22>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @check_string(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* null, %4
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 0, %9
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %13
12: ; preds = %7
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @check_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void free_matrix(int **matrix, int M, int N) {
  int i;
  for (i = 0; i < M; i++)
    free(matrix[i]);
  free(matrix);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <free_matrix+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <free_matrix+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int read_ppm_line(FILE *fp) {
  int i = 0;
  unsigned char ch;
  fread(&ch, 1, 1, fp);
  while (ch != '\n')
    fread(&ch, 1, 1, fp);
  return i;
}


x86 assembly (clang, -O0):
<read_ppm_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xd(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movzbl -0xd(%rbp),%eax
cmp    $0xa,%eax
je     115d <read_ppm_line+0x4d>
mov    -0x8(%rbp),%rcx
lea    -0xd(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
jmp    1137 <read_ppm_line+0x27>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ppm_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
cmpb   $0xa,0x7(%rsp)
je     115c <read_ppm_line+0x4c>
lea    0x7(%rsp),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
cmpb   $0xa,0x7(%rsp)
jne    1140 <read_ppm_line+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @read_ppm_line(i32* nocapture %0) {
%2 = alloca i8
%3 = call i32 @fread(i8* %2, i32 1, i32 1, i32* %0)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 10
br i1 %5, label %10, label %6
6: ; preds = %1, %6
%7 = call i32 @fread(i8* %2, i32 1, i32 1, i32* %0)
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %6
10: ; preds = %6, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigsetmask(int mask) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__sigsetmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sigsetmask>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__sigsetmask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__sigsetmask(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
void ccvt_yuyv_rgb32(int width, int height, const void *src, void *dst) {
  width = width;
  height = height;
  src = src;
  dst = dst;
}


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

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

LLVM IR (-O0):
define void @ccvt_yuyv_rgb32(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
store i32 %9, i32* %5
%10 = load i32, i32* %6
store i32 %10, i32* %6
%11 = load i8*, i8** %7
store i8* %11, i8** %7
%12 = load i8*, i8** %8
store i8* %12, i8** %8
ret void
}

LLVM IR (-O2):
define void @ccvt_yuyv_rgb32(i32 %0, i32 %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_36(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x15, 0x05, 0x08, 0x19, 0x02, 0x18, 0x1E, 0x07, 0x0D, 0x0C, 0x1A,
      0x06, 0x17, 0x03, 0x10, 0x09, 0x01, 0x11, 0x1C, 0x04, 0x0F, 0x1F,
      0x12, 0x0B, 0x1B, 0x13, 0x0A, 0x16, 0x0E, 0x00, 0x1D, 0x14,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_36>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_36>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_36.LUT = internal global [32 x i8] c"\15\05\08\19\02\18\1E\07\0D\0C\1A\06\17\03\10\09\01\11\1C\04\0F\1F\12\0B\1B\13\0A\16\0E\00\1D\14"
define i32 @yahoo_f01_36(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_36.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_36.LUT = internal global [32 x i8] c"\15\05\08\19\02\18\1E\07\0D\0C\1A\06\17\03\10\09\01\11\1C\04\0F\1F\12\0B\1B\13\0A\16\0E\00\1D\14"
define i32 @yahoo_f01_36(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_36.LUT, i64 0, i64 0))
ret i32 %3
}
int getCounterId(char *objectNameArg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getCounterId(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lcdhal_select();
int /*<<< orphan*/ lcdhal_write(int /*<<< orphan*/, int);
void lcd_startStream(void) {
  lcdhal_select();
  lcdhal_write(0, 0x2C);
}


x86 assembly (clang, -O0):
<lcd_startStream>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lcdhal_select@plt>
xor    %edi,%edi
mov    $0x2c,%esi
call   1030 <lcdhal_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_startStream>:
push   %rax
xor    %eax,%eax
call   1040 <lcdhal_select@plt>
xor    %edi,%edi
mov    $0x2c,%esi
pop    %rax
jmp    1030 <lcdhal_write@plt>

LLVM IR (-O0):
define void @lcd_startStream() {
%1 = call i32 (...) @lcdhal_select()
%2 = call i32 @lcdhal_write(i32 0, i32 44)
ret void
}

LLVM IR (-O2):
define void @lcd_startStream() {
%1 = tail call i32 (...) @lcdhal_select()
%2 = tail call i32 @lcdhal_write(i32 0, i32 44)
ret void
}
long __ocl_convert_long_float(float src) { return (long)src; }


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

x86 assembly (clang, -O2):
<__ocl_convert_long_float>:
cvttss2si %xmm0,%rax
ret

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

LLVM IR (-O2):
define i64 @__ocl_convert_long_float(float %0) {
%2 = fptosi float %0 to i64
ret i64 %2
}
void __attribute__((no)) rtld_db_dlactivity(void) {}


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

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

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

LLVM IR (-O2):
define void @rtld_db_dlactivity() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmd_mv_cp(int, char *, int);
void cmd_cp(int idx, char *par) { cmd_mv_cp(idx, par, 1); }


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

x86 assembly (clang, -O2):
<cmd_cp>:
mov    $0x1,%edx
jmp    1030 <cmd_mv_cp@plt>

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

LLVM IR (-O2):
define void @cmd_cp(i32 %0, i8* %1) {
%3 = tail call i32 @cmd_mv_cp(i32 %0, i8* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(char *, char *, int);
void bcopy2() {
  char src[] = {1, 2, 3, 4};
  char dst[1];
  bcopy(src, dst, 4);
}


x86 assembly (clang, -O0):
<bcopy2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x4,%edx
call   1030 <bcopy@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.bcopy2.src = [4 x i8] c"\01\02\03\04"
define void @bcopy2() {
%1 = alloca [4 x i8]
%2 = alloca [1 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%6 = call i32 @bcopy(i8* %4, i8* %5, i32 4)
ret void
}

LLVM IR (-O2):
define void @bcopy2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ box_boolean(int);
int /*<<< orphan*/ dpop();
double untag_float_fast(int /*<<< orphan*/);
void primitive_float_lesseq_impl(void) {
  double y = untag_float_fast(dpop());
  double x = untag_float_fast(dpop());
  ;
  box_boolean(x <= y);
}


x86 assembly (clang, -O0):
<primitive_float_lesseq_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <box_boolean@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_lesseq_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
xor    %edi,%edi
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %dil
pop    %rax
jmp    1040 <box_boolean@plt>

LLVM IR (-O0):
define void @primitive_float_lesseq_impl() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @dpop()
%4 = call double @untag_float_fast(i32 %3)
store double %4, double* %1
%5 = call i32 (...) @dpop()
%6 = call double @untag_float_fast(i32 %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = load double, double* %1
%9 = fcmp ole double %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @box_boolean(i32 %10)
ret void
}

LLVM IR (-O2):
define void @primitive_float_lesseq_impl() {
%1 = tail call i32 (...) @dpop()
%2 = tail call double @untag_float_fast(i32 %1)
%3 = tail call i32 (...) @dpop()
%4 = tail call double @untag_float_fast(i32 %3)
%5 = fcmp ole double %4, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @box_boolean(i32 %6)
ret void
}
/* Type definitions */
struct geo {
  int dummy;
};

/* Variables and functions */
double arc_in_radians(struct geo const *, struct geo const *);
float distance_in_metres(const struct geo *from, const struct geo *to) {
  return 6372797.560856 * arc_in_radians(from, to);
}


x86 assembly (clang, -O0):
<distance_in_metres>:
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 <arc_in_radians@plt>
movaps %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_in_metres>:
push   %rax
call   1030 <arc_in_radians@plt>
mulsd  0xee2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.geo = type { i32 }
define float @distance_in_metres(%struct.geo* %0, %struct.geo* %1) {
%3 = alloca %struct.geo*
%4 = alloca %struct.geo*
store %struct.geo* %0, %struct.geo** %3
store %struct.geo* %1, %struct.geo** %4
%5 = load %struct.geo*, %struct.geo** %3
%6 = load %struct.geo*, %struct.geo** %4
%7 = call double @arc_in_radians(%struct.geo* %5, %struct.geo* %6)
%8 = fmul double 0x41584F6F63E51090, %7
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
%struct.geo = type { i32 }
define float @distance_in_metres(%struct.geo* %0, %struct.geo* %1) {
%3 = tail call double @arc_in_radians(%struct.geo* %0, %struct.geo* %1)
%4 = fmul double %3, 0x41584F6F63E51090
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("e"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x65,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 101)
ret i32 0
}
const char *get_type_string(char lan_type) {
  switch (lan_type) {
  case 0x00:
    return "<Unspecified>";
  case 0x01:
    return "802.3";
  case 0x02:
    return "802.5";
  default:
    return "UNKNOWN TYPE";
  }
}


x86 assembly (clang, -O0):
<get_type_string>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1140 <get_type_string+0x40>
jmp    111e <get_type_string+0x1e>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1150 <get_type_string+0x50>
jmp    112f <get_type_string+0x2f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1160 <get_type_string+0x60>
jmp    1170 <get_type_string+0x70>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <get_type_string+0x7b>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <get_type_string+0x7b>
lea    0xead(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <get_type_string+0x7b>
lea    0xea3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_type_string>:
cmp    $0x2,%dil
ja     1119 <get_type_string+0x19>
movsbq %dil,%rax
lea    0xf17(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xefa(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"<Unspecified>\00"
@.str.1 = [6 x i8] c"802.3\00"
@.str.2 = [6 x i8] c"802.5\00"
@.str.3 = [13 x i8] c"UNKNOWN TYPE\00"
define i8* @get_type_string(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
]
6: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"<Unspecified>\00"
@.str.1 = [6 x i8] c"802.3\00"
@.str.2 = [6 x i8] c"802.5\00"
@.str.3 = [13 x i8] c"UNKNOWN TYPE\00"
@reltable.get_type_string = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.get_type_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.get_type_string to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.get_type_string to i64)) to i32)]
define i8* @get_type_string(i8 signext %0) {
%2 = icmp ult i8 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.get_type_string to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
const char *get_command_line() { return ""; }


x86 assembly (clang, -O0):
<get_command_line>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_command_line>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_command_line() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_command_line() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int RAND_MAX;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", RAND_MAX);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@RAND_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @RAND_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int cairo_code_draw_envfollowerbg_get_width() { return 603; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envfollowerbg_get_width() {
ret i32 603
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envfollowerbg_get_width() {
ret i32 603
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int writeStrToFd(int fd, char *str) { return write(fd, str, strlen(str)); }


x86 assembly (clang, -O0):
<writeStrToFd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeStrToFd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @writeStrToFd(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
int ddcl_FileIsAbsolutePath(const char *path) { return path[0] == '/'; }


x86 assembly (clang, -O0):
<ddcl_FileIsAbsolutePath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddcl_FileIsAbsolutePath>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @ddcl_FileIsAbsolutePath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ddcl_FileIsAbsolutePath(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int main() {
  volatile char *arr = malloc(10 * sizeof(char));
  arr[5] = 'a';
  arr[4] = 'b';
  return arr[5] + arr[4];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x61,0x5(%rax)
mov    -0x10(%rbp),%rax
movb   $0x62,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x5(%rax),%al
movsbl %al,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%cl
movsbl %cl,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
movb   $0x61,0x5(%rax)
movb   $0x62,0x4(%rax)
movsbl 0x5(%rax),%ecx
movsbl 0x4(%rax),%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 5
store volatile i8 97, i8* %5
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 4
store volatile i8 98, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 5
%10 = load volatile i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 4
%14 = load volatile i8, i8* %13
%15 = sext i8 %14 to i32
%16 = add nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = getelementptr inbounds i8, i8* %1, i64 5
store volatile i8 97, i8* %2
%3 = getelementptr inbounds i8, i8* %1, i64 4
store volatile i8 98, i8* %3
%4 = load volatile i8, i8* %2
%5 = sext i8 %4 to i32
%6 = load volatile i8, i8* %3
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isdigit(int);
void t_isdigit_0x31() {
  Assert_real((isdigit(49)),
              "/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_isdigit.c",
              250, ("isdigit should be 1 for 1"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x31>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xfa,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 1\00"
define void @t_isdigit_0x31() {
%1 = call i32 @isdigit(i32 49)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 250, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 1 for 1\00"
define void @t_isdigit_0x31() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xe9() {
  Assert_real((isalpha(233) == 0),
              "/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_isalpha.c",
              1170, ("isalpha should be 0 for 0xe9"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xe9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe9,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x492,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xe9>:
push   %rax
mov    $0xe9,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x492,%edx
pop    %rax
jmp    1040 <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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xe9\00"
define void @t_isalpha_0xe9() {
%1 = call i64 @isalpha(i32 233)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([29 x i8], [29 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xe9\00"
define void @t_isalpha_0xe9() {
%1 = tail call i64 @isalpha(i32 233)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void arg_longlong3(long long x, long long y, long long z) {}


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

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

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

LLVM IR (-O2):
define void @arg_longlong3(i64 %0, i64 %1, i64 %2) {
ret void
}