xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "du"
        " [-a | -s][-kx][-H | -L][file...]\n  -a	Report the size of "
        "every file encountered\n  -s	Report only the total sum for each of "
        "the specified files\n  -k	Write the file sizes in units of 1024 "
        "bytes rather than 512\n  -x	Evaluate file sizes only on the same "
        "device as the file specified\n  -H	Dereference specified files\n  "
        "-L	Dereference every file evaluated\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [361 x i8] c"Usage: du [-a | -s][-kx][-H | -L][file...]\0A -a\09Report the size of every file encountered\0A -s\09Report only the total sum for each of the specified files\0A -k\09Write the file sizes in units of 1024 bytes rather than 512\0A -x\09Evaluate file sizes only on the same device as the file specified\0A -H\09Dereference specified files\0A -L\09Dereference every file evaluated\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [361 x i8] c"Usage: du [-a | -s][-kx][-H | -L][file...]\0A -a\09Report the size of every file encountered\0A -s\09Report only the total sum for each of the specified files\0A -k\09Write the file sizes in units of 1024 bytes rather than 512\0A -x\09Evaluate file sizes only on the same device as the file specified\0A -H\09Dereference specified files\0A -L\09Dereference every file evaluated\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
double innermost_planet(stellar_mass_ratio)
double stellar_mass_ratio;
{ return (0.3 * pow(stellar_mass_ratio, (1.0 / 3.0))); }


x86 assembly (clang, -O0):
<innermost_planet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<innermost_planet>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @innermost_planet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FD5555555555555)
%5 = fmul double 3.000000e-01, %4
ret double %5
}

LLVM IR (-O2):
define double @innermost_planet(double %0) {
%2 = tail call double @pow(double %0, double 0x3FD5555555555555)
%3 = fmul double %2, 3.000000e-01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void crash() {
  fprintf(stderr, "\n----------\nUMLBox is crashing!\n----------\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<crash>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"\0A----------\0AUMLBox is crashing!\0A----------\0A\0A\00"
define void @crash() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"\0A----------\0AUMLBox is crashing!\0A----------\0A\0A\00"
define void @crash() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void marshall(int p, char *s) {
  s[0] = p / 10 + 'A';
  s[1] = p % 10 + '1';
  s[2] = '\0';
}


x86 assembly (clang, -O0):
<marshall>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x41,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x31,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<marshall>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    0x41(%rcx),%edx
mov    %dl,(%rsi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x31,%al
mov    %al,0x1(%rsi)
movb   $0x0,0x2(%rsi)
ret

LLVM IR (-O0):
define void @marshall(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 10
%7 = add nsw i32 %6, 65
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %3
%12 = srem i32 %11, 10
%13 = add nsw i32 %12, 49
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 0, i8* %18
ret void
}

LLVM IR (-O2):
define void @marshall(i32 %0, i8* nocapture writeonly %1) {
%3 = sdiv i32 %0, 10
%4 = trunc i32 %3 to i8
%5 = add i8 %4, 65
store i8 %5, i8* %1
%6 = srem i32 %0, 10
%7 = trunc i32 %6 to i8
%8 = add nsw i8 %7, 49
%9 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 0, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int sig) { printf("Received signal: %d\n", sig); }


x86 assembly (clang, -O0):
<handler>:
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):
<handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"Received signal: %d\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int least_amount_of_cash_r(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", least_amount_of_cash_r(1927));
  return 0;
}


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)
mov    $0x787,%edi
call   1040 <least_amount_of_cash_r@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 = call i32 @least_amount_of_cash_r(i32 1927)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @least_amount_of_cash_r(i32 1927)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void do_cancel(void) {}


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

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

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

LLVM IR (-O2):
define void @do_cancel() {
ret void
}
int f_ble_rc2(float a1) { return !(__builtin_islessequal(a1, 100)); }


