xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int analogRead(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
void doAnalogRead(unsigned pin) {
  unsigned value = analogRead(pin);
  printf("%u\n", value);
}


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

x86 assembly (clang, -O2):
<doAnalogRead>:
push   %rax
call   1040 <analogRead@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define void @doAnalogRead(i32 %0) {
%2 = tail call i32 @analogRead(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void child_process1() { printf("child1 pid is: %d \n", getpid()); }


x86 assembly (clang, -O0):
<child_process1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_process1>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"child1 pid is: %d \0A\00"
define void @child_process1() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"child1 pid is: %d \0A\00"
define void @child_process1() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
void strrev(char *s) {
  int tmp, i, j;
  for (j = strlen(s) - 1; j >= 0; j--) {
    printf("%c", s[j]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<strrev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     116d <strrev+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <strrev+0x1b>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrev>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <strrev+0x37>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl (%r14,%rax,1),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <strrev+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @strrev(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @putchar(i32 %12)
%14 = icmp ugt i64 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %1
%16 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
double log(double);
double LogX(double arg, double logBase) { return log(arg) / log(logBase); }


x86 assembly (clang, -O0):
<LogX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogX>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @LogX(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @log(double %5)
%7 = load double, double* %4
%8 = call double @log(double %7)
%9 = fdiv double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @LogX(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = tail call double @log(double %1)
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int f489(int *);
int f490(int *p) { return f489(p); }


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

x86 assembly (clang, -O2):
<f490>:
jmp    1030 <f489@plt>

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

LLVM IR (-O2):
define i32 @f490(i32* %0) {
%2 = tail call i32 @f489(i32* %0)
ret i32 %2
}
int week_fn(const int time_var, const char *from, const char *to) {
  printf("%s %i %li %li\n", __FUNCTION__, time_var, (long)from, (long)to);
  return generic_fn(time_var, (long)from, (long)to, 1, 6);
}


x86 assembly (clang, -O0):
<week_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebb(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x6,%r8d
mov    $0x0,%al
call   1030 <generic_fn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<week_fn>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
mov    $0x6,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <generic_fn@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.week_fn = [8 x i8] c"week_fn\00"
define i32 @week_fn(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.week_fn, i64 0, i64 0), i32 %7, i64 %9, i64 %11)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
%16 = load i8*, i8** %6
%17 = ptrtoint i8* %16 to i64
%18 = call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %13, i64 %15, i64 %17, i32 1, i32 6)
ret i32 %18
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.week_fn = [8 x i8] c"week_fn\00"
define i32 @week_fn(i32 %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %2 to i64
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.week_fn, i64 0, i64 0), i32 %0, i64 %4, i64 %5)
%7 = tail call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %0, i64 %4, i64 %5, i32 1, i32 6)
ret i32 %7
}
f_d() {
  int a;
  int *p;
  p = &a;
  *p = 3;
}


x86 assembly (clang, -O0):
<f_d>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f_d() {
ret i32 undef
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_quaddobl_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(245, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_quaddobl_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf5,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_quaddobl_start_solutions>:
mov    $0xf5,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_quaddobl_start_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 245, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_quaddobl_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 245, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
size_t align_size_64(size_t num) { return (num + 63) / 64 * 64; }


x86 assembly (clang, -O0):
<align_size_64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3f,%rax
shr    $0x6,%rax
shl    $0x6,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_size_64>:
lea    0x3f(%rdi),%rax
and    $0xffffffffffffffc0,%rax
ret

LLVM IR (-O0):
define i64 @align_size_64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 63
%5 = udiv i64 %4, 64
%6 = mul i64 %5, 64
ret i64 %6
}

LLVM IR (-O2):
define i64 @align_size_64(i64 %0) {
%2 = add i64 %0, 63
%3 = and i64 %2, -64
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
char *readBytes(char *buf, char *out, uint32_t len) {
  memcpy(out, buf, len);
  return buf + len;
}


x86 assembly (clang, -O0):
<readBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readBytes>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
call   1030 <memcpy@plt>
movslq %ebx,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @readBytes(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
ret i8* %14
}

LLVM IR (-O2):
define i8* @readBytes(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, const char *argv[]) {
  int x = 100;
  printf("dec= %d; octal= %o; hex= %x\n", x, x, x);
  printf("dec= %d; octal= %#o; hex= %#x\n", x, x, x);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"dec= %d; octal= %o; hex= %x\0A\00"
@.str.1 = [31 x i8] c"dec= %d; octal= %#o; hex= %#x\0A\00"
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
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"dec= %d; octal= %o; hex= %x\0A\00"
@.str.1 = [31 x i8] c"dec= %d; octal= %#o; hex= %#x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 100, i32 100, i32 100)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 100, i32 100)
ret i32 0
}
int ft_isblank(int c) {
  if (c == ' ' || c == '\n' || c == '\t' || c == '\r' || c == '\v' || c == '\f')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0xa,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0x9,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0xd,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0xb,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0xc,-0x8(%rbp)
jne    114f <ft_isblank+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ft_isblank+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isblank>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <ft_isblank+0xe>
ret
cmp    $0x20,%edi
je     110d <ft_isblank+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isblank(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 12, label %3
i32 11, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int sqrt(int);
char isprime(int n) {
  int i;
  for (i = 2; i <= sqrt(n); i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1169 <isprime+0x59>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1156 <isprime+0x46>
movb   $0x0,-0x1(%rbp)
jmp    116d <isprime+0x5d>
jmp    115b <isprime+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <isprime+0x12>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
call   1030 <sqrt@plt>
mov    $0x1,%r14b
cmp    $0x2,%eax
jl     114c <isprime+0x3c>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebp,%eax
cltd
idiv   %ebx
test   %edx,%edx
je     1149 <isprime+0x39>
mov    %ebp,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1130 <isprime+0x20>
jmp    114c <isprime+0x3c>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @isprime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %12, label %8
4: ; preds = %8
%5 = add nuw nsw i32 %9, 1
%6 = tail call i32 @sqrt(i32 %0)
%7 = icmp slt i32 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4, %1
%13 = phi i8 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int const);
__attribute__((__noreturn__,
               __unused__)) void(cheat_unwrapped_exit)(int const status) {
  exit(status);
}


x86 assembly (clang, -O0):
<cheat_unwrapped_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<cheat_unwrapped_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @cheat_unwrapped_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_addTan() {
  CALC_appendString("tan");
  CALC_appendString("(");
}


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

x86 assembly (clang, -O2):
<CALC_addTan>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <CALC_appendString@plt>
lea    0xee0(%rip),%rdi
pop    %rax
jmp    1030 <CALC_appendString@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"tan\00"
@.str.1 = [2 x i8] c"(\00"
define void @CALC_addTan() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void age() {}


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

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

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

LLVM IR (-O2):
define void @age() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void child_handler(int signo) { exit(EXIT_FAILURE); }


x86 assembly (clang, -O0):
<child_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<child_handler>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @child_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @child_handler(i32 %0) {
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, int /*<<< orphan*/, int);
void nullPointer_memcmp(char *p) { (void)memcmp(p, 0, 123); }


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

x86 assembly (clang, -O2):
<nullPointer_memcmp>:
xor    %esi,%esi
mov    $0x7b,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define void @nullPointer_memcmp(i8* %0) {
%2 = tail call i32 @memcmp(i8* %0, i32 0, i32 123)
ret void
}
float JetTabl_lookup(float sample) {
  float output;
  output = sample * (sample * sample - 1.);
  if (output > 1.)
    output = 1.;
  if (output < -1.)
    output = -1.;
  return output;
}


x86 assembly (clang, -O0):
<JetTabl_lookup>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xed8(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1161 <JetTabl_lookup+0x61>
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe96(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1189 <JetTabl_lookup+0x89>
movss  0xe90(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<JetTabl_lookup>:
cvtss2sd %xmm0,%xmm1
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0xee4(%rip),%xmm1
minss  %xmm0,%xmm1
movss  0xedc(%rip),%xmm0
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @JetTabl_lookup(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = load float, float* %2
%7 = load float, float* %2
%8 = fmul float %6, %7
%9 = fpext float %8 to double
%10 = fsub double %9, 1.000000e+00
%11 = fmul double %5, %10
%12 = fptrunc double %11 to float
store float %12, float* %3
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fcmp ogt double %14, 1.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %1
store float 1.000000e+00, float* %3
br label %17
17: ; preds = %16, %1
%18 = load float, float* %3
%19 = fpext float %18 to double
%20 = fcmp olt double %19, -1.000000e+00
br i1 %20, label %21, label %22
21: ; preds = %17
store float -1.000000e+00, float* %3
br label %22
22: ; preds = %21, %17
%23 = load float, float* %3
ret float %23
}

LLVM IR (-O2):
define float @JetTabl_lookup(float %0) {
%2 = fpext float %0 to double
%3 = fmul float %0, %0
%4 = fpext float %3 to double
%5 = fadd double %4, -1.000000e+00
%6 = fmul double %5, %2
%7 = fptrunc double %6 to float
%8 = fcmp ogt float %7, 1.000000e+00
%9 = select i1 %8, float 1.000000e+00, float %7
%10 = fcmp olt float %9, -1.000000e+00
%11 = select i1 %10, float -1.000000e+00, float %9
ret float %11
}
int main(int argc, char **argv) {
  double x = 1.48734 + (double)argc;
  return (int)__builtin_sqrt(x);
}


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)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xecd(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sqrt@plt>
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cvtsi2sd %edi,%xmm0
addsd  0xee3(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112d <main+0x1d>
sqrtsd %xmm0,%xmm0
jmp    1132 <main+0x22>
call   1030 <sqrt@plt>
cvttsd2si %xmm0,%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 double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fadd double 1.487340e+00, %8
store double %9, double* %6
%10 = load double, double* %6
%11 = call double @sqrt(double %10)
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = sitofp i32 %0 to double
%4 = fadd double %3, 1.487340e+00
%5 = tail call double @sqrt(double %4)
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Variables and functions */
int INT_MAX;
int sum(int a, int b) {
  if ((a == INT_MAX) || (b == INT_MAX))
    return INT_MAX;
  else
    return a + b;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed4(%rip),%rcx
cmp    (%rcx),%eax
je     112e <sum+0x2e>
mov    -0xc(%rbp),%eax
mov    0x2ec2(%rip),%rcx
cmp    (%rcx),%eax
jne    113f <sum+0x3f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <sum+0x48>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
lea    (%rsi,%rdi,1),%eax
cmp    %esi,%ecx
cmove  %ecx,%eax
cmp    %edi,%ecx
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @sum(i32 %0, i32 %1) {
%3 = load i32, i32* @INT_MAX
%4 = icmp eq i32 %3, %0
%5 = icmp eq i32 %3, %1
%6 = or i1 %4, %5
%7 = add nsw i32 %1, %0
%8 = select i1 %6, i32 %3, i32 %7
ret i32 %8
}
f(char c, int x[]) { return x[c] + *(x + c); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbq -0x1(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movsbl -0x1(%rbp),%edx
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%eax
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i8 signext %0, i32* nocapture %1) {
%3 = sext i8 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void rodape(char s[]) { printf("[*%s*]\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"[*%s*]\0A\00"
define void @rodape(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dopprompt(char const *, int, int);
void pprompt(const char *cp, int ntruncate) { dopprompt(cp, ntruncate, 1); }


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

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

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

LLVM IR (-O2):
define void @pprompt(i8* %0, i32 %1) {
%3 = tail call i32 @dopprompt(i8* %0, i32 %1, i32 1)
ret void
}
void mt_dcm_topckg_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @mt_dcm_topckg_disable() {
ret void
}
int sprd8803_init_modemctl_device(struct modem_ctl *mc,
                                  struct modem_data *pdata) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.modem_ctl = type opaque
%struct.modem_data = type opaque
define i32 @sprd8803_init_modemctl_device(%struct.modem_ctl* nocapture readnone %0, %struct.modem_data* nocapture readnone %1) {
ret i32 0
}
int null_PCAP_MINOR_VERSION(void *p) {
  p = (p);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @null_PCAP_MINOR_VERSION(i8* nocapture readnone %0) {
ret i32 0
}
int sys$setprn(void *prcnam) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)(prcnam);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(4), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$setprn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x4,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$setprn>:
mov    $0x4,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$setprn"(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 4, i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @"sys$setprn"(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 4, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cat_file(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  if (argc < 2)
    usage();
  else {
    for (int i = 1; i < argc; ++i)
      cat_file(argv[i]);
  }
  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   $0x2,-0x8(%rbp)
jge    114c <main+0x2c>
mov    $0x0,%al
call   1030 <usage@plt>
jmp    1183 <main+0x63>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117e <main+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <cat_file@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <main+0x33>
jmp    1183 <main+0x63>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jge    1133 <main+0x13>
xor    %eax,%eax
call   1030 <usage@plt>
jmp    1152 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdi
call   1040 <cat_file@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
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 slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @usage()
br label %27
11: ; preds = %2
store i32 1, i32* %6
br label %12
12: ; preds = %23, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i8**, i8*** %5
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @cat_file(i8* %21)
br label %23
23: ; preds = %16
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %12
26: ; preds = %12
br label %27
27: ; preds = %26, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @usage()
br label %15
8: ; preds = %4, %8
%9 = phi i64 [ 1, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @cat_file(i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %8
15: ; preds = %8, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getpagesize();
int /*<<< orphan*/ munmap(void *, int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
void *start_munmap(void *p) {
  usleep(500000);
  munmap(p, getpagesize());
  return 0;
}


x86 assembly (clang, -O0):
<start_munmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7a120,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <munmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_munmap>:
push   %rbx
mov    %rdi,%rbx
mov    $0x7a120,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
call   1040 <getpagesize@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <munmap@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @start_munmap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @usleep(i32 500000)
%4 = load i8*, i8** %2
%5 = call i32 (...) @getpagesize()
%6 = call i32 @munmap(i8* %4, i32 %5)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @start_munmap(i8* %0) {
%2 = tail call i32 @usleep(i32 500000)
%3 = tail call i32 (...) @getpagesize()
%4 = tail call i32 @munmap(i8* %0, i32 %3)
ret i8* null
}
int getAddress() { return -1; }


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

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

LLVM IR (-O0):
define i32 @getAddress() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @getAddress() {
ret i32 -1
}
void ASN1_parse(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_parse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextln131(char const *);
void drawtextln(const char *s) { DrawTextln131(s); }


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

x86 assembly (clang, -O2):
<drawtextln>:
jmp    1030 <DrawTextln131@plt>

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

LLVM IR (-O2):
define void @drawtextln(i8* %0) {
%2 = tail call i32 @DrawTextln131(i8* %0)
ret void
}
unsigned long hash1(char const *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++) {
    hash = ((hash << 5) | hash) | c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash1+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
or     -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash1+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash1>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash1+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
or     %rax,%rdx
movsbq %cl,%rax
or     %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash1+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i64 @hash1(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 5381, i64* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %5
%12 = load i64, i64* %3
%13 = shl i64 %12, 5
%14 = load i64, i64* %3
%15 = or i64 %13, %14
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = or i64 %15, %17
store i64 %18, i64* %3
br label %5
19: ; preds = %5
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @hash1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %12, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = shl i64 %7, 5
%10 = or i64 %9, %7
%11 = sext i8 %5 to i64
%12 = or i64 %10, %11
%13 = load i8, i8* %8
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 5381, %1 ], [ %12, %4 ]
ret i64 %16
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("PID %d : Je suis un programme qui imprime c'est tout\n", getpid());
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"PID %d : Je suis un programme qui imprime c'est tout\0A\00"
define i32 @main() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [54 x i8] c"PID %d : Je suis un programme qui imprime c'est tout\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void ntp_changedest(void) {}


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

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

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

LLVM IR (-O2):
define void @ntp_changedest() {
ret void
}
double f2(double y) { return (-1.2 * __builtin_copysign(1.1, y)); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xefb(%rip),%xmm0
pand   %xmm0,%xmm1
movaps 0xf00(%rip),%xmm0
por    %xmm0,%xmm1
movsd  0xed4(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
andpd  0xef8(%rip),%xmm0
orpd   0xf00(%rip),%xmm0
mulsd  0xf08(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.copysign.f64(double 1.100000e+00, double %3)
%5 = fmul double -1.200000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @f2(double %0) {
%2 = tail call double @llvm.copysign.f64(double 1.100000e+00, double %0)
%3 = fmul double %2, -1.200000e+00
ret double %3
}
int calculate_packet_size(int is_transport, int is_program, int is_audio,
                          int is_video, int is_bd) {
  if (is_transport) {
    if (is_bd)
      return 192;
    else
      return 188;
  } else if (is_program)
    return 0;
  else if (is_audio)
    return 0x800;
  else if (is_video)
    return 0x800;
}


x86 assembly (clang, -O0):
<calculate_packet_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1140 <calculate_packet_size+0x40>
cmpl   $0x0,-0x18(%rbp)
je     1134 <calculate_packet_size+0x34>
movl   $0xc0,-0x4(%rbp)
jmp    1191 <calculate_packet_size+0x91>
movl   $0xbc,-0x4(%rbp)
jmp    1191 <calculate_packet_size+0x91>
cmpl   $0x0,-0xc(%rbp)
je     1156 <calculate_packet_size+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1191 <calculate_packet_size+0x91>
cmpl   $0x0,-0x10(%rbp)
je     116c <calculate_packet_size+0x6c>
movl   $0x800,-0x4(%rbp)
jmp    1191 <calculate_packet_size+0x91>
cmpl   $0x0,-0x14(%rbp)
je     1182 <calculate_packet_size+0x82>
movl   $0x800,-0x4(%rbp)
jmp    1191 <calculate_packet_size+0x91>
jmp    1187 <calculate_packet_size+0x87>
jmp    118c <calculate_packet_size+0x8c>
jmp    1191 <calculate_packet_size+0x91>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_packet_size>:
xor    %eax,%eax
test   %r8d,%r8d
setne  %al
xor    %ecx,%ecx
test   %esi,%esi
sete   %cl
shl    $0xb,%ecx
test   %edi,%edi
lea    0xbc(,%rax,4),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calculate_packet_size(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %5
%15 = load i32, i32* %11
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 192, i32* %6
br label %34
18: ; preds = %14
store i32 188, i32* %6
br label %34
19: ; preds = %5
%20 = load i32, i32* %8
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 0, i32* %6
br label %34
23: ; preds = %19
%24 = load i32, i32* %9
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 2048, i32* %6
br label %34
27: ; preds = %23
%28 = load i32, i32* %10
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 2048, i32* %6
br label %34
31: ; preds = %27
br label %32
32: ; preds = %31
br label %33
33: ; preds = %32
br label %34
34: ; preds = %17, %18, %22, %26, %30, %33
%35 = load i32, i32* %6
ret i32 %35
}

LLVM IR (-O2):
define i32 @calculate_packet_size(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %0, 0
%7 = icmp eq i32 %4, 0
%8 = select i1 %7, i32 188, i32 192
%9 = icmp eq i32 %1, 0
%10 = select i1 %9, i32 2048, i32 0
%11 = select i1 %6, i32 %10, i32 %8
ret i32 %11
}