xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void timeval_to_timespec(struct timespec *left, const struct timeval *right) {
  left->tv_sec = right->tv_sec;
  left->tv_nsec = 1000 * right->tv_usec;
}


x86 assembly (clang, -O0):
<timeval_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
imul   $0x3e8,(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_timespec>:
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
imul   $0x3e8,(%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define void @timeval_to_timespec(%struct.timespec* %0, %struct.timeval* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timeval*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
store i32 %7, i32* %9
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = mul nsw i32 1000, %12
%14 = load %struct.timespec*, %struct.timespec** %3
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 0
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
%struct.timeval = type { i32, i32 }
define void @timeval_to_timespec(%struct.timespec* nocapture writeonly %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cwrapper_q_sortrev_float(float *, int /*<<< orphan*/, int);
void quicksortrev_float_(float numbers[], int *array_size) {
  cwrapper_q_sortrev_float(numbers, 0, (*array_size) - 1);
}


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

x86 assembly (clang, -O2):
<quicksortrev_float_>:
mov    (%rsi),%edx
add    $0xffffffff,%edx
xor    %esi,%esi
jmp    1030 <cwrapper_q_sortrev_float@plt>

LLVM IR (-O0):
define void @quicksortrev_float_(float* %0, i32* %1) {
%3 = alloca float*
%4 = alloca i32*
store float* %0, float** %3
store i32* %1, i32** %4
%5 = load float*, float** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = sub nsw i32 %7, 1
%9 = call i32 @cwrapper_q_sortrev_float(float* %5, i32 0, i32 %8)
ret void
}

LLVM IR (-O2):
define void @quicksortrev_float_(float* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
%5 = tail call i32 @cwrapper_q_sortrev_float(float* %0, i32 0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int open(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ read(int, char *, int);
int main() {
  int fd;
  char *fifo = "myfifo";
  char buff[1024];
  fd = open(fifo, 0666);
  read(fd, buff, 1024);
  printf("\n%s", buff);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1b6,%esi
call   1060 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1050 <read@plt>
lea    -0x410(%rbp),%rsi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
lea    0xeaf(%rip),%rdi
mov    $0x1b6,%esi
call   1060 <open@plt>
mov    %eax,%ebx
mov    %rsp,%r14
mov    %eax,%edi
mov    %r14,%rsi
mov    $0x400,%edx
call   1050 <read@plt>
lea    0xe91(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"myfifo\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1024 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @open(i8* %5, i32 438)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 1024)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"myfifo\00"
@.str.1 = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @open(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 438)
%4 = call i32 @read(i32 %3, i8* %2, i32 1024)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = call i32 @close(i32 %3)
ret i32 0
}
void pinModeIn(int pin) { ; }


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

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

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

LLVM IR (-O2):
define void @pinModeIn(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(void *, size_t);
scalar_t__ malloc(int);
void *ft_memalloc(size_t size) {
  void *mem;
  if ((mem = (void *)malloc(sizeof(*mem) * (size))) != NULL)
    ft_bzero(mem, size);
  return ((void *)mem);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1156 <ft_memalloc+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ft_bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <ft_memalloc+0x1f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ft_bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @ft_bzero(i8* %4, i64 %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printstr1(void *handle, const char str[]) { printf("simplex: %s", str); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"simplex: %s\00"
define void @printstr1(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 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"simplex: %s\00"
define void @printstr1(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/ *);
int main() { printf("%s\n", NULL); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cplPrintScope(int scope) {
  int i;
  for (i = 0; i < scope; i++)
    printf("  ");
}


x86 assembly (clang, -O0):
<cplPrintScope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <cplPrintScope+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <cplPrintScope+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cplPrintScope>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <cplPrintScope+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <cplPrintScope+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @cplPrintScope(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display(int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void *threadC(void *unused) {
  display(150, 67);
  printf("\n End of the thread C\n");
  fflush(stdout);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<threadC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x96,%edi
mov    $0x43,%esi
call   1030 <display@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadC>:
push   %rax
mov    $0x96,%edi
mov    $0x43,%esi
call   1040 <display@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0A End of the thread C\0A\00"
@stdout = global i32 0
define i8* @threadC(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @display(i32 150, i32 67)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @pthread_exit(i32* null)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [22 x i8] c"\0A End of the thread C\00"
define noalias i8* @threadC(i8* nocapture readnone %0) {
%2 = tail call i32 @display(i32 150, i32 67)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void print_immediate(int addr, int val) {
  if (val >= 10000)
    printf("%03d: 9999 Error: Illegal immediate value; treated as 9999", addr);
  else
    printf("%03d: %04d", addr, val);
}


x86 assembly (clang, -O0):
<print_immediate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jl     1141 <print_immediate+0x31>
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1155 <print_immediate+0x45>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_immediate>:
mov    %esi,%edx
mov    %edi,%esi
cmp    $0x2710,%edx
jl     112a <print_immediate+0x1a>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xf0a(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"%03d: 9999 Error: Illegal immediate value; treated as 9999\00"
@.str.1 = [11 x i8] c"%03d: %04d\00"
define void @print_immediate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 10000
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
br label %14
14: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"%03d: 9999 Error: Illegal immediate value; treated as 9999\00"
@.str.1 = [11 x i8] c"%03d: %04d\00"
define void @print_immediate(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 9999
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ fget(char *, int);
float fgetf() {
  char chain[64];
  fget(chain, 64);
  return atof(chain);
}


x86 assembly (clang, -O0):
<fgetf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
mov    $0x40,%esi
call   1040 <fget@plt>
lea    -0x40(%rbp),%rdi
call   1030 <atof@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetf>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <fget@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @fgetf() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @fget(i8* %2, i32 64)
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%5 = call float @atof(i8* %4)
ret float %5
}

LLVM IR (-O2):
define float @fgetf() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @fget(i8* %2, i32 64)
%4 = call float @atof(i8* %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void println(const char *text) {
  fprintf(stdout, "%s\n", text);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @println(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clr_scrn(void) { printf("\033[2J"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @clr_scrn() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
long long int f_n_out(void) { return 1; }


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

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

LLVM IR (-O0):
define i64 @f_n_out() {
ret i64 1
}

LLVM IR (-O2):
define i64 @f_n_out() {
ret i64 1
}
/* Type definitions */
typedef void *malloc;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int const, int, void *);
void *debug_malloc(const size_t size, const char *file, const int line) {
  void *ptr = (malloc)(size);
  printf("%s:%d: malloc(%d)=%p\n", file, line, (int)size, ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<debug_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%r8
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_malloc>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %ebx,%ecx
mov    %rbx,%r8
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%s:%d: malloc(%d)=%p\0A\00"
define i8* @debug_malloc(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = load i8*, i8** %7
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i32 %13, i8* %14)
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s:%d: malloc(%d)=%p\0A\00"
define i8* @debug_malloc(i64 %0, i8* %1, i32 %2) {
%4 = inttoptr i64 %0 to i8*
%5 = trunc i64 %0 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i32 %5, i8* %4)
ret i8* %4
}
/* Variables and functions */
char *getenv(char *);
char *get_usuario() {
  char *str = getenv("USER");
  return str;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"USER\00"
define i8* @get_usuario() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"USER\00"
define i8* @get_usuario() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void term_down(int n) { printf("\033[%dB", n); }


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

x86 assembly (clang, -O2):
<term_down>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dB\00"
define void @term_down(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void endprotoent(void) {}


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

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

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

LLVM IR (-O2):
define void @endprotoent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int *);
const char *integerValueStringify(int *payload) {
  char *retVal;
  asprintf(&retVal, "%d", payload);
  return retVal;
}


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

x86 assembly (clang, -O2):
<integerValueStringify>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @integerValueStringify(i32* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%5 = load i8*, i8** %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_client_is_local() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_client_is_local"
         "\n");
}


x86 assembly (clang, -O0):
<pa_socket_client_is_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"NOT IMPLEMENTED:pa_socket_client_is_local\0A\00"
define i32 @pa_socket_client_is_local() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_socket_client_is_local\00"
define i32 @pa_socket_client_is_local() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
int test_usleep(unsigned int msec_len) { usleep(msec_len * 1000); }


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

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

LLVM IR (-O0):
define i32 @test_usleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = mul i32 %4, 1000
%6 = call i32 @usleep(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_usleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void pabort(const char *s) { perror(s); }


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

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

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

LLVM IR (-O2):
define void @pabort(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(char const *, int /*<<< orphan*/, int,
                          int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char const *);
int help(int r) {
  const char *helptext =
      "j2uj - JSON to microjson converter\n"
      "Copyright 2016 Aaron Kondziela <aaron@openrobotics.company>\n"
      "Usage:\n"
      "    j2uj < JSON_INPUT > UJ_OUTPUT\n"
      "    j2uj [-h]\n"
      "Options:\n"
      "    -h    Print help text and exit\n";
  fwrite(helptext, strlen(helptext), 1, stderr);
  return r;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    0x2e8c(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%ecx
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [195 x i8] c"j2uj - JSON to microjson converter\0ACopyright 2016 Aaron Kondziela <aaron@openrobotics.company>\0AUsage:\0A j2uj < JSON_INPUT > UJ_OUTPUT\0A j2uj [-h]\0AOptions:\0A -h Print help text and exit\0A\00"
@stderr = global i32 0
define i32 @help(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fwrite(i8* %4, i32 %6, i32 1, i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [195 x i8] c"j2uj - JSON to microjson converter\0ACopyright 2016 Aaron Kondziela <aaron@openrobotics.company>\0AUsage:\0A j2uj < JSON_INPUT > UJ_OUTPUT\0A j2uj [-h]\0AOptions:\0A -h Print help text and exit\0A\00"
@stderr = global i32 0
define i32 @help(i32 returned %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fwrite(i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1, i32 %3)
ret i32 %0
}
/* Variables and functions */
int syscall(int, char const *);
int unlink(const char *path) { return syscall(10, path); }


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

x86 assembly (clang, -O2):
<unlink>:
mov    %rdi,%rsi
mov    $0xa,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @unlink(i8* %0) {
%2 = tail call i32 @syscall(i32 10, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ PROT_NONE;
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ mmap(void *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                        int, int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int);
void ignoredReturnValue(void *addr, int fd) {
  mmap(addr, 255, PROT_NONE, MAP_PRIVATE, fd, 0);
  setuid(42);
  getuid();
}


x86 assembly (clang, -O0):
<ignoredReturnValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
mov    0x2e85(%rip),%rax
mov    (%rax),%ecx
mov    -0xc(%rbp),%r8d
mov    $0xff,%esi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    $0x2a,%edi
call   1050 <setuid@plt>
mov    $0x0,%al
call   1030 <getuid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoredReturnValue>:
push   %rax
mov    %esi,%r8d
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    0x2e94(%rip),%rax
mov    (%rax),%ecx
mov    $0xff,%esi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    $0x2a,%edi
call   1050 <setuid@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getuid@plt>

LLVM IR (-O0):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
define void @ignoredReturnValue(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* @PROT_NONE
%7 = load i32, i32* @MAP_PRIVATE
%8 = load i32, i32* %4
%9 = call i32 @mmap(i8* %5, i32 255, i32 %6, i32 %7, i32 %8, i32 0)
%10 = call i32 @setuid(i32 42)
%11 = call i32 (...) @getuid()
ret void
}

LLVM IR (-O2):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
define void @ignoredReturnValue(i8* %0, i32 %1) {
%3 = load i32, i32* @PROT_NONE
%4 = load i32, i32* @MAP_PRIVATE
%5 = tail call i32 @mmap(i8* %0, i32 255, i32 %3, i32 %4, i32 %1, i32 0)
%6 = tail call i32 @setuid(i32 42)
%7 = tail call i32 (...) @getuid()
ret void
}
unsigned int f2u(float f) { return (unsigned)f; }


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

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

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

LLVM IR (-O2):
define i32 @f2u(float %0) {
%2 = fptoui float %0 to i32
ret i32 %2
}
int do_051() { return 51; }


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

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

LLVM IR (-O0):
define i32 @do_051() {
ret i32 51
}

LLVM IR (-O2):
define i32 @do_051() {
ret i32 51
}
/* Variables and functions */
int fastlz1_compress(void const *, int, void *);
int fastlz2_compress(void const *, int, void *);
int fastlz_compress_level(int level, const void *input, int length,
                          void *output) {
  if (level == 1) {
    return fastlz1_compress(input, length, output);
  }
  if (level == 2) {
    return fastlz2_compress(input, length, output);
  }
  return 0;
}


x86 assembly (clang, -O0):
<fastlz_compress_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1158 <fastlz_compress_level+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <fastlz1_compress@plt>
mov    %eax,-0x4(%rbp)
jmp    1181 <fastlz_compress_level+0x61>
cmpl   $0x2,-0x8(%rbp)
jne    117a <fastlz_compress_level+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fastlz2_compress@plt>
mov    %eax,-0x4(%rbp)
jmp    1181 <fastlz_compress_level+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastlz_compress_level>:
cmp    $0x2,%edi
je     1137 <fastlz_compress_level+0x17>
cmp    $0x1,%edi
jne    1144 <fastlz_compress_level+0x24>
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
jmp    1030 <fastlz1_compress@plt>
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
jmp    1040 <fastlz2_compress@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fastlz_compress_level(i32 %0, i8* %1, i32 %2, i8* %3) {
switch i32 %0, label %9 [
i32 1, label %5
i32 2, label %7
]
5: ; preds = %4
%6 = tail call i32 @fastlz1_compress(i8* %1, i32 %2, i8* %3)
br label %9
7: ; preds = %4
%8 = tail call i32 @fastlz2_compress(i8* %1, i32 %2, i8* %3)
br label %9
9: ; preds = %4, %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ], [ 0, %4 ]
ret i32 %10
}
int machineEndianness() {
  int i = 1;
  char *p = (char *)&i;
  if (p[0] == 1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<machineEndianness>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    112f <machineEndianness+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <machineEndianness+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @machineEndianness() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lcdc_samsung_panel_power(int);
int lcdc_panel_power(int on) {
  int flag_on = !!on;
  static int lcdc_power_save_on;
  if (lcdc_power_save_on == flag_on)
    return 0;
  lcdc_power_save_on = flag_on;
  lcdc_samsung_panel_power(on);
  return 0;
}


x86 assembly (clang, -O0):
<lcdc_panel_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    0x2ef8(%rip),%eax
cmp    -0xc(%rbp),%eax
jne    1149 <lcdc_panel_power+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1161 <lcdc_panel_power+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,0x2eda(%rip)
mov    -0x8(%rbp),%edi
call   1030 <lcdc_samsung_panel_power@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdc_panel_power>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
setne  %al
cmp    %eax,0x2f0e(%rip)
je     112b <lcdc_panel_power+0x1b>
mov    %eax,0x2f06(%rip)
call   1030 <lcdc_samsung_panel_power@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@lcdc_panel_power.lcdc_power_save_on = internal global i32 0
define i32 @lcdc_panel_power(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* @lcdc_panel_power.lcdc_power_save_on
%11 = load i32, i32* %4
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* %2
br label %18
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* @lcdc_panel_power.lcdc_power_save_on
%16 = load i32, i32* %3
%17 = call i32 @lcdc_samsung_panel_power(i32 %16)
store i32 0, i32* %2
br label %18
18: ; preds = %14, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@lcdc_panel_power.lcdc_power_save_on = internal unnamed_addr global i32 0
define i32 @lcdc_panel_power(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = load i32, i32* @lcdc_panel_power.lcdc_power_save_on
%5 = icmp eq i32 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %1
store i32 %3, i32* @lcdc_panel_power.lcdc_power_save_on
%7 = tail call i32 @lcdc_samsung_panel_power(i32 %0)
br label %8
8: ; preds = %1, %6
ret i32 0
}
/* Variables and functions */
int isScramble(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *, char *);
int main() {
  char s1[50], s2[50];
  scanf("%s%s", s1, s2);
  printf("%d\n", isScramble(s1, s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    0xeaf(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <isScramble@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0xec2(%rip),%rdi
lea    0x40(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <isScramble@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @isScramble(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int dheap_right_child_index(int i, int n) {
  int ri = 2 * i + 2;
  if (ri >= n)
    return -1;
  else
    return ri;
}


x86 assembly (clang, -O0):
<dheap_right_child_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     112e <dheap_right_child_index+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1134 <dheap_right_child_index+0x34>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dheap_right_child_index>:
lea    (%rdi,%rdi,1),%ecx
add    $0x2,%ecx
cmp    %esi,%ecx
mov    $0xffffffff,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @dheap_right_child_index(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, 2
%5 = icmp slt i32 %4, %1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
/* Variables and functions */
int f130(int *);
int f131(int *p) { return f130(p); }


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

x86 assembly (clang, -O2):
<f131>:
jmp    1030 <f130@plt>

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

LLVM IR (-O2):
define i32 @f131(i32* %0) {
%2 = tail call i32 @f130(i32* %0)
ret i32 %2
}
/* Variables and functions */
unsigned int _tlb_trans(unsigned int);
unsigned int _DS_vir_to_bus_addr(unsigned int vir_addr) {
  if ((vir_addr < 0xC0000000) && (vir_addr >= 0x80000000)) {
    return (vir_addr & ((unsigned int)0x1FFFFFFF));
  } else {
    return _tlb_trans(vir_addr);
  }
}


x86 assembly (clang, -O0):
<_DS_vir_to_bus_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xc0000000,-0x8(%rbp)
jae    1145 <_DS_vir_to_bus_addr+0x35>
cmpl   $0x80000000,-0x8(%rbp)
jb     1145 <_DS_vir_to_bus_addr+0x35>
mov    -0x8(%rbp),%eax
and    $0x1fffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <_DS_vir_to_bus_addr+0x40>
mov    -0x8(%rbp),%edi
call   1030 <_tlb_trans@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DS_vir_to_bus_addr>:
cmp    $0xbfffffff,%edi
jg     1121 <_DS_vir_to_bus_addr+0x11>
and    $0x1fffffff,%edi
mov    %edi,%eax
ret
jmp    1030 <_tlb_trans@plt>

LLVM IR (-O0):
define i32 @_DS_vir_to_bus_addr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, -1073741824
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp uge i32 %7, -2147483648
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = and i32 %10, 536870911
store i32 %11, i32* %2
br label %15
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = call i32 @_tlb_trans(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @_DS_vir_to_bus_addr(i32 %0) {
%2 = icmp slt i32 %0, -1073741824
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = and i32 %0, 536870911
br label %7
5: ; preds = %1
%6 = tail call i32 @_tlb_trans(i32 %0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int min(unsigned int, unsigned int);
unsigned max(unsigned a, unsigned b) {
  return (-1u) - (min((-1u) - a, (-1u) - b));
}


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

x86 assembly (clang, -O2):
<max>:
push   %rax
not    %edi
not    %esi
call   1030 <min@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @max(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 = sub i32 -1, %5
%7 = load i32, i32* %4
%8 = sub i32 -1, %7
%9 = call i32 @min(i32 %6, i32 %8)
%10 = sub i32 -1, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = xor i32 %1, -1
%5 = tail call i32 @min(i32 %3, i32 %4)
%6 = xor i32 %5, -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_version(void) {
  printf("nanddump"
         " "
         "$Revision: 1.29 $"
         "\n"
         "\n"
         "nanddump"
         " comes with NO WARRANTY\n"
         "to the extent permitted by law.\n"
         "\n"
         "You may redistribute copies of "
         "nanddump"
         "\n"
         "under the terms of the GNU General Public Licence.\n"
         "See the file `COPYING' for more information.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<display_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [230 x i8] c"nanddump $Revision: 1.29 $\0A\0Ananddump comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of nanddump\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\0A\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [229 x i8] c"nanddump $Revision: 1.29 $\0A\0Ananddump comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of nanddump\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\00"
define void @display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([229 x i8], [229 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}