xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int vuln(char *);
int main(int argc, char **argv) {
  if (argc <= 1) {
    fprintf(stderr, "Usage: %s <buffer>\n", argv[0]);
    exit(-1);
  }
  exit(vuln(argv[1]));
}


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)
cmpl   $0x1,-0x8(%rbp)
jg     1176 <main+0x46>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <vuln@plt>
mov    %eax,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1158 <main+0x28>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1030 <vuln@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s <buffer>\0A\00"
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 = load i32, i32* %4
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @vuln(i8* %18)
%20 = call i32 @exit(i32 %19)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s <buffer>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @vuln(i8* %11)
%13 = tail call i32 @exit(i32 %12)
unreachable
}
void string_copy(char *dest, char *src) {
  while (*src != '\0') {
    *dest = *src;
    dest++;
    src++;
  }
}


x86 assembly (clang, -O0):
<string_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <string_copy+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <string_copy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_copy>:
mov    (%rsi),%al
test   %al,%al
je     1120 <string_copy+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <string_copy+0x10>
ret

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

LLVM IR (-O2):
define void @string_copy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void main(void) { puts("\nHello, world!\n\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"\0AHello, world!\0A\0A\00"
define void @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0AHello, world!\0A\0A\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void RGB01toRGB0255(double r, double g, double b, double *r2, double *g2,
                    double *b2) {
  *r2 = r * 255.;
  *g2 = g * 255.;
  *b2 = b * 255.;
}


x86 assembly (clang, -O0):
<RGB01toRGB0255>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  0xed9(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xec4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xeaf(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB01toRGB0255>:
movsd  0xef8(%rip),%xmm3
mulsd  %xmm3,%xmm0
movsd  %xmm0,(%rdi)
mulsd  %xmm3,%xmm1
movsd  %xmm1,(%rsi)
mulsd  %xmm3,%xmm2
movsd  %xmm2,(%rdx)
ret

LLVM IR (-O0):
define void @RGB01toRGB0255(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double, double* %7
%14 = fmul double %13, 2.550000e+02
%15 = load double*, double** %10
store double %14, double* %15
%16 = load double, double* %8
%17 = fmul double %16, 2.550000e+02
%18 = load double*, double** %11
store double %17, double* %18
%19 = load double, double* %9
%20 = fmul double %19, 2.550000e+02
%21 = load double*, double** %12
store double %20, double* %21
ret void
}

LLVM IR (-O2):
define void @RGB01toRGB0255(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fmul double %0, 2.550000e+02
store double %7, double* %3
%8 = fmul double %1, 2.550000e+02
store double %8, double* %4
%9 = fmul double %2, 2.550000e+02
store double %9, double* %5
ret void
}
int scamper_if_getifindex_byaddr(const struct sockaddr *addr, int *ifindex) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.sockaddr = type opaque
define i32 @scamper_if_getifindex_byaddr(%struct.sockaddr* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int INT_MIN;
int main(void) {
  INT_MIN % -1;
  return 0;
}


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

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

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @INT_MIN
%3 = srem i32 %2, -1
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @main() {
ret i32 0
}
void sh_eth_soft_swap(char *src, int len) {}


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

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

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

LLVM IR (-O2):
define void @sh_eth_soft_swap(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ wait_for_ok(int);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void send_unknown_command_received(int sfd) {
  char header[] = "########################################\n"
                  "            UNKNOWN COMMAND             \n"
                  "########################################\n"
                  "Please double check your command.\n";
  write(sfd, header, strlen(header));
  wait_for_ok(sfd);
}


x86 assembly (clang, -O0):
<send_unknown_command_received>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xea4(%rip),%rsi
mov    $0x9e,%edx
call   1050 <memcpy@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xbc(%rbp)
lea    -0xb0(%rbp),%rax
mov    %rax,-0xb8(%rbp)
lea    -0xb0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xbc(%rbp),%edi
mov    -0xb8(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
call   1060 <wait_for_ok@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_unknown_command_received>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
mov    %edi,%ebx
lea    0xead(%rip),%rsi
mov    %rsp,%r14
mov    $0x9e,%edx
mov    %r14,%rdi
call   1050 <memcpy@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1060 <wait_for_ok@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.send_unknown_command_received.header = [158 x i8] c"########################################\0A UNKNOWN COMMAND \0A########################################\0APlease double check your command.\0A\00"
define void @send_unknown_command_received(i32 %0) {
%2 = alloca i32
%3 = alloca [158 x i8]
store i32 %0, i32* %2
%4 = bitcast [158 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [158 x i8], [158 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [158 x i8], [158 x i8]* %3, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @wait_for_ok(i32 %10)
ret void
}

LLVM IR (-O2):
@__const.send_unknown_command_received.header = [158 x i8] c"########################################\0A UNKNOWN COMMAND \0A########################################\0APlease double check your command.\0A\00"
define void @send_unknown_command_received(i32 %0) {
%2 = alloca [158 x i8]
%3 = getelementptr inbounds [158 x i8], [158 x i8]* %2, i64 0, i64 0
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @write(i32 %0, i8* %3, i32 %4)
%6 = call i32 @wait_for_ok(i32 %0)
ret void
}
/* Variables and functions */
unsigned int fmt_ulong(char *, unsigned int);
unsigned int fmt_uint(char *s, unsigned int u) { return fmt_ulong(s, u); }


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

x86 assembly (clang, -O2):
<fmt_uint>:
jmp    1030 <fmt_ulong@plt>

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

LLVM IR (-O2):
define i32 @fmt_uint(i8* %0, i32 %1) {
%3 = tail call i32 @fmt_ulong(i8* %0, i32 %1)
ret i32 %3
}
double ReturnDoubleFromLongDouble(long double ld) { return ld; }


x86 assembly (clang, -O0):
<ReturnDoubleFromLongDouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnDoubleFromLongDouble>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @ReturnDoubleFromLongDouble(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @ReturnDoubleFromLongDouble(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void lfree(void *ptr) {
  if (ptr == NULL)
    return;
  free(ptr);
}


x86 assembly (clang, -O0):
<lfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <lfree+0x1c>
jmp    1135 <lfree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfree>:
test   %rdi,%rdi
je     111a <lfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @lfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @lfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void prindi(int i) { printf("%i", i); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @prindi(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double exp(double);
double infHN(double A, double B, double V) {
  return 1.0 / (1.0 + exp((V - A) / B));
}


x86 assembly (clang, -O0):
<infHN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xebd(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<infHN>:
push   %rax
subsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1030 <exp@plt>
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @infHN(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %4
%9 = fsub double %7, %8
%10 = load double, double* %5
%11 = fdiv double %9, %10
%12 = call double @exp(double %11)
%13 = fadd double 1.000000e+00, %12
%14 = fdiv double 1.000000e+00, %13
ret double %14
}

LLVM IR (-O2):
define double @infHN(double %0, double %1, double %2) {
%4 = fsub double %2, %0
%5 = fdiv double %4, %1
%6 = tail call double @exp(double %5)
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double 1.000000e+00, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ CANBaseValid(unsigned long);
unsigned long CANIntNumberGet(unsigned long);
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
void CANIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  unsigned long ulIntNumber;
  DEBUG_ASSERT(CANBaseValid(ulBase));
  ulIntNumber = CANIntNumberGet(ulBase);
  IntRegister(ulIntNumber, pfnHandler);
  IntEnable(ulIntNumber);
}


x86 assembly (clang, -O0):
<CANIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <CANBaseValid@plt>
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1070 <CANIntNumberGet@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntRegister>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <CANBaseValid@plt>
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1070 <CANIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <IntRegister@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @CANIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
%5 = alloca i64
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%6 = load i64, i64* %3
%7 = call i32 @CANBaseValid(i64 %6)
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %3
%10 = call i64 @CANIntNumberGet(i64 %9)
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load void ()*, void ()** %4
%13 = bitcast void ()* %12 to void (...)*
%14 = call i32 @IntRegister(i64 %11, void (...)* %13)
%15 = load i64, i64* %5
%16 = call i32 @IntEnable(i64 %15)
ret void
}

LLVM IR (-O2):
define void @CANIntRegister(i64 %0, void ()* %1) {
%3 = tail call i32 @CANBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = tail call i64 @CANIntNumberGet(i64 %0)
%6 = bitcast void ()* %1 to void (...)*
%7 = tail call i32 @IntRegister(i64 %5, void (...)* %6)
%8 = tail call i32 @IntEnable(i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(float, float);
void sumProd(int n) {
  float sum = 0.0;
  float prod = 1.0;
  int i = 0;
  while (i <= n) {
    sum = sum + i;
    prod = prod * i;
    foo(sum, prod);
    i++;
  }
}


x86 assembly (clang, -O0):
<sumProd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1186 <sumProd+0x76>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <foo@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <sumProd+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumProd>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1161 <sumProd+0x51>
mov    %edi,%ebx
add    $0x1,%ebx
xorps  %xmm0,%xmm0
movss  0xed9(%rip),%xmm1
xor    %ebp,%ebp
nopl   0x0(%rax)
xorps  %xmm2,%xmm2
cvtsi2ss %ebp,%xmm2
addss  %xmm2,%xmm0
movss  %xmm0,0x4(%rsp)
mulss  %xmm2,%xmm1
movss  %xmm1,(%rsp)
call   1030 <foo@plt>
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm0
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <sumProd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @sumProd(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %2
store float 0.000000e+00, float* %3
store float 1.000000e+00, float* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load float, float* %3
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to float
%14 = fadd float %11, %13
store float %14, float* %3
%15 = load float, float* %4
%16 = load i32, i32* %5
%17 = sitofp i32 %16 to float
%18 = fmul float %15, %17
store float %18, float* %4
%19 = load float, float* %3
%20 = load float, float* %4
%21 = call i32 @foo(float %19, float %20)
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @sumProd(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi float [ %9, %3 ], [ 1.000000e+00, %1 ]
%6 = phi float [ %8, %3 ], [ 0.000000e+00, %1 ]
%7 = sitofp i32 %4 to float
%8 = fadd float %6, %7
%9 = fmul float %5, %7
%10 = tail call i32 @foo(float %8, float %9)
%11 = add nuw i32 %4, 1
%12 = icmp eq i32 %4, %0
br i1 %12, label %13, label %3
13: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
long kernel___Char_cp___impl(uint32_t self) { return (long)self; }


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

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

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

LLVM IR (-O2):
define i64 @kernel___Char_cp___impl(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef char *uint64_t;
typedef char *uint32_t;

/* Variables and functions */
uint64_t rdmsr32(uint32_t msr) {
  uint32_t r;
  __asm__ __volatile__("rdmsr" : "=a"(r) : "c"(msr) : "edx");
  return r;
}


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

x86 assembly (clang, -O2):
<rdmsr32>:
mov    %rdi,%rcx
rdmsr
ret

LLVM IR (-O0):
define i8* @rdmsr32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm sideeffect "rdmsr", "={ax},{cx},~{edx},~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @rdmsr32(i8* %0) {
%2 = tail call i8* asm sideeffect "rdmsr", "={ax},{cx},~{edx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_mem(void *block) {
  if (*(void **)block == NULL)
    return;
  free(*(void **)block);
  (*(void **)block) = NULL;
}


x86 assembly (clang, -O0):
<free_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    112f <free_mem+0x1f>
jmp    1146 <free_mem+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mem>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <free_mem+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_mem(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
store i8* null, i8** %2
br label %7
7: ; preds = %1, %5
ret void
}
int test_imm_E8int8_reg(signed char val) {
  return ((val) & (-0xE8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E8int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff18,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E8int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -232
%6 = icmp ne i32 %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_E8int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -232
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo1(int, int);
int main() { foo1(7, 702); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0x2be,%esi
call   1030 <foo1@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
mov    $0x2be,%esi
call   1030 <foo1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo1(i32 7, i32 702)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo1(i32 7, i32 702)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
scalar_t__ sysconf(int /*<<< orphan*/);
size_t vm_roundup(size_t n) {
  static size_t pagesize = 0;
  if (!pagesize)
    pagesize = (size_t)sysconf(_SC_PAGESIZE);
  return (n + pagesize - 1) & ~(pagesize - 1);
}


x86 assembly (clang, -O0):
<vm_roundup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2f0c(%rip)
jne    113f <vm_roundup+0x2f>
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,0x2ef1(%rip)
mov    -0x8(%rbp),%rax
add    0x2ee6(%rip),%rax
sub    $0x1,%rax
mov    0x2edb(%rip),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vm_roundup>:
push   %rbx
mov    %rdi,%rbx
mov    0x2f15(%rip),%rax
test   %rax,%rax
jne    1135 <vm_roundup+0x25>
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,0x2efb(%rip)
lea    (%rbx,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
neg    %rax
and    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@vm_roundup.pagesize = internal global i64 0
@_SC_PAGESIZE = global i32 0
define i64 @vm_roundup(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* @vm_roundup.pagesize
%4 = icmp ne i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @_SC_PAGESIZE
%7 = call i64 @sysconf(i32 %6)
store i64 %7, i64* @vm_roundup.pagesize
br label %8
8: ; preds = %5, %1
%9 = load i64, i64* %2
%10 = load i64, i64* @vm_roundup.pagesize
%11 = add i64 %9, %10
%12 = sub i64 %11, 1
%13 = load i64, i64* @vm_roundup.pagesize
%14 = sub i64 %13, 1
%15 = xor i64 %14, -1
%16 = and i64 %12, %15
ret i64 %16
}

LLVM IR (-O2):
@vm_roundup.pagesize = internal unnamed_addr global i64 0
@_SC_PAGESIZE = global i32 0
define i64 @vm_roundup(i64 %0) {
%2 = load i64, i64* @vm_roundup.pagesize
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @_SC_PAGESIZE
%6 = tail call i64 @sysconf(i32 %5)
store i64 %6, i64* @vm_roundup.pagesize
br label %7
7: ; preds = %4, %1
%8 = phi i64 [ %6, %4 ], [ %2, %1 ]
%9 = add i64 %0, -1
%10 = add i64 %9, %8
%11 = sub i64 0, %8
%12 = and i64 %10, %11
ret i64 %12
}
/* Variables and functions */
int atoi(char const *);
int get_int(const char *val, int default_val) {
  if (NULL == val)
    return default_val;
  return atoi(val);
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1136 <get_int+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <get_int+0x32>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
test   %rdi,%rdi
je     111a <get_int+0xa>
jmp    1030 <atoi@plt>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_int(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @atoi(i8* %0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ find_track(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strip_linefeed(char *);
int main() {
  char search_for[80];
  printf("Search for : ");
  fgets(search_for, 80, stdin);
  strip_linefeed(search_for);
  find_track(search_for);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1060 <fgets@plt>
lea    -0x60(%rbp),%rdi
call   1030 <strip_linefeed@plt>
lea    -0x60(%rbp),%rdi
call   1040 <find_track@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strip_linefeed@plt>
mov    %rbx,%rdi
call   1040 <find_track@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Search for : \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 80, i32 %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @strip_linefeed(i8* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%10 = call i32 @find_track(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Search for : \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 80, i32 %4)
%6 = call i32 @strip_linefeed(i8* %2)
%7 = call i32 @find_track(i8* %2)
ret i32 0
}
char *valloc(size)
unsigned size;
{
  extern char *malloc();
  return (malloc(size));
}


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

x86 assembly (clang, -O2):
<valloc>:
xor    %eax,%eax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @valloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @valloc(i32 %0) {
%2 = tail call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ strlen(char *);
int strlonger(char *s, char *t) { return strlen(s) - strlen(t) > 0; }


x86 assembly (clang, -O0):
<strlonger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlonger>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setg   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strlonger(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 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = sub nsw i64 %6, %8
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @strlonger(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp sgt i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void Var_InitLevel(void) {}


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

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

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

LLVM IR (-O2):
define void @Var_InitLevel() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *, ...);
void branchFalse(char *label) {
  emitln("test\t%%eax,%%eax");
  emitln("je\t%s", label);
}


x86 assembly (clang, -O0):
<branchFalse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <emitln@plt>
mov    -0x8(%rbp),%rsi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <emitln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<branchFalse>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <emitln@plt>
lea    0xee8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"test\09%%eax,%%eax\00"
@.str.1 = [6 x i8] c"je\09%s\00"
define void @branchFalse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @emitln(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @emitln(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"test\09%%eax,%%eax\00"
@.str.1 = [6 x i8] c"je\09%s\00"
define void @branchFalse(i8* %0) {
%2 = tail call i32 (i8*, ...) @emitln(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @emitln(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wifi_check_qcom_cfg_files();
int main(void) {
  wifi_check_qcom_cfg_files();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <wifi_check_qcom_cfg_files@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @wifi_check_qcom_cfg_files()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void btktermio_show_cursor(void) { printf("\033[?25h"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
define void @btktermio_show_cursor() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(int);
void *wrapper() {
  void *x = malloc(100);
  if (x)
    return x;
  return 0;
}


x86 assembly (clang, -O0):
<wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <wrapper+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <wrapper+0x36>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper>:
mov    $0x64,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @wrapper() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 100)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i8*, i8** %2
store i8* %7, i8** %1
br label %9
8: ; preds = %0
store i8* null, i8** %1
br label %9
9: ; preds = %8, %6
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @wrapper() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
ret i8* %1
}
int gfx_set_tv_cc_data(unsigned char data1, unsigned char data2) { return (0); }


x86 assembly (clang, -O0):
<gfx_set_tv_cc_data>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gfx_set_tv_cc_data(i8 zeroext %0, i8 zeroext %1) {
ret i32 0
}
int choose(int n, int k) {
  if (k == 1) {
    return n;
  }
  return (choose(n - 1, k - 1) * n) / k;
}


x86 assembly (clang, -O0):
<choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1133 <choose+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <choose+0x3f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <choose@plt>
imul   -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x1,%esi
je     1133 <choose+0x23>
mov    %esi,%r14d
lea    -0x1(%rbx),%edi
lea    -0x1(%r14),%esi
call   1030 <choose@plt>
imul   %ebx,%eax
cltd
idiv   %r14d
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @choose(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi i32 [ %11, %6 ], [ %0, %2 ]
ret i32 %5
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = add nsw i32 %1, -1
%9 = tail call i32 @choose(i32 %7, i32 %8)
%10 = mul nsw i32 %9, %0
%11 = sdiv i32 %10, %1
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void osslib_close(int fd) { close(fd); }


x86 assembly (clang, -O0):
<osslib_close>:
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):
<osslib_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @osslib_close(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 @osslib_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void list_belkin_supported_models() {
  printf("Supported Belkin targets:\n"
         "SSID pattern: Belkin.xxxx, belkin.xxxx, belkin.xxx\n"
         "[!] Not all are supported\n"
         "[+] F7K*\n"
         "[+] F9K*\n");
}


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

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

LLVM IR (-O0):
@.str = [122 x i8] c"Supported Belkin targets:\0ASSID pattern: Belkin.xxxx, belkin.xxxx, belkin.xxx\0A[!] Not all are supported\0A[+] F7K*\0A[+] F9K*\0A\00"
define void @list_belkin_supported_models() {
%1 = call i32 @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [121 x i8] c"Supported Belkin targets:\0ASSID pattern: Belkin.xxxx, belkin.xxxx, belkin.xxx\0A[!] Not all are supported\0A[+] F7K*\0A[+] F9K*\00"
define void @list_belkin_supported_models() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([121 x i8], [121 x i8]* @str, i64 0, i64 0))
ret void
}
int base64_est_encode_size_bytes(int raw_size_bytes) {
  int length;
  length =
      ((((raw_size_bytes * 4 + 2) / 3) + 3) & ~(0x3)) + raw_size_bytes / 76;
  return length;
}


x86 assembly (clang, -O0):
<base64_est_encode_size_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x3,%eax
and    $0xfffffffc,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_est_encode_size_bytes>:
lea    0x2(,%rdi,4),%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x3f,%rax
add    %eax,%ecx
add    $0x3,%ecx
and    $0xfffffffc,%ecx
movslq %edi,%rax
imul   $0x6bca1af3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @base64_est_encode_size_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 4
%6 = add nsw i32 %5, 2
%7 = sdiv i32 %6, 3
%8 = add nsw i32 %7, 3
%9 = and i32 %8, -4
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 76
%12 = add nsw i32 %9, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @base64_est_encode_size_bytes(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = or i32 %2, 2
%4 = sdiv i32 %3, 3
%5 = add nsw i32 %4, 3
%6 = and i32 %5, -4
%7 = sdiv i32 %0, 76
%8 = add nsw i32 %6, %7
ret i32 %8
}
float nearbyintf(float x) { return __builtin_nearbyintf(x); }


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

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

LLVM IR (-O0):
define float @nearbyintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.nearbyint.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = tail call float @llvm.nearbyint.f32(float %0)
ret float %2
}
int test_imm_FBuint16_reg(unsigned short val) {
  return ((val) & (0xFB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FBuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xfb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FBuint16_reg>:
test   $0xfb,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FBuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 251
%6 = icmp ne i32 %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_FBuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 251
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ fopen(char *, char *);
void *SCHalFileOpen(char *path, char *flag) {
  return (void *)fopen(path, flag);
}


x86 assembly (clang, -O0):
<SCHalFileOpen>:
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 <fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCHalFileOpen>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i8* @SCHalFileOpen(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 = call i64 @fopen(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @SCHalFileOpen(i8* %0, i8* %1) {
%3 = tail call i64 @fopen(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
double linearInterpolationd(double p) { return p; }


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

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

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

LLVM IR (-O2):
define double @linearInterpolationd(double returned %0) {
ret double %0
}
int f$$1(struct _Data$$1 *this$1) { return 20; }


x86 assembly (clang, -O0):
<f$$1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x14,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f$$1>:
mov    $0x14,%eax
ret

LLVM IR (-O0):
%"struct._Data$$1" = type opaque
define i32 @"f$$1"(%"struct._Data$$1"* %0) {
%2 = alloca %"struct._Data$$1"*
store %"struct._Data$$1"* %0, %"struct._Data$$1"** %2
ret i32 20
}

LLVM IR (-O2):
%"struct._Data$$1" = type opaque
define i32 @"f$$1"(%"struct._Data$$1"* nocapture readnone %0) {
ret i32 20
}
void sentinel(void) { return; }


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

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

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

LLVM IR (-O2):
define void @sentinel() {
ret void
}