xunge/DecIR huggingface dataset:
int hdSurEncBasicCrypt_D2_0F_11(int Value, int XorVal) {
  int i = (Value << 13) - Value + 0x1B59;
  i = (i * Value) + 0x07CF;
  return (i ^ XorVal);
}


x86 assembly (clang, -O0):
<hdSurEncBasicCrypt_D2_0F_11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
sub    -0x4(%rbp),%eax
add    $0x1b59,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
add    $0x7cf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdSurEncBasicCrypt_D2_0F_11>:
mov    %edi,%eax
shl    $0xd,%eax
sub    %edi,%eax
add    $0x1b59,%eax
imul   %edi,%eax
add    $0x7cf,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @hdSurEncBasicCrypt_D2_0F_11(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 = shl i32 %6, 13
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 7001
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %13, 1999
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = xor i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @hdSurEncBasicCrypt_D2_0F_11(i32 %0, i32 %1) {
%3 = mul i32 %0, 8191
%4 = add nsw i32 %3, 7001
%5 = mul nsw i32 %4, %0
%6 = add nsw i32 %5, 1999
%7 = xor i32 %6, %1
ret i32 %7
}
double _sqr(double x) { return x * x; }


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

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

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

LLVM IR (-O2):
define double @_sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ HTTP_DecodeURL(char *);
int /*<<< orphan*/ Q_strchrrepl(char *, char, char);
void HTTP_DecodeURLFormData(char *url) {
  Q_strchrrepl(url, '+', ' ');
  HTTP_DecodeURL(url);
}


x86 assembly (clang, -O0):
<HTTP_DecodeURLFormData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2b,%esi
mov    $0x20,%edx
call   1030 <Q_strchrrepl@plt>
mov    -0x8(%rbp),%rdi
call   1040 <HTTP_DecodeURL@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HTTP_DecodeURLFormData>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2b,%esi
mov    $0x20,%edx
call   1030 <Q_strchrrepl@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <HTTP_DecodeURL@plt>

LLVM IR (-O0):
define void @HTTP_DecodeURLFormData(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Q_strchrrepl(i8* %3, i8 signext 43, i8 signext 32)
%5 = load i8*, i8** %2
%6 = call i32 @HTTP_DecodeURL(i8* %5)
ret void
}

LLVM IR (-O2):
define void @HTTP_DecodeURLFormData(i8* %0) {
%2 = tail call i32 @Q_strchrrepl(i8* %0, i8 signext 43, i8 signext 32)
%3 = tail call i32 @HTTP_DecodeURL(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ inthandler(int /*<<< orphan*/);
void dwebserver_kill(void) { inthandler(SIGUSR1); }


x86 assembly (clang, -O0):
<dwebserver_kill>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <inthandler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwebserver_kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <inthandler@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define void @dwebserver_kill() {
%1 = load i32, i32* @SIGUSR1
%2 = call i32 @inthandler(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @dwebserver_kill() {
%1 = load i32, i32* @SIGUSR1
%2 = tail call i32 @inthandler(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void exitWithError() { exit(1); }


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

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

LLVM IR (-O0):
define void @exitWithError() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @exitWithError() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void error_error(const char *s) { printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<error_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double emyg_strtod(char const *, int /*<<< orphan*/ *);
double emyg_atod(const char *nptr) { return emyg_strtod(nptr, NULL); }


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

x86 assembly (clang, -O2):
<emyg_atod>:
xor    %esi,%esi
jmp    1030 <emyg_strtod@plt>

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

LLVM IR (-O2):
define double @emyg_atod(i8* %0) {
%2 = tail call double @emyg_strtod(i8* %0, i32* null)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *_wilddog_memcpy(void *dest, const void *src, size_t len) {
  memcpy(dest, src, len);
  return (void *)dest;
}


x86 assembly (clang, -O0):
<_wilddog_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wilddog_memcpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_wilddog_memcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("Usage:\n");
  printf("\t./myfork ./ProgWantToTest\n");
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [28 x i8] c"\09./myfork ./ProgWantToTest\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [27 x i8] c"\09./myfork ./ProgWantToTest\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cal_to_jul(int, int, int);
double jul_and_time_to_jul(int /*<<< orphan*/, int, int, double);
double cal_and_time_to_jul(int y, int m, int d, int hour, int min, double sec) {
  return jul_and_time_to_jul(cal_to_jul(y, m, d), hour, min, sec);
}


x86 assembly (clang, -O0):
<cal_and_time_to_jul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <cal_to_jul@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
call   1040 <jul_and_time_to_jul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal_and_time_to_jul>:
push   %rbp
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    %r8d,%ebx
mov    %ecx,%ebp
call   1030 <cal_to_jul@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <jul_and_time_to_jul@plt>

LLVM IR (-O0):
define double @cal_and_time_to_jul(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, double %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store double %5, double* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call i32 @cal_to_jul(i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load double, double* %12
%20 = call double @jul_and_time_to_jul(i32 %16, i32 %17, i32 %18, double %19)
ret double %20
}

LLVM IR (-O2):
define double @cal_and_time_to_jul(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, double %5) {
%7 = tail call i32 @cal_to_jul(i32 %0, i32 %1, i32 %2)
%8 = tail call double @jul_and_time_to_jul(i32 %7, i32 %3, i32 %4, double %5)
ret double %8
}
float mmapAdd(float *addr, long i, float v) { return addr[i] = (addr[i] + v); }


x86 assembly (clang, -O0):
<mmapAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmapAdd>:
addss  (%rdi,%rsi,4),%xmm0
movss  %xmm0,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define float @mmapAdd(float* %0, i64 %1, float %2) {
%4 = alloca float*
%5 = alloca i64
%6 = alloca float
store float* %0, float** %4
store i64 %1, i64* %5
store float %2, float* %6
%7 = load float*, float** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds float, float* %7, i64 %8
%10 = load float, float* %9
%11 = load float, float* %6
%12 = fadd float %10, %11
%13 = load float*, float** %4
%14 = load i64, i64* %5
%15 = getelementptr inbounds float, float* %13, i64 %14
store float %12, float* %15
ret float %12
}

LLVM IR (-O2):
define float @mmapAdd(float* nocapture %0, i64 %1, float %2) {
%4 = getelementptr inbounds float, float* %0, i64 %1
%5 = load float, float* %4
%6 = fadd float %5, %2
store float %6, float* %4
ret float %6
}
int cmp_int(const int *a, const int *b) { return *a - *b; }


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

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

LLVM IR (-O0):
define i32 @cmp_int(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @cmp_int(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
int gcd(int a, int b) {
  int x = 0, y = 0;
  if (a > b) {
    x = a;
    y = b;
  } else {
    x = b;
    y = a;
  }
  while (x % y != 0) {
    int temp = x;
    x = y;
    y = temp % x;
  }
  return y;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1135 <gcd+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1141 <gcd+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <gcd+0x46>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
je     1171 <gcd+0x71>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
jmp    1146 <gcd+0x46>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
cmp    %esi,%edi
mov    %edi,%edx
cmovg  %esi,%edx
cmovg  %edi,%esi
nopw   0x0(%rax,%rax,1)
mov    %esi,%eax
mov    %edx,%esi
cltd
idiv   %esi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %3
store i32 %12, i32* %5
%13 = load i32, i32* %4
store i32 %13, i32* %6
br label %17
14: ; preds = %2
%15 = load i32, i32* %4
store i32 %15, i32* %5
%16 = load i32, i32* %3
store i32 %16, i32* %6
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %23, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = srem i32 %19, %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %18
%24 = load i32, i32* %5
store i32 %24, i32* %7
%25 = load i32, i32* %6
store i32 %25, i32* %5
%26 = load i32, i32* %7
%27 = load i32, i32* %5
%28 = srem i32 %26, %27
store i32 %28, i32* %6
br label %18
29: ; preds = %18
%30 = load i32, i32* %6
ret i32 %30
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %9, %6 ]
%8 = phi i32 [ %5, %2 ], [ %7, %6 ]
%9 = srem i32 %8, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
main() {
  char c;
  char iptr[10000];
  printf("&c = 0x%lx, iprt = 0x%x ... ", &c, iptr);
  fflush(stdout);
  c = iptr[0];
  printf("ok\n");
  main();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
lea    -0x2720(%rbp),%rdx
lea    0xeb7(%rip),%rdi
lea    -0x1(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x2720(%rbp),%al
mov    %al,-0x1(%rbp)
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
call   1050 <main@plt>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x2728,%rsp
lea    0xeb2(%rip),%rdi
lea    0xf(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x10(%rsp),%al
mov    %al,0xf(%rsp)
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
call   1060 <main@plt>
xor    %eax,%eax
add    $0x2728,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"&c = 0x%lx, iprt = 0x%x ... \00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"ok\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [10000 x i8]
%3 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @main()
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"&c = 0x%lx, iprt = 0x%x ... \00"
@stdout = global i32 0
@str = [3 x i8] c"ok\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [10000 x i8]
%3 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i8, i8* %3
store i8 %7, i8* %1
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%9 = call i32 @main()
ret i32 0
}
/* Variables and functions */
int syscall(int, char const *);
int rmdir(const char *path) { return syscall(40, path); }


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

x86 assembly (clang, -O2):
<rmdir>:
mov    %rdi,%rsi
mov    $0x28,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @rmdir(i8* %0) {
%2 = tail call i32 @syscall(i32 40, i8* %0)
ret i32 %2
}
void ratelimited_pet_watchdog(void) {}


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

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

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

LLVM IR (-O2):
define void @ratelimited_pet_watchdog() {
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t lapic_read(uint32_t reg) { return *((volatile uint32_t *)reg); }


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

x86 assembly (clang, -O2):
<lapic_read>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @lapic_read(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @lapic_read(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}
/* Variables and functions */
int String_Length(char *str) {
  if (str == NULL)
    return 0;
  int len = 0;
  while (*str != '\0') {
    len++;
    str++;
  }
  return len;
}


x86 assembly (clang, -O0):
<String_Length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <String_Length+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1156 <String_Length+0x56>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <String_Length+0x50>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <String_Length+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<String_Length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <String_Length+0x1b>
cmpb   $0x0,(%rdi)
je     111b <String_Length+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <String_Length+0x10>
ret

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

LLVM IR (-O2):
define i32 @String_Length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = add nuw nsw i32 %7, 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
int getstack() { return 0x082F5948; }


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

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

LLVM IR (-O0):
define i32 @getstack() {
ret i32 137320776
}

LLVM IR (-O2):
define i32 @getstack() {
ret i32 137320776
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t mp2vgop_get_timecode(const uint8_t *p_mp2vgop) {
  return (p_mp2vgop[4] << 17) | (p_mp2vgop[5] << 9) | (p_mp2vgop[6] << 1) |
         (p_mp2vgop[7] >> 7);
}


x86 assembly (clang, -O0):
<mp2vgop_get_timecode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x11,%eax
mov    -0x8(%rbp),%rcx
mov    0x14(%rcx),%ecx
shl    $0x9,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x1c(%rcx),%ecx
sar    $0x7,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vgop_get_timecode>:
mov    0x10(%rdi),%eax
mov    0x14(%rdi),%ecx
shl    $0x11,%eax
shl    $0x9,%ecx
or     %eax,%ecx
mov    0x18(%rdi),%edx
add    %edx,%edx
mov    0x1c(%rdi),%eax
sar    $0x7,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mp2vgop_get_timecode(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = shl i32 %3, 17
%5 = getelementptr inbounds i32, i32* %0, i64 5
%6 = load i32, i32* %5
%7 = shl i32 %6, 9
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 6
%10 = load i32, i32* %9
%11 = shl i32 %10, 1
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 7
%14 = load i32, i32* %13
%15 = ashr i32 %14, 7
%16 = or i32 %12, %15
ret i32 %16
}
char *SkipFontNameElement(char *n) {
  while (*n != '-')
    if (!*++n)
      return 0;
  return n + 1;
}


x86 assembly (clang, -O0):
<SkipFontNameElement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1143 <SkipFontNameElement+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,0x1(%rax)
jne    113e <SkipFontNameElement+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    114f <SkipFontNameElement+0x4f>
jmp    1108 <SkipFontNameElement+0x8>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipFontNameElement>:
mov    %rdi,%rax
mov    (%rdi),%cl
add    $0x1,%rax
nopl   0x0(%rax)
cmp    $0x2d,%cl
je     1122 <SkipFontNameElement+0x22>
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <SkipFontNameElement+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @SkipFontNameElement(i8* %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %8, %1
%4 = phi i8 [ %9, %8 ], [ %2, %1 ]
%5 = phi i8* [ %7, %8 ], [ %0, %1 ]
%6 = icmp eq i8 %4, 45
%7 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %6, label %11, label %8
8: ; preds = %3
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %8, %3
%12 = phi i8* [ %7, %3 ], [ null, %8 ]
ret i8* %12
}
int (*__sx25_set_parse_error_function(int (*func)(char *)))(char *) {
  return ((int (*)(char *))0);
}


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

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

LLVM IR (-O0):
define i32 (i8*)* @__sx25_set_parse_error_function(i32 (i8*)* %0) {
%2 = alloca i32 (i8*)*
store i32 (i8*)* %0, i32 (i8*)** %2
ret i32 (i8*)* null
}

LLVM IR (-O2):
define noalias i32 (i8*)* @__sx25_set_parse_error_function(i32 (i8*)* nocapture readnone %0) {
ret i32 (i8*)* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __aosc_encode_fixed_size_32(char *, int /*<<< orphan*/, int);
char *strcat(int /*<<< orphan*/, char *);
char *__aosc_backpatch_i386(char *dst, uint32_t esp) {
  esp += 16;
  return strcat(__aosc_encode_fixed_size_32(dst, 0, esp), "\x5c");
}


x86 assembly (clang, -O0):
<__aosc_backpatch_i386>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <__aosc_encode_fixed_size_32@plt>
mov    %eax,%edi
lea    0xeb1(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aosc_backpatch_i386>:
push   %rax
lea    0x10(%rsi),%edx
xor    %esi,%esi
call   1030 <__aosc_encode_fixed_size_32@plt>
lea    0xece(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\\\00"
define i8* @__aosc_backpatch_i386(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 16
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @__aosc_encode_fixed_size_32(i8* %7, i32 0, i32 %8)
%10 = call i8* @strcat(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"\\\00"
define i8* @__aosc_backpatch_i386(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 16
%4 = tail call i32 @__aosc_encode_fixed_size_32(i8* %0, i32 0, i32 %3)
%5 = tail call i8* @strcat(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ OPM_FPrint(long long *, long long);
void OPM_FPrintReal(long long *fp, float real) {
  OPM_FPrint(&*fp, ((long long)(real)));
}


x86 assembly (clang, -O0):
<OPM_FPrintReal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
cvttss2si -0xc(%rbp),%rsi
call   1030 <OPM_FPrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPM_FPrintReal>:
cvttss2si %xmm0,%rsi
jmp    1030 <OPM_FPrint@plt>

LLVM IR (-O0):
define void @OPM_FPrintReal(i64* %0, float %1) {
%3 = alloca i64*
%4 = alloca float
store i64* %0, i64** %3
store float %1, float* %4
%5 = load i64*, i64** %3
%6 = load float, float* %4
%7 = fptosi float %6 to i64
%8 = call i32 @OPM_FPrint(i64* %5, i64 %7)
ret void
}

LLVM IR (-O2):
define void @OPM_FPrintReal(i64* %0, float %1) {
%3 = fptosi float %1 to i64
%4 = tail call i32 @OPM_FPrint(i64* %0, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ wipe(unsigned char *, unsigned int);
void free_wipe(unsigned char *buf, unsigned int len) {
  wipe(buf, len);
  free(buf);
}


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

x86 assembly (clang, -O2):
<free_wipe>:
push   %rbx
mov    %rdi,%rbx
call   1040 <wipe@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_wipe(i8* %0, i32 %1) {
%3 = tail call i32 @wipe(i8* %0, i32 %1)
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, "ERROR - %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"ERROR - %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"ERROR - %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void testClosureILLIrV(void (*closure)(int, long long, int), int a1,
                       long long a2, int a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureILLIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureILLIrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    *%rax

LLVM IR (-O0):
define void @testClosureILLIrV(void (i32, i64, i32)* %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca void (i32, i64, i32)*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store void (i32, i64, i32)* %0, void (i32, i64, i32)** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load void (i32, i64, i32)*, void (i32, i64, i32)** %5
%10 = load i32, i32* %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
define void @testClosureILLIrV(void (i32, i64, i32)* nocapture %0, i32 %1, i64 %2, i32 %3) {
tail call void %0(i32 %1, i64 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nl();
void alisp_nl(void) { nl(); }


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

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

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

LLVM IR (-O2):
define void @alisp_nl() {
%1 = tail call i32 (...) @nl()
ret void
}
/* Variables and functions */
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ printf(char *);
int *ivector(int nl, int nh) {
  int *v;
  v = (int *)calloc((unsigned)(nh - nl + 1), sizeof(int));
  if (!v)
    printf("allocation failure in ivector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
add    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <ivector+0x3c>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <ivector+0x28>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(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* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = call i64 @calloc(i32 %9, i32 4)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = icmp ne i32* %12, null
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %2
%17 = load i32*, i32** %5
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = sub i64 0, %19
%21 = getelementptr inbounds i32, i32* %17, i64 %20
ret i32* %21
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i64 @calloc(i32 %4, i32 4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = inttoptr i64 %5 to i32*
%11 = sext i32 %0 to i64
%12 = sub nsw i64 0, %11
%13 = getelementptr inbounds i32, i32* %10, i64 %12
ret i32* %13
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *read_string_withalloc(const void *buf, size_t size) {
  char *str = (char *)malloc(size + 1);
  strncpy(str, (char *)buf, size);
  str[size] = 0;
  return str;
}


x86 assembly (clang, -O0):
<read_string_withalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_string_withalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @read_string_withalloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @read_string_withalloc(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
%7 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %7
ret i8* %5
}
void checksid(id) char *id;
{ (void)checkid(id, 0); }


x86 assembly (clang, -O0):
<checksid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <checkid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checksid>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <checkid@plt>

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

LLVM IR (-O2):
define void @checksid(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @checkid to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
ret void
}
/* Variables and functions */
int omap_rev();
int is_omap1710(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x1710)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap1710>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1710,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap1710>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x17100000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap1710() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 5904
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap1710() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 386924544
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ merging(int, int, int);
void mergeSort(int low, int high) {
  int mid;
  if (low < high) {
    mid = (low + high) / 2;
    mergeSort(low, mid);
    mergeSort(mid + 1, high);
    merging(low, mid, high);
  } else
    return;
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1177 <mergeSort+0x57>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <merging@plt>
jmp    117c <mergeSort+0x5c>
jmp    117c <mergeSort+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    %esi,%edi
jge    1160 <mergeSort+0x40>
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%r15d
lea    (%r14,%r15,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%esi
call   1030 <mergeSort@plt>
lea    0x1(%rbx),%edi
mov    %r14d,%esi
call   1030 <mergeSort@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <merging@plt>
ret

LLVM IR (-O0):
define void @mergeSort(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 = icmp slt i32 %6, %7
br i1 %8, label %9, label %23
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
%13 = sdiv i32 %12, 2
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = call i32 @merging(i32 %19, i32 %20, i32 %21)
br label %24
23: ; preds = %2
br label %24
24: ; preds = %23, %9
ret void
}

LLVM IR (-O2):
define void @mergeSort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %1, %0
%7 = sdiv i32 %6, 2
tail call void @mergeSort(i32 %0, i32 %7)
%8 = add nsw i32 %7, 1
tail call void @mergeSort(i32 %8, i32 %1)
%9 = tail call i32 @merging(i32 %0, i32 %7, i32 %1)
br label %4
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ isendwin();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_int(int /*<<< orphan*/);
void cmd_isendwin(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_int(isendwin());
}


x86 assembly (clang, -O0):
<cmd_isendwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_isendwin+0x27>
jmp    117f <cmd_isendwin+0x3f>
mov    $0x1,%edi
call   1040 <report_count@plt>
mov    $0x0,%al
call   1060 <isendwin@plt>
mov    %eax,%edi
call   1050 <report_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_isendwin>:
push   %rax
xor    %esi,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_isendwin+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
xor    %eax,%eax
call   1060 <isendwin@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <report_int@plt>

LLVM IR (-O0):
define void @cmd_isendwin(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 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @isendwin()
%12 = call i32 @report_int(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_isendwin(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @isendwin()
%8 = tail call i32 @report_int(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
double ts2epj(tsec)
double tsec;
{
  double dj;
  dj = ts2jd(tsec);
  return (jd2epj(dj));
}


x86 assembly (clang, -O0):
<ts2epj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <ts2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <jd2epj@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts2epj>:
push   %rax
mov    $0x1,%al
call   1040 <ts2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1030 <jd2epj@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ts2epj(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 (double, ...) bitcast (i32 (...)* @jd2epj to i32 (double, ...)*)(double %7)
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @ts2epj(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2epj to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void main() {
  double sn = 100.0, hn = sn / 2;
  int n;
  for (n = 2; n <= 10; n++) {
    sn = sn + 2 * hn;
    hn = hn / 2;
  }
  printf("%lf\n", sn);
  printf("%lf\n", hn);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jg     1187 <main+0x77>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1142 <main+0x32>
movsd  -0x8(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef8(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca i32
store double 1.000000e+02, double* %1
%4 = load double, double* %1
%5 = fdiv double %4, 2.000000e+00
store double %5, double* %2
store i32 2, i32* %3
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 10
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load double, double* %1
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %11, double %10)
store double %12, double* %1
%13 = load double, double* %2
%14 = fdiv double %13, 2.000000e+00
store double %14, double* %2
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %6
%19 = load double, double* %1
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %19)
%21 = load double, double* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %21)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x4072B9C000000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x3FB9000000000000)
ret void
}