xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ fromAptr(int /*<<< orphan*/);
int /*<<< orphan*/ getInstanceAttribute(int, int);
char *strdup(char *);
char *getInstanceStringAttribute(int instance, int attribute) {
  return strdup((char *)fromAptr(getInstanceAttribute(instance, attribute)));
}


x86 assembly (clang, -O0):
<getInstanceStringAttribute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <getInstanceAttribute@plt>
mov    %eax,%edi
call   1030 <fromAptr@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInstanceStringAttribute>:
push   %rax
call   1040 <getInstanceAttribute@plt>
mov    %eax,%edi
call   1030 <fromAptr@plt>
mov    %rax,%rdi
pop    %rax
jmp    1050 <strdup@plt>

LLVM IR (-O0):
define i8* @getInstanceStringAttribute(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @getInstanceAttribute(i32 %5, i32 %6)
%8 = call i64 @fromAptr(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = call i8* @strdup(i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @getInstanceStringAttribute(i32 %0, i32 %1) {
%3 = tail call i32 @getInstanceAttribute(i32 %0, i32 %1)
%4 = tail call i64 @fromAptr(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strdup(i8* %5)
ret i8* %6
}
void assert_failed(unsigned char *file, unsigned long line) {
  while (1) {
    ;
  }
}


x86 assembly (clang, -O0):
<assert_failed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    110c <assert_failed+0xc>

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

LLVM IR (-O0):
define void @assert_failed(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %2, %5
br label %5
}

LLVM IR (-O2):
define void @assert_failed(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ get_current();
unsigned long task_rlimit_max(int /*<<< orphan*/, unsigned int);
__attribute__((always_)) unsigned long rlimit_max(unsigned int limit) {
  return task_rlimit_max(get_current(), limit);
}


x86 assembly (clang, -O0):
<rlimit_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_current@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <task_rlimit_max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlimit_max>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <get_current@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <task_rlimit_max@plt>

LLVM IR (-O0):
define i64 @rlimit_max(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get_current()
%4 = load i32, i32* %2
%5 = call i64 @task_rlimit_max(i32 %3, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @rlimit_max(i32 %0) {
%2 = tail call i32 (...) @get_current()
%3 = tail call i64 @task_rlimit_max(i32 %2, i32 %0)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 10;
LOOP:
  do {
    if (a == 15) {
      a = a + 1;
      goto LOOP;
    }
    printf("a: %d\n", a);
    a++;
  } while (a < 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
jmp    112b <main+0x1b>
cmpl   $0xf,-0x8(%rbp)
jne    1143 <main+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jl     112b <main+0x1b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xa,%eax
lea    0xee1(%rip),%rbx
nop
mov    %eax,%ebp
mov    $0x10,%eax
cmp    $0xf,%ebp
je     1120 <main+0x10>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
mov    %ebp,%eax
cmp    $0x14,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"a: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %8, %0
%2 = phi i32 [ 10, %0 ], [ %9, %8 ]
%3 = icmp eq i32 %2, 15
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 20
br i1 %7, label %10, label %8
8: ; preds = %4, %1
%9 = phi i32 [ %6, %4 ], [ 16, %1 ]
br label %1
10: ; preds = %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *trealloc(void *ptr, size_t size) {
  void *result = realloc(ptr, size);
  if (!result) {
    perror("realloc");
    exit(255);
  }
  return result;
}


x86 assembly (clang, -O0):
<trealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <trealloc+0x42>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0xff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <trealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"realloc\00"
define i8* @trealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 255)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define noalias i8* @trealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 255)
unreachable
8: ; preds = %2
ret i8* %3
}
double ft_ilerp(double val, double first, double second) {
  if (val == first)
    return (0.0);
  if (val == second)
    return (1.0);
  return ((val - first) / (second - first));
}


x86 assembly (clang, -O0):
<ft_ilerp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1136 <ft_ilerp+0x36>
jp     1136 <ft_ilerp+0x36>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117b <ft_ilerp+0x7b>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    115e <ft_ilerp+0x5e>
jp     115e <ft_ilerp+0x5e>
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117b <ft_ilerp+0x7b>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ilerp>:
xorps  %xmm3,%xmm3
ucomisd %xmm1,%xmm0
jne    110f <ft_ilerp+0xf>
jp     110f <ft_ilerp+0xf>
movaps %xmm3,%xmm0
ret
ucomisd %xmm2,%xmm0
jne    1120 <ft_ilerp+0x20>
jp     1120 <ft_ilerp+0x20>
movsd  0xee1(%rip),%xmm0
ret
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
movapd %xmm0,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @ft_ilerp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp oeq double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store double 0.000000e+00, double* %4
br label %25
12: ; preds = %3
%13 = load double, double* %5
%14 = load double, double* %7
%15 = fcmp oeq double %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store double 1.000000e+00, double* %4
br label %25
17: ; preds = %12
%18 = load double, double* %5
%19 = load double, double* %6
%20 = fsub double %18, %19
%21 = load double, double* %7
%22 = load double, double* %6
%23 = fsub double %21, %22
%24 = fdiv double %20, %23
store double %24, double* %4
br label %25
25: ; preds = %17, %16, %11
%26 = load double, double* %4
ret double %26
}

LLVM IR (-O2):
define double @ft_ilerp(double %0, double %1, double %2) {
%4 = fcmp oeq double %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = fcmp oeq double %0, %2
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = fsub double %0, %1
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
br label %11
11: ; preds = %5, %3, %7
%12 = phi double [ %10, %7 ], [ 0.000000e+00, %3 ], [ 1.000000e+00, %5 ]
ret double %12
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exercise();
int /*<<< orphan*/ exercise8();
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("hello world");
  exercise();
  exercise8();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <exercise@plt>
mov    $0x0,%al
call   1050 <exercise8@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <exercise@plt>
xor    %eax,%eax
call   1050 <exercise8@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @exercise()
%8 = call i32 (...) @exercise8()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @exercise()
%5 = tail call i32 (...) @exercise8()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void printAndExit(char *s) {
  puts(s);
  exit(0);
}


x86 assembly (clang, -O0):
<printAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printAndExit>:
push   %rax
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @printAndExit(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char letter;
  char nospace;
  nospace = '\n';
  letter = 'z';
  write(1, &letter, 1);
  write(1, &nospace, 1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xa,-0x6(%rbp)
movb   $0x7a,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    -0x6(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0xa,0x6(%rsp)
movb   $0x7a,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
lea    0x6(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 10, i8* %3
store i8 122, i8* %2
%4 = call i32 @write(i32 1, i8* %2, i32 1)
%5 = call i32 @write(i32 1, i8* %3, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
store i8 10, i8* %2
store i8 122, i8* %1
%3 = call i32 @write(i32 1, i8* %1, i32 1)
%4 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 0
}
double square(double a) { return a * a; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @square(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ malloc(int);
int random();
int main(void) {
  int *pointer;
  int value;
  pointer = (int *)malloc(1);
  for (;;) {
    value = random();
    *pointer = value;
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,(%rbx)
jmp    1130 <main+0x10>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 1)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
br label %6
6: ; preds = %6, %0
%7 = call i32 (...) @random()
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32*, i32** %2
store i32 %8, i32* %9
br label %6
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @malloc(i32 1)
%2 = inttoptr i64 %1 to i32*
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @random()
store i32 %4, i32* %2
br label %3
}
void exch(int *arr, int i, int j) {
  int tmp = arr[i];
  arr[i] = arr[j];
  arr[j] = tmp;
}


x86 assembly (clang, -O0):
<exch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exch>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @exch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void dsi_wait_pll_hsdiv_dispc_active(struct platform_device *dsidev) {}


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define void @dsi_wait_pll_hsdiv_dispc_active(%struct.platform_device* nocapture %0) {
ret void
}
int isplus(char c) { return c == '+'; }


x86 assembly (clang, -O0):
<isplus>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isplus>:
xor    %eax,%eax
cmp    $0x2b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isplus(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isplus(i8 signext %0) {
%2 = icmp eq i8 %0, 43
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int powercap_sysfs_zone_exists(char *, int /*<<< orphan*/ *, int);
int rapl_sysfs_zone_exists(uint32_t zone, uint32_t sz, int is_sz) {
  uint32_t zones[2];
  zones[0] = zone;
  zones[1] = sz;
  ;
  return powercap_sysfs_zone_exists("intel-rapl", zones, (is_sz ? 2 : 1));
}


x86 assembly (clang, -O0):
<rapl_sysfs_zone_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x14(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
mov    $0x2,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xeb5(%rip),%rdi
call   1030 <powercap_sysfs_zone_exists@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_sysfs_zone_exists>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
cmp    $0x1,%edx
mov    $0x2,%edx
sbb    $0x0,%edx
lea    0xed6(%rip),%rdi
mov    %rsp,%rsi
call   1030 <powercap_sysfs_zone_exists@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"intel-rapl\00"
define i32 @rapl_sysfs_zone_exists(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %10, i32* %11
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 2, i32 1
%17 = call i32 @powercap_sysfs_zone_exists(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %12, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [11 x i8] c"intel-rapl\00"
define i32 @rapl_sysfs_zone_exists(i32 %0, i32 %1, i32 %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %7
%8 = icmp eq i32 %2, 0
%9 = select i1 %8, i32 1, i32 2
%10 = call i32 @powercap_sysfs_zone_exists(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %6, i32 %9)
ret i32 %10
}
/* Variables and functions */
long long sqrt(long long);
long long internal_sqrt_l(long long value) { return sqrt(value); }


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

x86 assembly (clang, -O2):
<internal_sqrt_l>:
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define i64 @internal_sqrt_l(i64 %0) {
%2 = tail call i64 @sqrt(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int);
int main() {
  int x;
  if (x == 10)
    exit(1);
  assert(x != 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0xa,-0x4(%rbp)
jne    113c <main+0x1c>
mov    $0x1,%edi
call   1040 <exit@plt>
cmpl   $0xa,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 10
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
double fm_exp2(double);
double fm_exp_(double *x) { return fm_exp2(1.4426950408889634074 * (*x)); }


x86 assembly (clang, -O0):
<fm_exp_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xed8(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1030 <fm_exp2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm_exp_>:
movsd  (%rdi),%xmm0
mulsd  0xee4(%rip),%xmm0
jmp    1030 <fm_exp2@plt>

LLVM IR (-O0):
define double @fm_exp_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = fmul double 0x3FF71547652B82FE, %4
%6 = call double @fm_exp2(double %5)
ret double %6
}

LLVM IR (-O2):
define double @fm_exp_(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, 0x3FF71547652B82FE
%4 = tail call double @fm_exp2(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ph_irc_destroy(void *handler) {
  free(handler);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ph_irc_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
void SSMR3GetU16(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetU16() {
ret void
}
/* Variables and functions */
int f282(int *);
int f283(int *p) { return f282(p); }


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

x86 assembly (clang, -O2):
<f283>:
jmp    1030 <f282@plt>

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

LLVM IR (-O2):
define i32 @f283(i32* %0) {
%2 = tail call i32 @f282(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void cgiMakeOnClickRadioButton(char *name, char *value, int checked,
                               char *command) {
  printf("<INPUT TYPE=RADIO NAME=\"%s\" VALUE=\"%s\" %s %s>", name, value,
         command, (checked ? "CHECKED" : ""));
}


x86 assembly (clang, -O0):
<cgiMakeOnClickRadioButton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%edi
lea    0xef0(%rip),%r8
lea    0xeea(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r8
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiMakeOnClickRadioButton>:
mov    %rsi,%rax
mov    %rdi,%rsi
test   %edx,%edx
lea    0xf0e(%rip),%rdx
lea    0xf08(%rip),%r8
cmove  %rdx,%r8
lea    0xecf(%rip),%rdi
mov    %rax,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"<INPUT TYPE=RADIO NAME=\22%s\22 VALUE=\22%s\22 %s %s>\00"
@.str.1 = [8 x i8] c"CHECKED\00"
@.str.2 = [1 x i8] zeroinitializer
define void @cgiMakeOnClickRadioButton(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"<INPUT TYPE=RADIO NAME=\22%s\22 VALUE=\22%s\22 %s %s>\00"
@.str.1 = [8 x i8] c"CHECKED\00"
@.str.2 = [1 x i8] zeroinitializer
define void @cgiMakeOnClickRadioButton(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %3, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ui2a(int, int, int /*<<< orphan*/, char *);
void i2a(int num, char *bf) {
  if (num < 0) {
    num = -num;
    *bf++ = '-';
  }
  ui2a(num, 10, 0, bf);
}


x86 assembly (clang, -O0):
<i2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1143 <i2a+0x33>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <ui2a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2a>:
mov    %rsi,%rcx
test   %edi,%edi
jns    1120 <i2a+0x10>
neg    %edi
movb   $0x2d,(%rcx)
add    $0x1,%rcx
mov    $0xa,%esi
xor    %edx,%edx
jmp    1030 <ui2a@plt>

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

LLVM IR (-O2):
define void @i2a(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i32 0, %0
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %5, %4 ], [ %0, %2 ]
%9 = phi i8* [ %6, %4 ], [ %1, %2 ]
%10 = tail call i32 @ui2a(i32 %8, i32 10, i32 0, i8* %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void write(uint64_t *p, uint64_t x) { *p = x; }


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

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

LLVM IR (-O0):
define void @write(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 = load i32*, i32** %3
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @write(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long event;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
void set_XConfigureEvent_event(void *_p, unsigned long _v) {
  ((XConfigureEvent *)_p)->event = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XConfigureEvent_event>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XConfigureEvent_event(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char const *);
int toupper(char const);
char *setmdir(char *buf, const char *userid) {
  sprintf(buf,
          "mail/%c/%s/"
          ".DIR",
          toupper(userid[0]), userid);
  return buf;
}


x86 assembly (clang, -O0):
<setmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setmdir>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movsbl (%rsi),%edi
call   1030 <toupper@plt>
lea    0xec7(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
mov    %rbx,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"mail/%c/%s/.DIR\00"
define i8* @setmdir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = call i32 @toupper(i8 signext %8)
%10 = load i8*, i8** %4
%11 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"mail/%c/%s/.DIR\00"
define i8* @setmdir(i8* returned writeonly %0, i8* %1) {
%3 = load i8, i8* %1
%4 = tail call i32 @toupper(i8 signext %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %1)
ret i8* %0
}
int contains(int *arr, int size, int num) {
  int i;
  for (i = 0; i < size; ++i) {
    if (arr[i] == num)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <contains+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <contains+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <contains+0x5b>
jmp    1146 <contains+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <contains+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
test   %esi,%esi
jle    111e <contains+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
je     1121 <contains+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <contains+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @contains(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeUDPConnectSocket(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<closeUDPConnectSocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closeUDPConnectSocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
double __ieee754_log10(double);
double log10(double x) { return __ieee754_log10(x); }


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

x86 assembly (clang, -O2):
<log10>:
jmp    1030 <__ieee754_log10@plt>

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

LLVM IR (-O2):
define double @log10(double %0) {
%2 = tail call double @__ieee754_log10(double %0)
ret double %2
}
int pthread_yield() {
  ;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_yield() {
ret i32 -1
}
int getmax(int length) {
  int i = 0, res = 0;
  while (1) {
    if (res >= length)
      return i;
    res += i++;
  }
}


x86 assembly (clang, -O0):
<getmax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1126 <getmax+0x26>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <getmax+0x15>

x86 assembly (clang, -O2):
<getmax>:
test   %edi,%edi
jle    111a <getmax+0x1a>
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    %eax,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jl     1110 <getmax+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getmax(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %4
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i32 [ %8, %5 ], [ 0, %1 ]
%8 = add nuw nsw i32 %7, 1
%9 = add nuw nsw i32 %6, %7
%10 = icmp slt i32 %9, %0
br i1 %10, label %5, label %3
}
/* Variables and functions */
int /*<<< orphan*/ Cbuf_Execute();
int /*<<< orphan*/ Cbuf_InsertText(char *);
int /*<<< orphan*/ Sys_RedirectStart(char *, int);
int /*<<< orphan*/ Sys_RedirectStop();
char *Cmd_RconCommand(char *cmd, char *buf, int buf_size) {
  Cbuf_Execute();
  Sys_RedirectStart(buf, buf_size);
  Cbuf_InsertText(cmd);
  Cbuf_Execute();
  Sys_RedirectStop();
  return buf;
}


x86 assembly (clang, -O0):
<Cmd_RconCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <Cbuf_Execute@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <Sys_RedirectStart@plt>
mov    -0x8(%rbp),%rdi
call   1060 <Cbuf_InsertText@plt>
mov    $0x0,%al
call   1040 <Cbuf_Execute@plt>
mov    $0x0,%al
call   1030 <Sys_RedirectStop@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_RconCommand>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <Cbuf_Execute@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <Sys_RedirectStart@plt>
mov    %r14,%rdi
call   1060 <Cbuf_InsertText@plt>
xor    %eax,%eax
call   1040 <Cbuf_Execute@plt>
xor    %eax,%eax
call   1030 <Sys_RedirectStop@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @Cmd_RconCommand(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 = call i32 (...) @Cbuf_Execute()
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @Sys_RedirectStart(i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = call i32 @Cbuf_InsertText(i8* %11)
%13 = call i32 (...) @Cbuf_Execute()
%14 = call i32 (...) @Sys_RedirectStop()
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @Cmd_RconCommand(i8* %0, i8* returned %1, i32 %2) {
%4 = tail call i32 (...) @Cbuf_Execute()
%5 = tail call i32 @Sys_RedirectStart(i8* %1, i32 %2)
%6 = tail call i32 @Cbuf_InsertText(i8* %0)
%7 = tail call i32 (...) @Cbuf_Execute()
%8 = tail call i32 (...) @Sys_RedirectStop()
ret i8* %1
}
/* Variables and functions */
int dec(int, int);
int cal(int a, int b) {
  int sum1 = a * b;
  int sum2 = a / b;
  int sum = dec(sum1, sum2);
  return a + b + sum + sum1 + sum2;
}


x86 assembly (clang, -O0):
<cal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <dec@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
mov    %esi,%ebp
imul   %edi,%ebp
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%r15d
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <dec@plt>
add    %r14d,%ebx
add    %ebp,%ebx
add    %r15d,%ebx
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sdiv i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @dec(i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %5
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %6
%25 = add nsw i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @cal(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sdiv i32 %0, %1
%5 = tail call i32 @dec(i32 %3, i32 %4)
%6 = add nsw i32 %1, %0
%7 = add i32 %6, %3
%8 = add i32 %7, %4
%9 = add i32 %8, %5
ret i32 %9
}
void ReadAppConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @ReadAppConfig() {
ret void
}
int nn_xbus_ispeer(int socktype) { return socktype == (7 * 16 + 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<nn_xbus_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x70,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_xbus_ispeer>:
xor    %eax,%eax
cmp    $0x70,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @nn_xbus_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 112
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @nn_xbus_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 112
%3 = zext i1 %2 to i32
ret i32 %3
}
void foo195() {}


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

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

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

LLVM IR (-O2):
define void @foo195() {
ret void
}
int set_memory_decrypted(unsigned long addr, int numpages) { return 0; }


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

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

LLVM IR (-O0):
define i32 @set_memory_decrypted(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @set_memory_decrypted(i64 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void short_usage(char *prog, char *info) {
  assert(prog != NULL);
  assert(info != NULL);
  printf("\n%s\n\n\n", info);
  printf("Try `%s --help' for more information.\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<short_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<short_usage>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
lea    0xea3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\0A%s\0A\0A\0A\00"
@.str.1 = [39 x i8] c"Try `%s --help' for more information.\0A\00"
define void @short_usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %3
%16 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%s\0A\0A\0A\00"
@.str.1 = [39 x i8] c"Try `%s --help' for more information.\0A\00"
define void @short_usage(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%11 = tail call i32 @exit(i32 1)
unreachable
}