xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fib_gmp(int);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int a = (argc > 1 ? (int)strtol(argv[1], NULL, 0) : 92);
  fib_gmp(a);
  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)
cmpl   $0x1,-0x8(%rbp)
jle    115b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x18(%rbp)
jmp    1168 <main+0x48>
mov    $0x5c,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <main+0x48>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fib_gmp@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x5c,%edi
cmp    $0x2,%eax
jl     113d <main+0x1d>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,%rdi
call   1040 <fib_gmp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strtol(i8* %12, i32* null, i32 0)
%14 = trunc i64 %13 to i32
br label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %9
%17 = phi i32 [ %14, %9 ], [ 92, %15 ]
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @fib_gmp(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strtol(i8* nocapture %6, i32* null, i32 0)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 92, %2 ]
%11 = tail call i32 @fib_gmp(i32 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void mmio_write_16(uintptr_t addr, uint16_t value) {
  *(volatile uint16_t *)addr = value;
}


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

x86 assembly (clang, -O2):
<mmio_write_16>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mmio_write_16(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @mmio_write_16(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
void mtarch_pstop(void) {}


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

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

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

LLVM IR (-O2):
define void @mtarch_pstop() {
ret void
}
void VMStringCopy(char *dest, const char *src) {
  while (*src) {
    *dest++ = *src++;
  }
  *dest = '\0';
}


x86 assembly (clang, -O0):
<VMStringCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <VMStringCopy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <VMStringCopy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VMStringCopy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <VMStringCopy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <VMStringCopy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @VMStringCopy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
void irqCallback() {}


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

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

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

LLVM IR (-O2):
define void @irqCallback() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printReport(uint32_t numTests, uint32_t numErrors) {
  printf("==========================\n");
  printf("number of tests:        %d\n", numTests);
  printf("number of errors:       %d\n\n", numErrors);
}


x86 assembly (clang, -O0):
<printReport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printReport>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [28 x i8] c"number of tests: %d\0A\00"
@.str.2 = [29 x i8] c"number of errors: %d\0A\0A\00"
@str = [27 x i8] c"==========================\00"
define void @printReport(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret void
}
void cafebabe_source_file_attribute_deinit(
    struct cafebabe_source_file_attribute *a) {}


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

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

LLVM IR (-O0):
%struct.cafebabe_source_file_attribute = type opaque
define void @cafebabe_source_file_attribute_deinit(%struct.cafebabe_source_file_attribute* %0) {
%2 = alloca %struct.cafebabe_source_file_attribute*
store %struct.cafebabe_source_file_attribute* %0, %struct.cafebabe_source_file_attribute** %2
ret void
}

LLVM IR (-O2):
%struct.cafebabe_source_file_attribute = type opaque
define void @cafebabe_source_file_attribute_deinit(%struct.cafebabe_source_file_attribute* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, int);
long factorial(int n) {
  long result;
  if (n == 0 || n == 1) {
    result = 1;
  } else {
    result = factorial(n - 1) * n;
    printf("result: %ld n: %d \n", result, n);
  }
  return result;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <factorial+0x1f>
cmpl   $0x1,-0x4(%rbp)
jne    114c <factorial+0x2c>
movq   $0x1,-0x10(%rbp)
jmp    1176 <factorial+0x56>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
movslq -0x4(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x1,%edi
jbe    1153 <factorial+0x33>
mov    %edi,%r14d
lea    -0x1(%r14),%edi
call   1030 <factorial@plt>
movslq %r14d,%rbx
imul   %rax,%rbx
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"result: %ld n: %d \0A\00"
define i64 @factorial(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %9, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i64 @factorial(i32 %6)
%8 = sext i32 %0 to i64
%9 = mul nsw i64 %7, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %9, i32 %0)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *realloc(void *, size_t);
void *h2o_mem_realloc(void *oldp, size_t sz) {
  void *newp = realloc(oldp, sz);
  if (newp == NULL) {
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/rayrapetyan/h2o/refs/heads/"
               "master/include/h2o/memory.h"
               ":"
               "343"
               ":"
               "no memory");
    return oldp;
  }
  return newp;
}


x86 assembly (clang, -O0):
<h2o_mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <h2o_mem_realloc+0x45>
lea    0xead(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <h2o_mem_realloc+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_realloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1130 <h2o_mem_realloc+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rayrapetyan/h2o/refs/heads/master/include/h2o/memory.h:343:no memory\00"
define i8* @h2o_mem_realloc(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
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @h2o__fatal(i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rayrapetyan/h2o/refs/heads/master/include/h2o/memory.h:343:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %0, %5 ], [ %3, %2 ]
ret i8* %8
}
int compare_pointer_values(const void *a, const void *b) {
  if (a < b)
    return -1;
  else if (a == b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compare_pointer_values>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1126 <compare_pointer_values+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <compare_pointer_values+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1140 <compare_pointer_values+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1147 <compare_pointer_values+0x47>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_pointer_values>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_pointer_values(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
struct tokens {
  int dummy;
};
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ stdout;
int cmd_pwd(struct tokens *tokens) {
  char cwd[1024];
  if (getcwd(cwd, sizeof(cwd)) != NULL)
    fprintf(stdout, "%s\n", cwd);
  return 1;
}


x86 assembly (clang, -O0):
<cmd_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1030 <getcwd@plt>
cmp    $0x0,%rax
je     1166 <cmd_pwd+0x46>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_pwd>:
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1030 <getcwd@plt>
test   %rax,%rax
je     1151 <cmd_pwd+0x31>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    %rsp,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%eax
add    $0x408,%rsp
ret

LLVM IR (-O0):
%struct.tokens = type { i32 }
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @cmd_pwd(%struct.tokens* %0) {
%2 = alloca %struct.tokens*
%3 = alloca [1024 x i8]
store %struct.tokens* %0, %struct.tokens** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32* @getcwd(i8* %4, i32 1024)
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stdout
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %1
ret i32 1
}

LLVM IR (-O2):
%struct.tokens = type { i32 }
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @cmd_pwd(%struct.tokens* nocapture readnone %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32* @getcwd(i8* %3, i32 1024)
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @stdout
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %9
9: ; preds = %6, %1
ret i32 1
}
function2() {}


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

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

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

LLVM IR (-O2):
define i32 @function2() {
ret i32 undef
}
int traceval(nam, val)
char *nam, *val;
{
  if (val)
    printf(">>> %s: \"%s\"\n", nam, val);
  else
    printf(">>> %s: (undef)\n", nam);
  return (0);
}


x86 assembly (clang, -O0):
<traceval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <traceval+0x36>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1158 <traceval+0x48>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traceval>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
test   %rdx,%rdx
je     112c <traceval+0x1c>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    113a <traceval+0x2a>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c">>> %s: \22%s\22\0A\00"
@.str.1 = [17 x i8] c">>> %s: (undef)\0A\00"
define i32 @traceval(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
br label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c">>> %s: \22%s\22\0A\00"
@.str.1 = [17 x i8] c">>> %s: (undef)\0A\00"
define i32 @traceval(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
ret i32 0
}
void INT_Excep_PERIB_INTB170(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB170() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ place;
};
struct TYPE_4__ {
  TYPE_1__ xcirculaterequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcirculaterequest_place(void *_p) {
  return (int)((XEvent *)_p)->xcirculaterequest.place;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xcirculaterequest_place(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main1() {
  int i, j;
  int ia[16];
  for (j = 0, i = 16; j<16, i> 0; i--, j++) {
    ia[j] = i;
  }
  for (j = 0, i = 16; j<16, i> 0; i--, j++) {
    if (ia[j] != i)
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x10,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1152 <main1+0x42>
mov    -0x4(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main1+0x16>
movl   $0x0,-0x8(%rbp)
movl   $0x10,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    119e <main1+0x8e>
movslq -0x8(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
cmp    -0x4(%rbp),%eax
je     1182 <main1+0x72>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1187 <main1+0x77>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1160 <main1+0x50>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [16 x i32]
store i32 0, i32* %2
store i32 16, i32* %1
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 16
%7 = zext i1 %6 to i32
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %4
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 %13
store i32 %11, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %1
%17 = add nsw i32 %16, -1
store i32 %17, i32* %1
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %4
20: ; preds = %4
store i32 0, i32* %2
store i32 16, i32* %1
br label %21
21: ; preds = %37, %20
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 16
%24 = zext i1 %23 to i32
%25 = load i32, i32* %1
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %42
27: ; preds = %21
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %1
%33 = icmp ne i32 %31, %32
br i1 %33, label %34, label %36
34: ; preds = %27
%35 = call i32 (...) @abort()
unreachable
36: ; preds = %27
br label %37
37: ; preds = %36
%38 = load i32, i32* %1
%39 = add nsw i32 %38, -1
store i32 %39, i32* %1
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %21
42: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
define i32 @main1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "Usage: %s [-G group,group,...] [-g group] "
                "[-u user] newroot [command]\n",
                getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [71 x i8] c"Usage: %s [-G group,group,...] [-g group] [-u user] newroot [command]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [71 x i8] c"Usage: %s [-G group,group,...] [-g group] [-u user] newroot [command]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ flipTile(unsigned int *, unsigned int *, int, int);
int /*<<< orphan*/ memcmp(unsigned int *, unsigned int *, int);
int isSameTile1(unsigned int *t1, unsigned int *t2, int hflip, int vflip) {
  unsigned int tile[8];
  flipTile(t1, tile, hflip, vflip);
  if (!memcmp(t1, t2, 8 * 4))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<isSameTile1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <flipTile@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    1170 <isSameTile1+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1177 <isSameTile1+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSameTile1>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1040 <flipTile@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @isSameTile1(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [8 x i32]
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32*, i32** %6
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %10, i64 0, i64 0
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = call i32 @flipTile(i32* %11, i32* %12, i32 %13, i32 %14)
%16 = load i32*, i32** %6
%17 = load i32*, i32** %7
%18 = call i32 @memcmp(i32* %16, i32* %17, i32 32)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %4
store i32 1, i32* %5
br label %22
21: ; preds = %4
store i32 0, i32* %5
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @isSameTile1(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca [8 x i32]
%6 = bitcast [8 x i32]* %5 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%8 = call i32 @flipTile(i32* %0, i32* %7, i32 %2, i32 %3)
%9 = call i32 @memcmp(i32* %0, i32* %1, i32 32)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int sc_write_to_socket(int socket, char *message) {
  int bytes_written;
  bytes_written = write(socket, message, strlen(message));
  return bytes_written;
}


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

x86 assembly (clang, -O2):
<sc_write_to_socket>:
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 @sc_write_to_socket(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @write(i32 %6, i8* %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @sc_write_to_socket(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
}
/* Variables and functions */
int /*<<< orphan*/ printByte(unsigned short);
int /*<<< orphan*/ printStr(char *);
void printShort(unsigned short c) {
  printStr("0x");
  printByte((c & 0xff00) >> 8);
  printByte(c & 0xff);
}


x86 assembly (clang, -O0):
<printShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printStr@plt>
movzwl -0x2(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movzwl %ax,%edi
call   1040 <printByte@plt>
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
movzwl %ax,%edi
call   1040 <printByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printShort>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <printStr@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1040 <printByte@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1040 <printByte@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"0x\00"
define void @printShort(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @printStr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i16
%9 = call i32 @printByte(i16 zeroext %8)
%10 = load i16, i16* %2
%11 = zext i16 %10 to i32
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i16
%14 = call i32 @printByte(i16 zeroext %13)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"0x\00"
define void @printShort(i16 zeroext %0) {
%2 = tail call i32 @printStr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = lshr i16 %0, 8
%4 = tail call i32 @printByte(i16 zeroext %3)
%5 = and i16 %0, 255
%6 = tail call i32 @printByte(i16 zeroext %5)
ret void
}
unsigned int le32toh(unsigned int val) {
  return (val & 0xff) << 24 | (val & 0xff00) << 8 | (val & 0xff0000) >> 8 |
         (val & 0xff000000) >> 24;
}


x86 assembly (clang, -O0):
<le32toh>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @le32toh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @le32toh(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void read_gll_model_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @read_gll_model_adios_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ grava_li(int, char *);
void rot17_sem() { grava_li(1, "$UNTIL"); }


x86 assembly (clang, -O0):
<rot17_sem>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <grava_li@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot17_sem>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <grava_li@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"$UNTIL\00"
define void @rot17_sem() {
%1 = call i32 @grava_li(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"$UNTIL\00"
define void @rot17_sem() {
%1 = tail call i32 @grava_li(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strverscmp(int /*<<< orphan*/, int /*<<< orphan*/);
int version_sort(const struct dirent **d1, const struct dirent **d2) {
  return strverscmp((*d1)->d_name, (*d2)->d_name);
}


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

x86 assembly (clang, -O2):
<version_sort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strverscmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @version_sort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %4
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strverscmp(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @version_sort(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %0
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %1
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strverscmp(i32 %5, i32 %8)
ret i32 %9
}
int foo_answer() { return 42; }


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

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

LLVM IR (-O0):
define i32 @foo_answer() {
ret i32 42
}

LLVM IR (-O2):
define i32 @foo_answer() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void displayDescription(void) {
  printf("Array Demo\n");
  printf("This program will give a simple overview on how to declare and\n");
  printf("manipulate an array and a two dimensional array.\n");
}


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

x86 assembly (clang, -O2):
<displayDescription>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Array Demo\0A\00"
@.str.1 = [64 x i8] c"This program will give a simple overview on how to declare and\0A\00"
@.str.2 = [50 x i8] c"manipulate an array and a two dimensional array.\0A\00"
define void @displayDescription() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"Array Demo\00"
@str.3 = [63 x i8] c"This program will give a simple overview on how to declare and\00"
@str.4 = [49 x i8] c"manipulate an array and a two dimensional array.\00"
define void @displayDescription() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
bool support_gpt(void) {
  int fd = open("/dev/block/platform/mtk-msdc.0/by-name/para", O_RDONLY);
  if (fd == -1) {
    return false;
  } else {
    close(fd);
    return true;
  }
}


x86 assembly (clang, -O0):
<support_gpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1156 <support_gpt+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1165 <support_gpt+0x45>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<support_gpt>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1149 <support_gpt+0x29>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"/dev/block/platform/mtk-msdc.0/by-name/para\00"
@O_RDONLY = global i32 0
define i32 @support_gpt() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @close(i32 %9)
store i32 1, i32* %1
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [44 x i8] c"/dev/block/platform/mtk-msdc.0/by-name/para\00"
@O_RDONLY = global i32 0
define i32 @support_gpt() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ 1, %4 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_IREG_B_REG(int inv, int r1, int r2) { C67_asm("B.S2", inv, r1, r2); }


x86 assembly (clang, -O0):
<C67_IREG_B_REG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_IREG_B_REG>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <C67_asm@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"B.S2\00"
define void @C67_IREG_B_REG(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @C67_asm(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FH_DU();
int /*<<< orphan*/ init();
int /*<<< orphan*/ interface();
int main(void) {
  unsigned int i;
  for (i = 0; i < 106; i++) {
    init();
    interface();
    FH_DU();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6a,-0x8(%rbp)
jae    1173 <main+0x43>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <interface@plt>
mov    $0x0,%al
call   1050 <FH_DU@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x6a,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <interface@plt>
xor    %eax,%eax
call   1050 <FH_DU@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 106
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = call i32 (...) @init()
%8 = call i32 (...) @interface()
%9 = call i32 (...) @FH_DU()
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @interface()
%5 = tail call i32 (...) @FH_DU()
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 106
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_usage() {
  fprintf(stdout, "usage:\n"
                  " --host, -h    default host is localhost\n"
                  " --port, -p    default port is 8088\n"
                  " --verbose, -v\n");
  exit(255);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [100 x i8] c"usage:\0A --host, -h default host is localhost\0A --port, -p default port is 8088\0A --verbose, -v\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [100 x i8] c"usage:\0A --host, -h default host is localhost\0A --port, -p default port is 8088\0A --verbose, -v\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 255)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_EXTENSION;
typedef int /*<<< orphan*/ X509V3_EXT_METHOD;

/* Variables and functions */
int NID_undef;
int OBJ_obj2nid(int /*<<< orphan*/);
int /*<<< orphan*/ const *X509V3_EXT_get_nid(int);
int /*<<< orphan*/ X509_EXTENSION_get_object(int /*<<< orphan*/ *);
const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) {
  int nid;
  if ((nid = OBJ_obj2nid(X509_EXTENSION_get_object(ext))) == NID_undef)
    return NULL;
  return X509V3_EXT_get_nid(nid);
}


x86 assembly (clang, -O0):
<X509V3_EXT_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <X509_EXTENSION_get_object@plt>
mov    %eax,%edi
call   1030 <OBJ_obj2nid@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
jne    116b <X509V3_EXT_get+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1177 <X509V3_EXT_get+0x47>
mov    -0x14(%rbp),%edi
call   1050 <X509V3_EXT_get_nid@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509V3_EXT_get>:
push   %rax
call   1040 <X509_EXTENSION_get_object@plt>
mov    %eax,%edi
call   1030 <OBJ_obj2nid@plt>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
jne    114c <X509V3_EXT_get+0x1c>
xor    %eax,%eax
pop    %rcx
ret
mov    %eax,%edi
pop    %rax
jmp    1050 <X509V3_EXT_get_nid@plt>

LLVM IR (-O0):
@NID_undef = global i32 0
define i32* @X509V3_EXT_get(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @X509_EXTENSION_get_object(i32* %5)
%7 = call i32 @OBJ_obj2nid(i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* @NID_undef
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32* null, i32** %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32* @X509V3_EXT_get_nid(i32 %12)
store i32* %13, i32** %2
br label %14
14: ; preds = %11, %10
%15 = load i32*, i32** %2
ret i32* %15
}

LLVM IR (-O2):
@NID_undef = global i32 0
define i32* @X509V3_EXT_get(i32* %0) {
%2 = tail call i32 @X509_EXTENSION_get_object(i32* %0)
%3 = tail call i32 @OBJ_obj2nid(i32 %2)
%4 = load i32, i32* @NID_undef
%5 = icmp eq i32 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32* @X509V3_EXT_get_nid(i32 %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32* [ %7, %6 ], [ null, %1 ]
ret i32* %9
}