xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, double *);
double *vector(int);
double *readVector(int size) {
  double *v = vector(size);
  for (int i = 0; i < size; i++)
    scanf("%le", (v + i));
  return v;
}


x86 assembly (clang, -O0):
<readVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <vector@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1173 <readVector+0x53>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xea0(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <readVector+0x1e>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readVector>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <vector@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1165 <readVector+0x45>
mov    %ebx,%r12d
lea    0xec0(%rip),%r15
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r12
jne    1150 <readVector+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%le\00"
define double* @readVector(i32 %0) {
%2 = tail call double* @vector(i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %1
ret double* %2
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %11, %7 ]
%9 = getelementptr inbounds double, double* %2, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
WRTERR(len, str) long *len;
long *str;
{ write(2, (char *)str, *len); }


x86 assembly (clang, -O0):
<WRTERR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WRTERR>:
mov    (%rdi),%rdx
mov    $0x2,%edi
xor    %eax,%eax
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @WRTERR(i64* %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
%6 = load i64*, i64** %5
%7 = bitcast i64* %6 to i8*
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %7, i64 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @WRTERR(i64* nocapture %0, i64* %1) {
%3 = bitcast i64* %1 to i8*
%4 = load i64, i64* %0
%5 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %3, i64 %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("Hello ACS560!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello ACS560!\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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello ACS560!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x25() {
  Assert_real((isprint(37)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              190, ("isprint should be 1 for %"));
}


x86 assembly (clang, -O0):
<t_isprint_0x25>:
push   %rbp
mov    %rsp,%rbp
mov    $0x25,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xbe,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x25>:
push   %rax
mov    $0x25,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xbe,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for %\00"
define void @t_isprint_0x25() {
%1 = call i32 @isprint(i32 37)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for %\00"
define void @t_isprint_0x25() {
%1 = tail call i32 @isprint(i32 37)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void glutOverlayDisplayFunc(void (*func)(void)) {}


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

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

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

LLVM IR (-O2):
define void @glutOverlayDisplayFunc(void ()* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
scalar_t__ fork();
void exec(char *args[]) {
  if (fork() == 0)
    execvp(args[0], args);
}


x86 assembly (clang, -O0):
<exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jne    114d <exec+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <execvp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1132 <exec+0x12>
pop    %rbx
ret
mov    (%rbx),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <execvp@plt>

LLVM IR (-O0):
define void @exec(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %2
%10 = call i32 @execvp(i8* %8, i8** %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @exec(i8** %0) {
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i8*, i8** %0
%6 = tail call i32 @execvp(i8* %5, i8** %0)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int pow(double, double);
double logLogisticCDF(double value, double params[]) {
  return 1 / (1 + pow((params[1] / (value - params[0])), params[2]));
}


x86 assembly (clang, -O0):
<logLogisticCDF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
call   1030 <pow@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logLogisticCDF>:
push   %rax
subsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm2
divsd  %xmm0,%xmm2
movsd  0x10(%rdi),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logLogisticCDF(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 1
%7 = load double, double* %6
%8 = load double, double* %3
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = fsub double %8, %11
%13 = fdiv double %7, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = call i32 @pow(double %13, double %16)
%18 = add nsw i32 1, %17
%19 = sdiv i32 1, %18
%20 = sitofp i32 %19 to double
ret double %20
}

LLVM IR (-O2):
define double @logLogisticCDF(double %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %3
%5 = load double, double* %1
%6 = fsub double %0, %5
%7 = fdiv double %4, %6
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = tail call i32 @pow(double %7, double %9)
%11 = add nsw i32 %10, 1
%12 = add i32 %10, 2
%13 = icmp ult i32 %12, 3
%14 = select i1 %13, i32 %11, i32 0
%15 = sitofp i32 %14 to double
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char const *);
unsigned long long strtoll(char const *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
unsigned long long parse_number(const char *str) {
  unsigned long long n;
  n = strtoll(str, NULL, 0);
  if (n == 0 && str[0] != '0')
    fatal("invalid name or number: %s\n", str);
  return n;
}


x86 assembly (clang, -O0):
<parse_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <parse_number+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
je     116a <parse_number+0x4a>
mov    -0x8(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_number>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114d <parse_number+0x2d>
cmpb   $0x30,(%r14)
je     114d <parse_number+0x2d>
lea    0xebb(%rip),%rdi
mov    %r14,%rsi
call   1040 <fatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"invalid name or number: %s\0A\00"
define i64 @parse_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtoll(i8* %4, i32* null, i32 0)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 48
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = call i32 @fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %8, %1
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
@.str = [28 x i8] c"invalid name or number: %s\0A\00"
define i64 @parse_number(i8* %0) {
%2 = tail call i64 @strtoll(i8* nocapture %0, i32* null, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 48
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %4, %1
ret i64 %2
}
/* Variables and functions */
int __cvmx_helper_npi_probe(int);
int __cvmx_helper_npi_enumerate(int interface) {
  return __cvmx_helper_npi_probe(interface);
}


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

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

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

LLVM IR (-O2):
define i32 @__cvmx_helper_npi_enumerate(i32 %0) {
%2 = tail call i32 @__cvmx_helper_npi_probe(i32 %0)
ret i32 %2
}
/* Variables and functions */
int tonibble(unsigned char);
unsigned int tobyte(unsigned char ch1, unsigned char ch2) {
  return tonibble(ch1) << 4 | tonibble(ch2);
}


x86 assembly (clang, -O0):
<tobyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <tonibble@plt>
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <tonibble@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tobyte>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <tonibble@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
mov    %ebx,%edi
call   1030 <tonibble@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @tobyte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @tonibble(i8 zeroext %5)
%7 = shl i32 %6, 4
%8 = load i8, i8* %4
%9 = call i32 @tonibble(i8 zeroext %8)
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @tobyte(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @tonibble(i8 zeroext %0)
%4 = shl i32 %3, 4
%5 = tail call i32 @tonibble(i8 zeroext %1)
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
double fabs(double);
double _max_no_sign(double current, double new_value) {
  double fnew_value;
  fnew_value = fabs(new_value);
  if (current < fnew_value) {
    return fnew_value;
  } else {
    return current;
  }
}


x86 assembly (clang, -O0):
<_max_no_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movaps 0xee6(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <_max_no_sign+0x46>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1150 <_max_no_sign+0x50>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_max_no_sign>:
andpd  0xef8(%rip),%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @_max_no_sign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = call double @llvm.fabs.f64(double %7)
store double %8, double* %6
%9 = load double, double* %4
%10 = load double, double* %6
%11 = fcmp olt double %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load double, double* %6
store double %13, double* %3
br label %16
14: ; preds = %2
%15 = load double, double* %4
store double %15, double* %3
br label %16
16: ; preds = %14, %12
%17 = load double, double* %3
ret double %17
}

LLVM IR (-O2):
define double @_max_no_sign(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %1)
%4 = fcmp ogt double %3, %0
%5 = select i1 %4, double %3, double %0
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_smoother_put() {
  printf("NOT IMPLEMENTED:"
         "pa_smoother_put"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_smoother_put\0A\00"
define i32 @pa_smoother_put() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_smoother_put\00"
define i32 @pa_smoother_put() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int T, n, i;
  scanf("%d ", &T);
  for (i = 0; i < T; i++) {
    scanf("%d", &n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1160 <main+0x50>
lea    0xebb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1154 <main+0x44>
xor    %ebp,%ebp
lea    0xecb(%rip),%r14
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     1140 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %0, %8
%9 = phi i32 [ %11, %8 ], [ 0, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = add nuw nsw i32 %9, 1
%12 = load i32, i32* %1
%13 = icmp slt i32 %11, %12
br i1 %13, label %8, label %14
14: ; preds = %8, %0
ret i32 0
}
int test_imm_15uint16_mem(unsigned short *val) {
  return ((*val) & (-0x15 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_15uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffeb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_15uint16_mem>:
movzwl (%rdi),%eax
test   $0xffeb,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_15uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -21
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sigusr1_handler(int signal) { exit(1); }


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

x86 assembly (clang, -O2):
<sigusr1_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @sigusr1_handler(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct mdea_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_null_node_get_object(void *p, struct mdea_object **object,
                              char **error) {
  mdea_error(error, "Expected object, got null");
  return -1;
}


x86 assembly (clang, -O0):
<mdea_null_node_get_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdea_null_node_get_object>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdea_object = type { i32 }
@.str = [26 x i8] c"Expected object, got null\00"
define i32 @mdea_null_node_get_object(i8* %0, %struct.mdea_object** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca %struct.mdea_object**
%6 = alloca i8**
store i8* %0, i8** %4
store %struct.mdea_object** %1, %struct.mdea_object*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.mdea_object = type { i32 }
@.str = [26 x i8] c"Expected object, got null\00"
define i32 @mdea_null_node_get_object(i8* nocapture readnone %0, %struct.mdea_object** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_binary(bool binary[32]) {
  int i;
  for (i = 0; i < 32; i++)
    printf("%d", (binary[i]) ? 1 : 0);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1161 <print_binary+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_binary+0x13>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_binary>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xed1(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %esi,%esi
cmpl   $0x0,(%r15,%rbx,4)
setne  %sil
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1140 <print_binary+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_binary(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %9, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 32
br i1 %10, label %11, label %2
11: ; preds = %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void version_exec(int argc, char **argv) {
  (void)argc;
  (void)argv;
  fputs("unrez version 0.0\n", stdout);
}


x86 assembly (clang, -O0):
<version_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_exec>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"unrez version 0.0\0A\00"
@stdout = global i32 0
define void @version_exec(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 = load i8**, i8*** %4
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"unrez version 0.0\0A\00"
@stdout = global i32 0
define void @version_exec(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int readcounter(FILE *file) {
  int c;
  int seqcounter = 0;
  int i = 0;
  if (file) {
    while ((c = fgetc(file)) != EOF) {
      seqcounter++;
    }
  }
  return seqcounter;
}


x86 assembly (clang, -O0):
<readcounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1168 <readcounter+0x58>
jmp    113a <readcounter+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%eax
je     1163 <readcounter+0x53>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <readcounter+0x2a>
jmp    1168 <readcounter+0x58>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readcounter>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1142 <readcounter+0x32>
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    0x2ebf(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <fgetc@plt>
add    $0x1,%ebx
cmp    (%r15),%eax
jne    1130 <readcounter+0x20>
jmp    1144 <readcounter+0x34>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @readcounter(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = tail call i32 @fgetc(i32* %0)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
%8 = add nuw nsw i32 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %4, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void *myR) { printf("In foo()\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"In foo()\00"
define void @foo(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct link {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
struct link *http_query_size(char const *, char const *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/, int);
struct link *http_query_no_cache(const char *url, const char *action,
                                 time_t stoptime) {
  int64_t size;
  return http_query_size(url, action, &size, stoptime, 1);
}


x86 assembly (clang, -O0):
<http_query_no_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
lea    -0x18(%rbp),%rdx
mov    $0x1,%r8d
call   1030 <http_query_size@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_query_no_cache>:
push   %rax
mov    %edx,%ecx
lea    0x4(%rsp),%rdx
mov    $0x1,%r8d
call   1030 <http_query_size@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.link = type { i32 }
define %struct.link* @http_query_no_cache(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call %struct.link* @http_query_size(i8* %8, i8* %9, i32* %7, i32 %10, i32 1)
ret %struct.link* %11
}

LLVM IR (-O2):
%struct.link = type { i32 }
define %struct.link* @http_query_no_cache(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call %struct.link* @http_query_size(i8* %0, i8* %1, i32* %4, i32 %2, i32 1)
ret %struct.link* %6
}
/* Variables and functions */
int raid_cpu_match_sse(int /*<<< orphan*/, int);
int raid_cpu_has_sse2(void) { return raid_cpu_match_sse(0, 1 << 26); }


x86 assembly (clang, -O0):
<raid_cpu_has_sse2>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x4000000,%esi
call   1030 <raid_cpu_match_sse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<raid_cpu_has_sse2>:
xor    %edi,%edi
mov    $0x4000000,%esi
jmp    1030 <raid_cpu_match_sse@plt>

LLVM IR (-O0):
define i32 @raid_cpu_has_sse2() {
%1 = call i32 @raid_cpu_match_sse(i32 0, i32 67108864)
ret i32 %1
}

LLVM IR (-O2):
define i32 @raid_cpu_has_sse2() {
%1 = tail call i32 @raid_cpu_match_sse(i32 0, i32 67108864)
ret i32 %1
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void child_process2() { printf("child2 pid is: %d \n", getpid()); }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"child2 pid is: %d \0A\00"
define void @child_process2() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int comp(const void *a, const void *b) {
  return (*(float *)a < *(float *)b) - (*(float *)a > *(float *)b);
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
movss  (%rcx),%xmm0
mov    -0x10(%rbp),%rcx
ucomiss (%rcx),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comp(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 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp olt float %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to float*
%15 = load float, float* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to float*
%18 = load float, float* %17
%19 = fcmp ogt float %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp ogt float %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int heap_maximum(int nums[]) { return nums[0]; }


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

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

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

LLVM IR (-O2):
define i32 @heap_maximum(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
struct ListNode *addTwoNumbers(struct ListNode *, struct ListNode *);
int /*<<< orphan*/ initList(struct ListNode **, struct ListNode **);
int main() {
  struct ListNode *l1 = NULL, *l2 = NULL;
  struct ListNode *sum = NULL;
  initList(&l1, &l2);
  sum = addTwoNumbers(l1, l2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <initList@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <addTwoNumbers@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <initList@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1030 <addTwoNumbers@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ListNode*
%3 = alloca %struct.ListNode*
%4 = alloca %struct.ListNode*
store i32 0, i32* %1
store %struct.ListNode* null, %struct.ListNode** %2
store %struct.ListNode* null, %struct.ListNode** %3
store %struct.ListNode* null, %struct.ListNode** %4
%5 = call i32 @initList(%struct.ListNode** %2, %struct.ListNode** %3)
%6 = load %struct.ListNode*, %struct.ListNode** %2
%7 = load %struct.ListNode*, %struct.ListNode** %3
%8 = call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %6, %struct.ListNode* %7)
store %struct.ListNode* %8, %struct.ListNode** %4
ret i32 0
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define i32 @main() {
%1 = alloca %struct.ListNode*
%2 = alloca %struct.ListNode*
%3 = bitcast %struct.ListNode** %1 to i8*
store %struct.ListNode* null, %struct.ListNode** %1
%4 = bitcast %struct.ListNode** %2 to i8*
store %struct.ListNode* null, %struct.ListNode** %2
%5 = call i32 @initList(%struct.ListNode** %1, %struct.ListNode** %2)
%6 = load %struct.ListNode*, %struct.ListNode** %1
%7 = load %struct.ListNode*, %struct.ListNode** %2
%8 = call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %6, %struct.ListNode* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug_data(char const *, size_t);
void debug_str(const char *s) {
  size_t size = 0;
  for (const char *ptr = s; *ptr != '\0'; ptr++)
    size++;
  debug_data(s, size);
}


x86 assembly (clang, -O0):
<debug_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <debug_str+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <debug_str+0x1c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <debug_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_str>:
cmpb   $0x0,(%rdi)
je     1133 <debug_str+0x23>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
lea    0x1(%rax),%rsi
cmpb   $0x0,0x1(%rdi,%rax,1)
mov    %rsi,%rax
jne    1120 <debug_str+0x10>
jmp    1030 <debug_data@plt>
xor    %esi,%esi
jmp    1030 <debug_data@plt>

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

LLVM IR (-O2):
define void @debug_str(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %7, %1
%5 = phi i64 [ 0, %1 ], [ %10, %7 ]
%6 = tail call i32 @debug_data(i8* %0, i64 %5)
ret void
7: ; preds = %1, %7
%8 = phi i8* [ %11, %7 ], [ %0, %1 ]
%9 = phi i64 [ %10, %7 ], [ 0, %1 ]
%10 = add i64 %9, 1
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %7
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void atexit() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

LLVM IR (-O0):
define void @atexit() {
%1 = call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}

LLVM IR (-O2):
define void @atexit() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MaxHeapify(int *, int, int);
void buildMaxHeap(int *array, int start, int n) {
  int heapSize = n, i;
  for (i = start; i < heapSize; i++) {
    MaxHeapify(array, i, heapSize);
  }
}


x86 assembly (clang, -O0):
<buildMaxHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1157 <buildMaxHeap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <MaxHeapify@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112e <buildMaxHeap+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildMaxHeap>:
push   %rbp
push   %r14
push   %rbx
cmp    %edx,%esi
jge    1133 <buildMaxHeap+0x23>
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
nop
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <MaxHeapify@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <buildMaxHeap+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @buildMaxHeap(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @MaxHeapify(i32* %0, i32 %6, i32 %2)
%8 = add i32 %6, 1
%9 = icmp eq i32 %8, %2
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int numOfWorldsInString(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char arr[100] = "hello word12God,is a#girl.\\abcdef";
  printf("%d", numOfWorldsInString(arr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
call   1050 <numOfWorldsInString@plt>
mov    %eax,%esi
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%rdi
call   1040 <numOfWorldsInString@plt>
lea    0xee2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [100 x i8] c"hello word12God,is a#girl.\\abcdef\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = bitcast [100 x i8]* %2 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @numOfWorldsInString(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [100 x i8] c"hello word12God,is a#girl.\\abcdef\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @numOfWorldsInString(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void vec4_set(float *dst, float x, float y, float z, float w) {
  dst[0] = x;
  dst[1] = y;
  dst[2] = z;
  dst[3] = w;
}


x86 assembly (clang, -O0):
<vec4_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4_set>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
movss  %xmm3,0xc(%rdi)
ret

LLVM IR (-O0):
define void @vec4_set(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %7
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float, float* %8
%15 = load float*, float** %6
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float, float* %9
%18 = load float*, float** %6
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float, float* %10
%21 = load float*, float** %6
%22 = getelementptr inbounds float, float* %21, i64 3
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @vec4_set(float* nocapture writeonly %0, float %1, float %2, float %3, float %4) {
store float %1, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %7
%8 = getelementptr inbounds float, float* %0, i64 3
store float %4, float* %8
ret void
}