x86 assembly (clang, -O0):
<f_ble_rc2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ble_rc2>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @f_ble_rc2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ole float %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_ble_rc2(float %0) {
%2 = fcmp ugt float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
int test3() {
  const unsigned char *bp;
  bp -= (short)1;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test3() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ handle_PIPE(int /*<<< orphan*/);
int gen_PIPE() {
  handle_PIPE(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_PIPE>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_PIPE@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_PIPE() {
%1 = call i32 @handle_PIPE(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_PIPE() {
%1 = tail call i32 @handle_PIPE(i32 0)
ret i32 0
}
int assignBin(double val, double minVal, double maxVal, int binCount) {
  double range = maxVal - minVal;
  int maxBin = binCount - 1;
  int level = (int)((val - minVal) * maxBin / range);
  if (level <= 0)
    level = 0;
  if (level > maxBin)
    level = maxBin;
  return level;
}


x86 assembly (clang, -O0):
<assignBin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jg     115e <assignBin+0x5e>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    1170 <assignBin+0x70>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assignBin>:
subsd  %xmm1,%xmm2
lea    -0x1(%rdi),%ecx
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mulsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edx
xor    %eax,%eax
test   %edx,%edx
cmovns %edx,%eax
cmp    %edi,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @assignBin(double %0, double %1, double %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
%12 = load double, double* %7
%13 = load double, double* %6
%14 = fsub double %12, %13
store double %14, double* %9
%15 = load i32, i32* %8
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %10
%17 = load double, double* %5
%18 = load double, double* %6
%19 = fsub double %17, %18
%20 = load i32, i32* %10
%21 = sitofp i32 %20 to double
%22 = fmul double %19, %21
%23 = load double, double* %9
%24 = fdiv double %22, %23
%25 = fptosi double %24 to i32
store i32 %25, i32* %11
%26 = load i32, i32* %11
%27 = icmp sle i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %4
store i32 0, i32* %11
br label %29
29: ; preds = %28, %4
%30 = load i32, i32* %11
%31 = load i32, i32* %10
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = load i32, i32* %10
store i32 %34, i32* %11
br label %35
35: ; preds = %33, %29
%36 = load i32, i32* %11
ret i32 %36
}

LLVM IR (-O2):
define i32 @assignBin(double %0, double %1, double %2, i32 %3) {
%5 = fsub double %2, %1
%6 = add nsw i32 %3, -1
%7 = fsub double %0, %1
%8 = sitofp i32 %6 to double
%9 = fmul double %7, %8
%10 = fdiv double %9, %5
%11 = fptosi double %10 to i32
%12 = icmp sgt i32 %11, 0
%13 = select i1 %12, i32 %11, i32 0
%14 = icmp slt i32 %13, %3
%15 = select i1 %14, i32 %13, i32 %6
ret i32 %15
}
void stats_atomic_inc(int var) { int t = 0, tmp = 0; }


x86 assembly (clang, -O0):
<stats_atomic_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @stats_atomic_inc(i32 %0) {
ret void
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ st_push(struct forth_instance *, int);
void fork_func(struct forth_instance *fi) { st_push(fi, (int)fork()); }


x86 assembly (clang, -O0):
<fork_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <st_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_func>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @fork_func(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = call i64 (...) @fork()
%5 = trunc i64 %4 to i32
%6 = call i32 @st_push(%struct.forth_instance* %3, i32 %5)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @fork_func(%struct.forth_instance* %0) {
%2 = tail call i64 (...) @fork()
%3 = trunc i64 %2 to i32
%4 = tail call i32 @st_push(%struct.forth_instance* %0, i32 %3)
ret void
}
short int shortint_ignoring_unsignedlonglong(short int x,
                                             unsigned long long y) {
  return x;
}


x86 assembly (clang, -O0):
<shortint_ignoring_unsignedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortint_ignoring_unsignedlonglong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @shortint_ignoring_unsignedlonglong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @shortint_ignoring_unsignedlonglong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
void _nss_ldap_dns_free_data(struct dns_reply *r) {}


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

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

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

LLVM IR (-O2):
%struct.dns_reply = type opaque
define void @_nss_ldap_dns_free_data(%struct.dns_reply* nocapture %0) {
ret void
}
/* Variables and functions */
int abs(int);
int algoritmoEuclide(int, int);
int minimoComuneMultiplo(int primoNumero, int secondoNumero) {
  int mcd = algoritmoEuclide(primoNumero, secondoNumero);
  return abs((primoNumero * secondoNumero) / mcd);
}


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

x86 assembly (clang, -O2):
<minimoComuneMultiplo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <algoritmoEuclide@plt>
mov    %eax,%ecx
imul   %ebp,%ebx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @minimoComuneMultiplo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @algoritmoEuclide(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
%14 = call i32 @abs(i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @minimoComuneMultiplo(i32 %0, i32 %1) {
%3 = tail call i32 @algoritmoEuclide(i32 %0, i32 %1)
%4 = mul nsw i32 %1, %0
%5 = sdiv i32 %4, %3
%6 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int yylex();
int main(int argc, char **argv) {
  int val;
  while (val = yylex())
    printf("value is %d\n", val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <yylex@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     115d <main+0x3d>
mov    -0x14(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <yylex@plt>
test   %eax,%eax
je     1155 <main+0x35>
lea    0xecd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <yylex@plt>
test   %eax,%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"value is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @yylex()
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @yylex()
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ configurePatchOok();
int /*<<< orphan*/ enterCpePatchOok();
int /*<<< orphan*/ enterSysPatchOok();
void rf_patch_cpe_genook(void) {
  enterSysPatchOok();
  enterCpePatchOok();
  configurePatchOok();
}


x86 assembly (clang, -O0):
<rf_patch_cpe_genook>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <enterSysPatchOok@plt>
mov    $0x0,%al
call   1040 <enterCpePatchOok@plt>
mov    $0x0,%al
call   1030 <configurePatchOok@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rf_patch_cpe_genook>:
push   %rax
xor    %eax,%eax
call   1050 <enterSysPatchOok@plt>
xor    %eax,%eax
call   1040 <enterCpePatchOok@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <configurePatchOok@plt>

LLVM IR (-O0):
define void @rf_patch_cpe_genook() {
%1 = call i32 (...) @enterSysPatchOok()
%2 = call i32 (...) @enterCpePatchOok()
%3 = call i32 (...) @configurePatchOok()
ret void
}

LLVM IR (-O2):
define void @rf_patch_cpe_genook() {
%1 = tail call i32 (...) @enterSysPatchOok()
%2 = tail call i32 (...) @enterCpePatchOok()
%3 = tail call i32 (...) @configurePatchOok()
ret void
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_128 {
  int dummy;
};

/* Variables and functions */
int pcg_oneseq_128_xsl_rr_64_random_r(struct pcg_state_128 *);
uint64_t pcg_oneseq_128_xsl_rr_64_boundedrand_r(struct pcg_state_128 *rng,
                                                uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_oneseq_128_xsl_rr_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_oneseq_128_xsl_rr_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_oneseq_128_xsl_rr_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_oneseq_128_xsl_rr_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_oneseq_128_xsl_rr_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_oneseq_128_xsl_rr_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_oneseq_128_xsl_rr_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_oneseq_128_xsl_rr_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.pcg_state_128 = type { i32 }
define i32 @pcg_oneseq_128_xsl_rr_64_boundedrand_r(%struct.pcg_state_128* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_oneseq_128_xsl_rr_64_random_r(%struct.pcg_state_128* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
char *strstr(char *, char *);
int strpos(char *haystack, char *needle) {
  char *p = strstr(haystack, needle);
  if (p) {
    return p - haystack;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114f <strpos+0x3f>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1156 <strpos+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int send(int, char *, scalar_t__, int /*<<< orphan*/);
scalar_t__ strlen(char *);
void client_conn(int socketfd) {
  char *msg = "testmessage";
  if (send(socketfd, msg, strlen(msg) + 1, 0) == -1) {
    printf("Failed to send message\n");
  } else {
    printf("Sent message\n");
  }
}


x86 assembly (clang, -O0):
<client_conn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
jne    118c <client_conn+0x5c>
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
jmp    1198 <client_conn+0x68>
lea    0xe91(%rip),%rdi
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_conn>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0xc,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0xffffffff,%eax
lea    0xedb(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"testmessage\00"
@.str.1 = [24 x i8] c"Failed to send message\0A\00"
@.str.2 = [14 x i8] c"Sent message\0A\00"
define void @client_conn(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = call i32 @send(i32 %4, i8* %5, i64 %8, i32 0)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %1
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"testmessage\00"
@str = [13 x i8] c"Sent message\00"
@str.3 = [23 x i8] c"Failed to send message\00"
define void @client_conn(i32 %0) {
%2 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 12, i32 0)
%3 = icmp eq i32 %2, -1
%4 = select i1 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
int NUL_Poll(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @NUL_Poll() {
ret i32 0
}

LLVM IR (-O2):
define i32 @NUL_Poll() {
ret i32 0
}
/* Variables and functions */
int check_adc_read(int, int, char *);
int utwente_adc(int channel, int simulated_value) {
  return check_adc_read(channel, simulated_value, "adc");
}


x86 assembly (clang, -O0):
<utwente_adc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdx
call   1030 <check_adc_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utwente_adc>:
lea    0xee9(%rip),%rdx
jmp    1030 <check_adc_read@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"adc\00"
define i32 @utwente_adc(i32 %0, i32 %1) {
%3 = tail call i32 @check_adc_read(i32 %0, i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
struct kore_json {
  int dummy;
};

/* Variables and functions */
int json_next_byte(struct kore_json *, int /*<<< orphan*/ *, int);
int json_peek(struct kore_json *json, u_int8_t *ch) {
  return (json_next_byte(json, ch, 1));
}


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

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

LLVM IR (-O0):
%struct.kore_json = type { i32 }
define i32 @json_peek(%struct.kore_json* %0, i32* %1) {
%3 = alloca %struct.kore_json*
%4 = alloca i32*
store %struct.kore_json* %0, %struct.kore_json** %3
store i32* %1, i32** %4
%5 = load %struct.kore_json*, %struct.kore_json** %3
%6 = load i32*, i32** %4
%7 = call i32 @json_next_byte(%struct.kore_json* %5, i32* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.kore_json = type { i32 }
define i32 @json_peek(%struct.kore_json* %0, i32* %1) {
%3 = tail call i32 @json_next_byte(%struct.kore_json* %0, i32* %1, i32 1)
ret i32 %3
}
/* Type definitions */
struct rtc_time {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int ds1672_get_datetime(int /*<<< orphan*/, struct rtc_time *);
int /*<<< orphan*/ to_i2c_client(struct device *);
int ds1672_rtc_read_time(struct device *dev, struct rtc_time *tm) {
  return ds1672_get_datetime(to_i2c_client(dev), tm);
}


x86 assembly (clang, -O0):
<ds1672_rtc_read_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <to_i2c_client@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <ds1672_get_datetime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1672_rtc_read_time>:
push   %rbx
mov    %rsi,%rbx
call   1030 <to_i2c_client@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ds1672_get_datetime@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.rtc_time = type { i32 }
define i32 @ds1672_rtc_read_time(%struct.device* %0, %struct.rtc_time* %1) {
%3 = alloca %struct.device*
%4 = alloca %struct.rtc_time*
store %struct.device* %0, %struct.device** %3
store %struct.rtc_time* %1, %struct.rtc_time** %4
%5 = load %struct.device*, %struct.device** %3
%6 = call i32 @to_i2c_client(%struct.device* %5)
%7 = load %struct.rtc_time*, %struct.rtc_time** %4
%8 = call i32 @ds1672_get_datetime(i32 %6, %struct.rtc_time* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.rtc_time = type { i32 }
define i32 @ds1672_rtc_read_time(%struct.device* %0, %struct.rtc_time* %1) {
%3 = tail call i32 @to_i2c_client(%struct.device* %0)
%4 = tail call i32 @ds1672_get_datetime(i32 %3, %struct.rtc_time* %1)
ret i32 %4
}
void foo424() {}


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

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

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

LLVM IR (-O2):
define void @foo424() {
ret void
}
unsigned av_mod_uintp2_c(unsigned a, unsigned p) { return a & ((1 << p) - 1); }


x86 assembly (clang, -O0):
<av_mod_uintp2_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_mod_uintp2_c>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @av_mod_uintp2_c(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 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @av_mod_uintp2_c(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
int wpas_binder_register_interface(struct wpa_supplicant *wpa_s) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @wpas_binder_register_interface(%struct.wpa_supplicant* nocapture readnone %0) {
ret i32 0
}
void rv2or_rv() {}


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

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

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

LLVM IR (-O2):
define void @rv2or_rv() {
ret void
}
/* Variables and functions */
int testLib1();
int testLib2(void) { return testLib1(); }


x86 assembly (clang, -O0):
<testLib2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <testLib1@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @testLib2() {
%1 = call i32 (...) @testLib1()
ret i32 %1
}

LLVM IR (-O2):
define i32 @testLib2() {
%1 = tail call i32 (...) @testLib1()
ret i32 %1
}
void b(int p __attribute__((nodebug))) { int b __attribute__((nodebug)); }


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

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

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

LLVM IR (-O2):
define void @b(i32 %0) {
ret void
}
void generic_file_llseek(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<generic_file_llseek>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_file_llseek>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.generic_file_llseek = [20 x i8] c"generic_file_llseek\00"
define void @generic_file_llseek() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.generic_file_llseek, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.generic_file_llseek = [20 x i8] c"generic_file_llseek\00"
define void @generic_file_llseek() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.generic_file_llseek, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void jm_teardown_jelly_threads(void) { printf("jm_teardown_jelly_threads\n"); }


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"jm_teardown_jelly_threads\00"
define void @jm_teardown_jelly_threads() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
int g(int a, int b) {
  int c = (a + b + 1) / 2;
  return c;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    (%rdi,%rsi,1),%eax
lea    (%rdi,%rsi,1),%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, 2
ret i32 %5
}
int get_bits(int in, int begin, int end) {
  int mask = (1 << (end - begin + 1)) - 1;
  return (in >> begin) & mask;
}


x86 assembly (clang, -O0):
<get_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bits>:
sub    %esi,%edx
lea    0x1(%rdx),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
sar    %cl,%edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_bits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = shl i32 1, %11
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %7
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = ashr i32 %14, %15
%17 = load i32, i32* %7
%18 = and i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_bits(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 1, %1
%5 = add i32 %4, %2
%6 = shl nsw i32 -1, %5
%7 = xor i32 %6, -1
%8 = ashr i32 %0, %1
%9 = and i32 %8, %7
ret i32 %9
}
/* Variables and functions */
__attribute__((weak)) void rgblight_increase_sat(void) {}


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

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

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

LLVM IR (-O2):
define weak void @rgblight_increase_sat() {
ret void
}
INI_prf_seq_stp_ffnc_ctx() {}


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

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

LLVM IR (-O0):
define i32 @INI_prf_seq_stp_ffnc_ctx() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @INI_prf_seq_stp_ffnc_ctx() {
ret i32 undef
}
RX0AR1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<RX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x87a22(%rax),%dx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AR1>:
movzwl 0x87a22(%r9),%eax
movslq %edx,%rcx
mov    %ax,(%r8,%rcx,2)
ret

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

LLVM IR (-O2):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %5, i64 277777
%8 = load i16, i16* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i16, i16* %4, i64 %9
store i16 %8, i16* %10
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __wait4(int /*<<< orphan*/, int *, int,
                           int /*<<< orphan*/ *);
pid_t __waitpid(pid_t pid, int *stat_loc, int options) {
  return __wait4(pid, stat_loc, options, NULL);
}


x86 assembly (clang, -O0):
<__waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <__wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__waitpid>:
xor    %ecx,%ecx
jmp    1030 <__wait4@plt>

LLVM IR (-O0):
define i32 @__waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @__wait4(i32 %7, i32* %8, i32 %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @__wait4(i32 %0, i32* %1, i32 %2, i32* null)
ret i32 %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRBD_set(void) { return U_WMRCORENONE_set("U_WMRBD"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRBD\00"
define i8* @U_WMRBD_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRBD\00"
define i8* @U_WMRBD_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ WaypointActiveHandle();
void WaypointActiveRequestUpdate() {
  UAVObjRequestUpdate(WaypointActiveHandle());
}


x86 assembly (clang, -O0):
<WaypointActiveRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <WaypointActiveHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaypointActiveRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <WaypointActiveHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @WaypointActiveRequestUpdate() {
%1 = call i32 (...) @WaypointActiveHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @WaypointActiveRequestUpdate() {
%1 = tail call i32 (...) @WaypointActiveHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
void charspace() { delay(2); }


x86 assembly (clang, -O0):
<charspace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<charspace>:
mov    $0x2,%edi
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @charspace() {
%1 = call i32 @delay(i32 2)
ret void
}

LLVM IR (-O2):
define void @charspace() {
%1 = tail call i32 @delay(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fstp_preg32_qword(int reg32) {
  put8(0xDD);
  put8(0x18 + reg32);
}


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

x86 assembly (clang, -O2):
<fstp_preg32_qword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdd,%edi
call   1030 <put8@plt>
add    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fstp_preg32_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 221)
%4 = load i32, i32* %2
%5 = add nsw i32 24, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fstp_preg32_qword(i32 %0) {
%2 = tail call i32 @put8(i32 221)
%3 = add nsw i32 %0, 24
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
int atol(char *);
int /*<<< orphan*/ my_free(char *);
int int_free(char *tmp) {
  int r = atol(tmp);
  my_free(tmp);
  return r;
}


x86 assembly (clang, -O0):
<int_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atol@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <my_free@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_free>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <atol@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <my_free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @int_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @atol(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @my_free(i8* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @int_free(i8* %0) {
%2 = tail call i32 @atol(i8* %0)
%3 = tail call i32 @my_free(i8* %0)
ret i32 %2
}
void band_positive_constant_Good() {
  char a[3];
  int x = 6 & 2;
  a[x] = 0;
}


x86 assembly (clang, -O0):
<band_positive_constant_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movb   $0x0,-0x3(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @band_positive_constant_Good() {
%1 = alloca [3 x i8]
%2 = alloca i32
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 %4
store i8 0, i8* %5
ret void
}

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


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

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

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

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