xunge/DecIR huggingface dataset:
int max2(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max2+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max2+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max2>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max2(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int pow(int, int);
float ExponentialEaseOut(float p) {
  return (p == 1.0) ? p : 1 - pow(2, -10 * p);
}


x86 assembly (clang, -O0):
<ExponentialEaseOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    114d <ExponentialEaseOut+0x3d>
jp     114d <ExponentialEaseOut+0x3d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    117a <ExponentialEaseOut+0x6a>
movss  0xeb3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExponentialEaseOut>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1120 <ExponentialEaseOut+0x10>
jnp    1144 <ExponentialEaseOut+0x34>
mulss  0xedc(%rip),%xmm0
cvttss2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ExponentialEaseOut(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp oeq double %4, 1.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %2
br label %15
8: ; preds = %1
%9 = load float, float* %2
%10 = fmul float -1.000000e+01, %9
%11 = fptosi float %10 to i32
%12 = call i32 @pow(i32 2, i32 %11)
%13 = sub nsw i32 1, %12
%14 = sitofp i32 %13 to float
br label %15
15: ; preds = %8, %6
%16 = phi float [ %7, %6 ], [ %14, %8 ]
ret float %16
}

LLVM IR (-O2):
define float @ExponentialEaseOut(float %0) {
%2 = fcmp oeq float %0, 1.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fmul float %0, -1.000000e+01
%5 = fptosi float %4 to i32
%6 = tail call i32 @pow(i32 2, i32 %5)
%7 = sub nsw i32 1, %6
%8 = sitofp i32 %7 to float
br label %9
9: ; preds = %1, %3
%10 = phi float [ %8, %3 ], [ 1.000000e+00, %1 ]
ret float %10
}
/* Variables and functions */
int getlittleline(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int len;
  char line[1000000];
  while ((len = getlittleline(line)) > 1) {
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf4260,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xf4260(%rbp),%rdi
call   1040 <getlittleline@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x1,%eax
jle    1169 <main+0x49>
lea    -0xf4260(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0xf4260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xf4248,%rsp
mov    %rsp,%rdi
call   1040 <getlittleline@plt>
cmp    $0x2,%eax
jl     1168 <main+0x48>
lea    0xec2(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <getlittleline@plt>
cmp    $0x1,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0xf4248,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000000 x i8]
%4 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %3, i64 0, i64 0
%5 = call i32 @getlittleline(i8* %4)
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %2, %7
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%9 = call i32 @getlittleline(i8* %4)
%10 = icmp sgt i32 %9, 1
br i1 %10, label %7, label %11
11: ; preds = %7, %2
ret i32 0
}
/* Type definitions */
struct st_trx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_msg(int, char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
void http_501(int fd, struct st_trx *wb_trx) {
  char buff[8192];
  sprintf(buff, "HTTP/1.0 501 NOT IMPLEMENTED\r\n");
  sprintf(buff, "%sServer: xWebserver\r\n", buff);
  send_msg(fd, buff);
}


x86 assembly (clang, -O0):
<http_501>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2010,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2010(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x2010(%rbp),%rdi
lea    -0x2010(%rbp),%rdx
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x2010(%rbp),%rsi
call   1030 <send_msg@plt>
add    $0x2010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_501>:
push   %rbp
push   %rbx
sub    $0x2008,%rsp
mov    %edi,%ebp
movups 0xedd(%rip),%xmm0
movups %xmm0,0xf(%rsp)
movups 0xec2(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed6(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <send_msg@plt>
add    $0x2008,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.st_trx = type { i32 }
@.str = [31 x i8] c"HTTP/1.0 501 NOT IMPLEMENTED\0D\0A\00"
@.str.1 = [23 x i8] c"%sServer: xWebserver\0D\0A\00"
define void @http_501(i32 %0, %struct.st_trx* %1) {
%3 = alloca i32
%4 = alloca %struct.st_trx*
%5 = alloca [8192 x i8]
store i32 %0, i32* %3
store %struct.st_trx* %1, %struct.st_trx** %4
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %3
%12 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%13 = call i32 @send_msg(i32 %11, i8* %12)
ret void
}

LLVM IR (-O2):
%struct.st_trx = type { i32 }
@.str = [31 x i8] c"HTTP/1.0 501 NOT IMPLEMENTED\0D\0A\00"
@.str.1 = [23 x i8] c"%sServer: xWebserver\0D\0A\00"
define void @http_501(i32 %0, %struct.st_trx* nocapture readnone %1) {
%3 = alloca [8192 x i8]
%4 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @send_msg(i32 %0, i8* %4)
ret void
}
/* Variables and functions */
long meat_time_offset_hours(int const);
signed long int meat_time_offset_days(int const i_days) {
  return meat_time_offset_hours(i_days * 24l);
}


x86 assembly (clang, -O0):
<meat_time_offset_days>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x18,%rax,%rax
mov    %eax,%edi
call   1030 <meat_time_offset_hours@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meat_time_offset_days>:
shl    $0x3,%edi
lea    (%rdi,%rdi,2),%edi
jmp    1030 <meat_time_offset_hours@plt>

LLVM IR (-O0):
define i64 @meat_time_offset_days(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul nsw i64 %4, 24
%6 = trunc i64 %5 to i32
%7 = call i64 @meat_time_offset_hours(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @meat_time_offset_days(i32 %0) {
%2 = mul i32 %0, 24
%3 = tail call i64 @meat_time_offset_hours(i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int bar(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  if (bar(0x6ffffffc) != 2)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6ffffffc,%edi
call   1040 <bar@plt>
cmp    $0x2,%eax
je     1159 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6ffffffc,%edi
call   1040 <bar@plt>
cmp    $0x2,%eax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 1879048188)
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 1879048188)
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bits_dump_indent(unsigned level) {
  unsigned i;
  for (i = 0; i < level; i++) {
    printf("  ");
  }
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @bits_dump_indent(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m_free(int);
int /*<<< orphan*/ m_free_strings(int, int /*<<< orphan*/);
scalar_t__ m_next(int, int *, int **);
void v_free(int vl) {
  int p, *d;
  for (p = -1; m_next(vl, &p, &d);)
    m_free_strings(*d, 0);
  m_free(vl);
}


x86 assembly (clang, -O0):
<v_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <m_next@plt>
cmp    $0x0,%rax
je     116e <v_free+0x3e>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <m_free_strings@plt>
jmp    1142 <v_free+0x12>
mov    -0x4(%rbp),%edi
call   1040 <m_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_free>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <m_next@plt>
test   %rax,%rax
je     1190 <v_free+0x60>
lea    0x4(%rsp),%r14
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <m_free_strings@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <m_next@plt>
test   %rax,%rax
jne    1170 <v_free+0x40>
mov    %ebx,%edi
call   1040 <m_free@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @v_free(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32** %3 to i8*
store i32 -1, i32* %2
%6 = call i64 @m_next(i32 %0, i32* %2, i32** %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %8
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @m_free_strings(i32 %10, i32 0)
%12 = call i64 @m_next(i32 %0, i32* %2, i32** %3)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %8
14: ; preds = %8, %1
%15 = call i32 @m_free(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("cd /mnt/user/code/SensorEvents/bin && /mnt/user/jvm/java Main");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"cd /mnt/user/code/SensorEvents/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [62 x i8] c"cd /mnt/user/code/SensorEvents/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ geteuid();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int testRoot() {
  printf("Are you root.. ");
  fflush(stdout);
  if (geteuid() != 0) {
    perror("not really!");
    exit(-1);
  }
  printf("yes!\n");
}


x86 assembly (clang, -O0):
<testRoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
je     1199 <testRoot+0x49>
lea    0xe86(%rip),%rdi
call   1060 <perror@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testRoot>:
push   %rax
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1050 <geteuid@plt>
test   %rax,%rax
jne    1194 <testRoot+0x34>
lea    0xe8e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
lea    0xe75(%rip),%rdi
call   1070 <perror@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Are you root.. \00"
@stdout = global i32 0
@.str.1 = [12 x i8] c"not really!\00"
@.str.2 = [6 x i8] c"yes!\0A\00"
define i32 @testRoot() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i64 (...) @geteuid()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"Are you root.. \00"
@stdout = global i32 0
@.str.1 = [12 x i8] c"not really!\00"
@str = [5 x i8] c"yes!\00"
define i32 @testRoot() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i64 (...) @geteuid()
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
size_t align(size_t, int /*<<< orphan*/, int);
int /*<<< orphan*/ get_pagesize();
size_t pg_align(size_t offset, bool ceil) {
  return align(offset, get_pagesize(), ceil);
}


x86 assembly (clang, -O0):
<pg_align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <get_pagesize@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <align@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pg_align>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_pagesize@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <align@plt>

LLVM IR (-O0):
define i64 @pg_align(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = call i32 (...) @get_pagesize()
%7 = load i32, i32* %4
%8 = call i64 @align(i64 %5, i32 %6, i32 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @pg_align(i64 %0, i32 %1) {
%3 = tail call i32 (...) @get_pagesize()
%4 = tail call i64 @align(i64 %0, i32 %3, i32 %1)
ret i64 %4
}
/* Variables and functions */
char *getmem(scalar_t__);
char *strcpy(char *, char *);
scalar_t__ strlen(char *);
char *quickstrdup(char *s) {
  char *r = getmem(strlen(s) + 1);
  return strcpy(r, s);
}


x86 assembly (clang, -O0):
<quickstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <getmem@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <getmem@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @quickstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @getmem(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @quickstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @getmem(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
void ff_hevc_put_hevc_bi_epel_hv32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv32_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void signal_callback_handler(int signum) {
  printf("Caught signal %d\n", signum);
  exit(signum);
}


x86 assembly (clang, -O0):
<signal_callback_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_callback_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @signal_callback_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @signal_callback_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int /*<<< orphan*/);
void m68k_op_sf_8_aw(void) { m68ki_write_8(EA_AW_8(), 0); }


x86 assembly (clang, -O0):
<m68k_op_sf_8_aw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AW_8@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sf_8_aw>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AW_8@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sf_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sf_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 0)
ret void
}
void ft_strclr(char *s) {
  while (*s != '\0') {
    *s = '\0';
    s++;
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1130 <ft_strclr+0x30>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ft_strclr+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
store i8 0, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outc(int /*<<< orphan*/);
void outs(const char *str) {
  while (*str != '\0') {
    outc(*str++);
  }
}


x86 assembly (clang, -O0):
<outs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <outs+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <outc@plt>
jmp    111c <outs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <outs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <outc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <outs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @outs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @outc(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, ...);
void Move_Ret_To_Mem_L(char *name, int index) {
  Inst_Printf("la", "$13,%s", name);
  Inst_Printf("sw", "$2,%d($13)", index * 4);
}


x86 assembly (clang, -O0):
<Move_Ret_To_Mem_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed6(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
mov    -0xc(%rbp),%edx
shl    $0x2,%edx
lea    0xec5(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Mem_L>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xedf(%rip),%rsi
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
shl    $0x2,%ebx
lea    0xed5(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"la\00"
@.str.1 = [7 x i8] c"$13,%s\00"
@.str.2 = [3 x i8] c"sw\00"
@.str.3 = [11 x i8] c"$2,%d($13)\00"
define void @Move_Ret_To_Mem_L(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 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 4
%9 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"la\00"
@.str.1 = [7 x i8] c"$13,%s\00"
@.str.2 = [3 x i8] c"sw\00"
@.str.3 = [11 x i8] c"$2,%d($13)\00"
define void @Move_Ret_To_Mem_L(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = shl nsw i32 %1, 2
%5 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %4)
ret void
}
char *procprt_RSIZE_e(struct tstat *curstat, int avgval, int nsecs) {
  return "    0K";
}


x86 assembly (clang, -O0):
<procprt_RSIZE_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [7 x i8] c" 0K\00"
define i8* @procprt_RSIZE_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [7 x i8] c" 0K\00"
define i8* @procprt_RSIZE_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void cpy2(void *a, const void *b) { *(uint16_t *)a = *(uint16_t *)b; }


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

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

LLVM IR (-O0):
define void @cpy2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @cpy2(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ max31855_init(char *);
int /*<<< orphan*/ stderr;
int sensor_thermocouple_init(void) {
  if (max31855_init("/dev/spidev1.0")) {
    fprintf(stderr, "Error: Thermocouple SPI initialization failed\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sensor_thermocouple_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <max31855_init@plt>
cmp    $0x0,%rax
je     115f <sensor_thermocouple_init+0x3f>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <sensor_thermocouple_init+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sensor_thermocouple_init>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <max31855_init@plt>
test   %rax,%rax
je     114e <sensor_thermocouple_init+0x2e>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/dev/spidev1.0\00"
@stderr = global i32 0
@.str.1 = [47 x i8] c"Error: Thermocouple SPI initialization failed\0A\00"
define i32 @sensor_thermocouple_init() {
%1 = alloca i32
%2 = call i64 @max31855_init(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [15 x i8] c"/dev/spidev1.0\00"
@stderr = global i32 0
@.str.1 = [47 x i8] c"Error: Thermocouple SPI initialization failed\0A\00"
define i32 @sensor_thermocouple_init() {
%1 = tail call i64 @max31855_init(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %7
}
int test_imm_45int64_midword_reg(long long val) {
  return ((val >> 16) & (0x45 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_45int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x45,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_45int64_midword_reg>:
test   $0x450000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_45int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 69
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_45int64_midword_reg(i64 %0) {
%2 = and i64 %0, 4521984
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  scanf("%d", &a);
  b = a;
  a = a * a;
  b = a * b;
  printf("%d\n", a);
  printf("%d\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
mov    %esi,0x4(%rsp)
imul   %esi,%ebx
lea    0xeb7(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
store i32 %5, i32* %1
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ****uint8_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ ******);
void free2D(uint8_t **dest, int d1) {
  for (int i = 0; i < d1; i++)
    free(dest[i]);
  free(dest);
}


x86 assembly (clang, -O0):
<free2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free2D+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2D+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __udma_put_rflow(struct udma_dev *, struct udma_rflow *);
void xudma_rflow_put(struct udma_dev *ud, struct udma_rflow *p) {
  __udma_put_rflow(ud, p);
}


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

x86 assembly (clang, -O2):
<xudma_rflow_put>:
jmp    1030 <__udma_put_rflow@plt>

LLVM IR (-O0):
%struct.udma_dev = type { i32 }
%struct.udma_rflow = type { i32 }
define void @xudma_rflow_put(%struct.udma_dev* %0, %struct.udma_rflow* %1) {
%3 = alloca %struct.udma_dev*
%4 = alloca %struct.udma_rflow*
store %struct.udma_dev* %0, %struct.udma_dev** %3
store %struct.udma_rflow* %1, %struct.udma_rflow** %4
%5 = load %struct.udma_dev*, %struct.udma_dev** %3
%6 = load %struct.udma_rflow*, %struct.udma_rflow** %4
%7 = call i32 @__udma_put_rflow(%struct.udma_dev* %5, %struct.udma_rflow* %6)
ret void
}

LLVM IR (-O2):
%struct.udma_dev = type { i32 }
%struct.udma_rflow = type { i32 }
define void @xudma_rflow_put(%struct.udma_dev* %0, %struct.udma_rflow* %1) {
%3 = tail call i32 @__udma_put_rflow(%struct.udma_dev* %0, %struct.udma_rflow* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void demo_error() {
  int value = 5;
  printf("Here's a print statement before quitting.\n");
  if (1) {
    printf("returning; there should be no further output.\n");
    return;
  }
  printf("This statement should not print, and does not.\n");
  switch (value) {
  case 5:
    printf("case 5: value = %d\n", value);
    break;
  case 0:
    printf("case 0: value=%d\n", value);
    break;
  }
  printf("This statement also should not and does not print.\n");
  return;
}


x86 assembly (clang, -O0):
<demo_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"Here's a print statement before quitting.\0A\00"
@.str.1 = [47 x i8] c"returning; there should be no further output.\0A\00"
define void @demo_error() {
%1 = alloca i32
store i32 5, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"Here's a print statement before quitting.\00"
@str.2 = [46 x i8] c"returning; there should be no further output.\00"
define void @demo_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret void
}
void ASN1_OCTET_STRING_set(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_OCTET_STRING_set() {
ret void
}
int *returnit(int *x) { return x; }


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

x86 assembly (clang, -O2):
<returnit>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @returnit(i32* readnone returned %0) {
ret i32* %0
}
int main() { return sizeof(float); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
char *iupStrGetMemory(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
scalar_t__ strlen(char const *);
char *iupStrReturnStr(const char *str) {
  if (str) {
    int size = (int)strlen(str) + 1;
    char *ret_str = iupStrGetMemory(size);
    memcpy(ret_str, str, size);
    return ret_str;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<iupStrReturnStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117f <iupStrReturnStr+0x4f>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <iupStrGetMemory@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <iupStrReturnStr+0x57>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrReturnStr>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     115d <iupStrReturnStr+0x2d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <iupStrGetMemory@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1160 <iupStrReturnStr+0x30>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @iupStrReturnStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i8* @iupStrGetMemory(i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = call i32 @memcpy(i8* %15, i8* %16, i32 %17)
%19 = load i8*, i8** %5
store i8* %19, i8** %2
br label %21
20: ; preds = %1
store i8* null, i8** %2
br label %21
21: ; preds = %20, %8
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @iupStrReturnStr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
%7 = tail call i8* @iupStrGetMemory(i32 %6)
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %6)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
void prefetch(const void *restrict x) {
  asm volatile("prefetcht0 %0" ::"m"(*(unsigned long *)x));
}


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

x86 assembly (clang, -O2):
<prefetch>:
prefetcht0 (%rdi)
ret

LLVM IR (-O0):
define void @prefetch(i8* noalias %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
ret void
}

LLVM IR (-O2):
define void @prefetch(i8* noalias %0) {
%2 = bitcast i8* %0 to i64*
tail call void asm sideeffect "prefetcht0 $0", "*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int psector_Read_RomPatchInfo(uint32_t *patch_region_sz,
                              uint32_t *patch_region_addr,
                              uint32_t *patch_checksum,
                              uint32_t *patch_checksum_valid) {
  int (*p_psector_Read_RomPatchInfo)(
      uint32_t * patch_region_sz, uint32_t * patch_region_addr,
      uint32_t * patch_checksum, uint32_t * patch_checksum_valid);
  p_psector_Read_RomPatchInfo = (int (*)(
      uint32_t * patch_region_sz, uint32_t * patch_region_addr,
      uint32_t * patch_checksum, uint32_t * patch_checksum_valid))0x03005209U;
  return p_psector_Read_RomPatchInfo(patch_region_sz, patch_region_addr,
                                     patch_checksum, patch_checksum_valid);
}


x86 assembly (clang, -O0):
<psector_Read_RomPatchInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x3005209,%eax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   *%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psector_Read_RomPatchInfo>:
mov    $0x3005209,%eax
jmp    *%rax

LLVM IR (-O0):
define i32 @psector_Read_RomPatchInfo(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32 (i32*, i32*, i32*, i32*)*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 (i32*, i32*, i32*, i32*)* inttoptr (i64 50352649 to i32 (i32*, i32*, i32*, i32*)*), i32 (i32*, i32*, i32*, i32*)** %9
%10 = load i32 (i32*, i32*, i32*, i32*)*, i32 (i32*, i32*, i32*, i32*)** %9
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = call i32 %10(i32* %11, i32* %12, i32* %13, i32* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @psector_Read_RomPatchInfo(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 inttoptr (i64 50352649 to i32 (i32*, i32*, i32*, i32*)*)(i32* %0, i32* %1, i32* %2, i32* %3)
ret i32 %5
}