xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *msg) {
  fprintf(stderr, "Logmarkparse fatal: %s\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
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    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Logmarkparse fatal: %s\0A\00"
define void @fatal(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 ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Logmarkparse fatal: %s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
short h_nint(float *);
short intr_wrap_392(float p1) { return h_nint(&p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_392>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <h_nint@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_392(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call signext i16 @h_nint(float* %2)
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @intr_wrap_392(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call signext i16 @h_nint(float* %2)
ret i16 %3
}
/* Variables and functions */
double min(double, double, double);
int /*<<< orphan*/ printf(char *, double);
void main(void) { printf("%f\n", min(5.1, 5.2, 6.3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
movsd  0xed4(%rip),%xmm2
call   1040 <min@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
movsd  0xed7(%rip),%xmm2
call   1040 <min@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = call double @min(double 5.100000e+00, double 5.200000e+00, double 6.300000e+00)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = tail call double @min(double 5.100000e+00, double 5.200000e+00, double 6.300000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Testando o comando git fetch! \n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [32 x i8] c"Testando o comando git fetch! \0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"Testando o comando git fetch! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct module {
  int dummy;
};

/* Variables and functions */
int STT_FUNC;
int STT_NOTYPE;
int STT_OBJECT;
scalar_t__ module_find_symbol(struct module *, char const *, int);
void *module_getsym(struct module *mod, const char *name) {
  return (void *)module_find_symbol(
      mod, name, (1 << STT_NOTYPE) | (1 << STT_OBJECT) | (1 << STT_FUNC));
}


x86 assembly (clang, -O0):
<module_getsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    0x2e91(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%edx
mov    0x2e87(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%edx
call   1030 <module_find_symbol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_getsym>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%al
mov    0x2eb0(%rip),%rcx
mov    (%rcx),%cl
mov    $0x1,%edx
shl    %cl,%edx
bts    %eax,%edx
mov    0x2ea5(%rip),%rax
mov    (%rax),%al
bts    %eax,%edx
jmp    1030 <module_find_symbol@plt>

LLVM IR (-O0):
%struct.module = type { i32 }
@STT_NOTYPE = global i32 0
@STT_OBJECT = global i32 0
@STT_FUNC = global i32 0
define i8* @module_getsym(%struct.module* %0, i8* %1) {
%3 = alloca %struct.module*
%4 = alloca i8*
store %struct.module* %0, %struct.module** %3
store i8* %1, i8** %4
%5 = load %struct.module*, %struct.module** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @STT_NOTYPE
%8 = shl i32 1, %7
%9 = load i32, i32* @STT_OBJECT
%10 = shl i32 1, %9
%11 = or i32 %8, %10
%12 = load i32, i32* @STT_FUNC
%13 = shl i32 1, %12
%14 = or i32 %11, %13
%15 = call i64 @module_find_symbol(%struct.module* %5, i8* %6, i32 %14)
%16 = inttoptr i64 %15 to i8*
ret i8* %16
}

LLVM IR (-O2):
%struct.module = type { i32 }
@STT_NOTYPE = global i32 0
@STT_OBJECT = global i32 0
@STT_FUNC = global i32 0
define i8* @module_getsym(%struct.module* %0, i8* %1) {
%3 = load i32, i32* @STT_NOTYPE
%4 = shl nuw i32 1, %3
%5 = load i32, i32* @STT_OBJECT
%6 = shl nuw i32 1, %5
%7 = or i32 %6, %4
%8 = load i32, i32* @STT_FUNC
%9 = shl nuw i32 1, %8
%10 = or i32 %7, %9
%11 = tail call i64 @module_find_symbol(%struct.module* %0, i8* %1, i32 %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}
/* Variables and functions */
unsigned long *reg_map(unsigned long);
unsigned long VpuWriteReg(unsigned long addr, unsigned int data) {
  unsigned long *reg_addr = reg_map(addr);
  *(volatile unsigned long *)reg_addr = data;
  return 0;
}


x86 assembly (clang, -O0):
<VpuWriteReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reg_map@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VpuWriteReg>:
push   %rbx
mov    %esi,%ebx
call   1030 <reg_map@plt>
mov    %ebx,%ecx
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @VpuWriteReg(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64*
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = call i64* @reg_map(i64 %6)
store i64* %7, i64** %5
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = load i64*, i64** %5
store volatile i64 %9, i64* %10
ret i64 0
}

LLVM IR (-O2):
define i64 @VpuWriteReg(i64 %0, i32 %1) {
%3 = tail call i64* @reg_map(i64 %0)
%4 = zext i32 %1 to i64
store volatile i64 %4, i64* %3
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Greeting() {
  printf("Welcome to Magic Square program!\n");
  printf("Please, enter magic square numbers.\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Welcome to Magic Square program!\0A\00"
@.str.1 = [37 x i8] c"Please, enter magic square numbers.\0A\00"
define void @Greeting() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Welcome to Magic Square program!\00"
@str.2 = [36 x i8] c"Please, enter magic square numbers.\00"
define void @Greeting() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0))
ret void
}
int check_floatComplex() { return sizeof(float _Complex); }


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

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

LLVM IR (-O0):
define i32 @check_floatComplex() {
ret i32 8
}

LLVM IR (-O2):
define i32 @check_floatComplex() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M116_f(char *s) {
  debug("M116_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

x86 assembly (clang, -O2):
<M116_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M116_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M116_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M116_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M116_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
unsigned int fn3(unsigned int x) { return ~x | x; }


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = load i32, i32* %2
%6 = or i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @fn3(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ uartTx(char *, int);
void lcdScrollRight() { uartTx("\xFE\x1C", 2); }


x86 assembly (clang, -O0):
<lcdScrollRight>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <uartTx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdScrollRight>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <uartTx@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\FE\1C\00"
define void @lcdScrollRight() {
%1 = call i32 @uartTx(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\FE\1C\00"
define void @lcdScrollRight() {
%1 = tail call i32 @uartTx(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
double atan(double x __attribute__((unused))) { return 0.0; }


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

x86 assembly (clang, -O2):
<atan>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @atan(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @atan(double %0) {
ret double 0.000000e+00
}
int openvpn_thread_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @openvpn_thread_enabled() {
ret i32 0
}
/* Variables and functions */
char *strdup(char *);
char *set_default(char *str) { return strdup(str); }


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

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

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

LLVM IR (-O2):
define noalias i8* @set_default(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
double pow(double, double);
double NusseltNum(double Ra) {
  double Nusselt;
  Nusselt = (0.59) * pow(Ra, 0.25);
  return Nusselt;
}


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

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

LLVM IR (-O0):
define double @NusseltNum(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @pow(double %4, double 2.500000e-01)
%6 = fmul double 5.900000e-01, %5
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @NusseltNum(double %0) {
%2 = tail call double @pow(double %0, double 2.500000e-01)
%3 = fmul double %2, 5.900000e-01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ putf8_seqlen(char *);
char *putf8_move(char *str, int count) {
  for (; count > 0; count--)
    str += putf8_seqlen(str);
  return str;
}


x86 assembly (clang, -O0):
<putf8_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1150 <putf8_move+0x40>
mov    -0x8(%rbp),%rdi
call   1030 <putf8_seqlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <putf8_move+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putf8_move>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
jle    1135 <putf8_move+0x25>
mov    %esi,%ebp
add    $0x1,%ebp
nop
mov    %rbx,%rdi
call   1030 <putf8_seqlen@plt>
cltq
add    %rax,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <putf8_move+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @putf8_move(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i8* [ %9, %4 ], [ %0, %2 ]
%7 = tail call i32 @putf8_seqlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = add nsw i32 %5, -1
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
%13 = phi i8* [ %0, %2 ], [ %9, %4 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ SuiteSparse_tic(double *);
double SuiteSparse_toc(double tic[2]) {
  double toc[2];
  SuiteSparse_tic(toc);
  return ((toc[0] - tic[0]) + 1e-9 * (toc[1] - tic[1]));
}


x86 assembly (clang, -O0):
<SuiteSparse_toc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <SuiteSparse_tic@plt>
movsd  -0x20(%rbp),%xmm1
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm1
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  0xeb8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SuiteSparse_toc>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <SuiteSparse_tic@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
subsd  (%rbx),%xmm1
subsd  0x8(%rbx),%xmm0
mulsd  0xec4(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @SuiteSparse_toc(double* %0) {
%2 = alloca double*
%3 = alloca [2 x double]
store double* %0, double** %2
%4 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%5 = call i32 @SuiteSparse_tic(double* %4)
%6 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%7 = load double, double* %6
%8 = load double*, double** %2
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%13 = load double, double* %12
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fsub double %13, %16
%18 = call double @llvm.fmuladd.f64(double 1.000000e-09, double %17, double %11)
ret double %18
}

LLVM IR (-O2):
define double @SuiteSparse_toc(double* nocapture %0) {
%2 = alloca [2 x double]
%3 = bitcast [2 x double]* %2 to i8*
%4 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%5 = call i32 @SuiteSparse_tic(double* %4)
%6 = load double, double* %4
%7 = load double, double* %0
%8 = fsub double %6, %7
%9 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %0, i64 1
%12 = load double, double* %11
%13 = fsub double %10, %12
%14 = call double @llvm.fmuladd.f64(double %13, double 1.000000e-09, double %8)
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void usage() {
  fatal("usage: lsh [-projfile <str> (REQUIRED)]\n\t[-featfile <str> "
        "(REQUIRED)]\n\t[-sigfile <str> (REQUIRED)]\n\t[-vadfile <str>]\n\t[-D "
        "<n> (defaults to 39)]\n\t[-S <n> (defaults to 32)]");
}


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

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

LLVM IR (-O0):
@.str = [171 x i8] c"usage: lsh [-projfile <str> (REQUIRED)]\0A\09[-featfile <str> (REQUIRED)]\0A\09[-sigfile <str> (REQUIRED)]\0A\09[-vadfile <str>]\0A\09[-D <n> (defaults to 39)]\0A\09[-S <n> (defaults to 32)]\00"
define void @usage() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [171 x i8] c"usage: lsh [-projfile <str> (REQUIRED)]\0A\09[-featfile <str> (REQUIRED)]\0A\09[-sigfile <str> (REQUIRED)]\0A\09[-vadfile <str>]\0A\09[-D <n> (defaults to 39)]\0A\09[-S <n> (defaults to 32)]\00"
define void @usage() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0))
ret void
}
int DskGetSectorSize(int N) { return (1 << (N & 0x07)) << 7; }


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

x86 assembly (clang, -O2):
<DskGetSectorSize>:
mov    %edi,%ecx
and    $0x7,%cl
mov    $0x80,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @DskGetSectorSize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 7
%5 = shl i32 1, %4
%6 = shl i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @DskGetSectorSize(i32 %0) {
%2 = and i32 %0, 7
%3 = shl nuw nsw i32 128, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ crc16_t10dif_copy_base(int /*<<< orphan*/,
                                          int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *,
                                          int /*<<< orphan*/);
uint16_t crc16_t10dif_copy(uint16_t seed, uint8_t *dst, uint8_t *src,
                           uint64_t len) {
  return crc16_t10dif_copy_base(seed, dst, src, len);
}


x86 assembly (clang, -O0):
<crc16_t10dif_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <crc16_t10dif_copy_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @crc16_t10dif_copy(i32 %0, i32* %1, i32* %2, i32 %3) {
%5 = tail call i32 @crc16_t10dif_copy_base(i32 %0, i32* %1, i32* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
struct RNALfold_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RNALfold_cmdline_parser_release(struct RNALfold_args_info *);
void RNALfold_cmdline_parser_free(struct RNALfold_args_info *args_info) {
  RNALfold_cmdline_parser_release(args_info);
}


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

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

LLVM IR (-O0):
%struct.RNALfold_args_info = type { i32 }
define void @RNALfold_cmdline_parser_free(%struct.RNALfold_args_info* %0) {
%2 = alloca %struct.RNALfold_args_info*
store %struct.RNALfold_args_info* %0, %struct.RNALfold_args_info** %2
%3 = load %struct.RNALfold_args_info*, %struct.RNALfold_args_info** %2
%4 = call i32 @RNALfold_cmdline_parser_release(%struct.RNALfold_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.RNALfold_args_info = type { i32 }
define void @RNALfold_cmdline_parser_free(%struct.RNALfold_args_info* %0) {
%2 = tail call i32 @RNALfold_cmdline_parser_release(%struct.RNALfold_args_info* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int write_quaddobl_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(245, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<write_quaddobl_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf5,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_quaddobl_start_solutions>:
mov    $0xf5,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_quaddobl_start_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 245, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_quaddobl_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 245, i32* undef, i32* undef, double* undef)
ret i32 %1
}
double para(double r1, double r2) { return r1 * r2 / (r1 + r2); }


x86 assembly (clang, -O0):
<para>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<para>:
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @para(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fadd double %8, %9
%11 = fdiv double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @para(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fadd double %0, %1
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *p;
  for (p = s; *p != '\0'; p++)
    ;
  return p - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
scalar_t__ isspace(char);
int strlen(char *);
char *trim_right(char *source) {
  size_t len = strlen(source) - 1;
  char *current = source + len;
  while (isspace(*current)) {
    *current = '\0';
    current--;
  }
  return source;
}


x86 assembly (clang, -O0):
<trim_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1178 <trim_right+0x58>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    114a <trim_right+0x2a>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_right>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%rbx
movsbl -0x1(%rbx,%r14,1),%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     1165 <trim_right+0x45>
add    %r14,%rbx
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
movb   $0x0,(%rbx)
movsbl -0x1(%rbx),%edi
add    $0xffffffffffffffff,%rbx
call   1040 <isspace@plt>
test   %rax,%rax
jne    1150 <trim_right+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @trim_right(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %1, %9
%10 = phi i8* [ %11, %9 ], [ %5, %1 ]
store i8 0, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 -1
%12 = load i8, i8* %11
%13 = tail call i64 @isspace(i8 signext %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %9
15: ; preds = %9, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: symlink"
                        " oldpath newpath\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: symlink oldpath newpath\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: symlink oldpath newpath\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ strncasecmp(char const *, char const *const, size_t const);
bool lit(char const **const src, char const *const str, size_t const len) {
  if (0 != strncasecmp(*src, str, len))
    return false;
  *src += len;
  return true;
}


x86 assembly (clang, -O0):
<lit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1152 <lit+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1167 <lit+0x57>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lit>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strncasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    113b <lit+0x2b>
add    %r14,%rbx
mov    %rbx,(%r15)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @lit(i8** nocapture %0, i8* nocapture %1, i64 %2) {
%4 = load i8*, i8** %0
%5 = tail call i64 @strncasecmp(i8* %4, i8* %1, i64 %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 %2
store i8* %8, i8** %0
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_log(void *log) { fclose((FILE *)log); }


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

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

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

LLVM IR (-O2):
define void @close_log(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
int main() {
  char buf[64];
  const char *volatile q = "ABCDEFGH";
  if (fn1(buf, q) != buf + 8 || memcmp(buf, "ABCDEFGH", 9) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    $0x0,%al
call   1040 <fn1@plt>
cltq
lea    -0x50(%rbp),%rcx
add    $0x8,%rcx
cmp    %rcx,%rax
jne    118a <main+0x5a>
lea    -0x50(%rbp),%rdi
lea    0xe89(%rip),%rsi
mov    $0x9,%edx
call   1050 <memcmp@plt>
cmp    $0x0,%eax
je     118f <main+0x5f>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
lea    0xed5(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1040 <fn1@plt>
cltq
lea    0x18(%rsp),%rcx
cmp    %rax,%rcx
jne    116d <main+0x4d>
movabs $0x4847464544434241,%rax
46 47 48
xor    0x10(%rsp),%rax
movzbl 0x18(%rsp),%ecx
or     %rax,%rcx
jne    116d <main+0x4d>
xor    %eax,%eax
add    $0x58,%rsp
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ABCDEFGH\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca i8*
store i32 0, i32* %1
store volatile i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = load volatile i8*, i8** %3
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fn1 to i32 (i8*, i8*, ...)*)(i8* %4, i8* %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds i8, i8* %9, i64 8
%11 = icmp ne i8* %8, %10
br i1 %11, label %16, label %12
12: ; preds = %0
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%14 = call i32 @memcmp(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 9)
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12, %0
unreachable
17: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"ABCDEFGH\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%4 = bitcast i8** %2 to i8*
store volatile i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load volatile i8*, i8** %2
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fn1 to i32 (i8*, i8*, ...)*)(i8* %3, i8* %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 8
%10 = icmp eq i8* %9, %8
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = call i32 @bcmp(i8* dereferenceable(9) %3, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 9)
%13 = icmp eq i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %11, %0
unreachable
15: ; preds = %11
ret i32 0
}
char *langDbgDevKanji() { return "Kanji"; }


x86 assembly (clang, -O0):
<langDbgDevKanji>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Kanji\00"
define i8* @langDbgDevKanji() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Kanji\00"
define i8* @langDbgDevKanji() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ASRT_Mark(char *, int, char *);
scalar_t__ ASRT_Ptr(int *, int /*<<< orphan*/ *);
int test_StrNullNull() {
  int *p = 0;
  do {
    ASRT_Mark("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/"
              "src/asrt_tests.c",
              156,
              "p"
              " == "
              "NULL");
    if (ASRT_Ptr(p, NULL)) {
      return 1;
    };
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_StrNullNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x9c,%esi
lea    0xf4d(%rip),%rdx
call   1040 <ASRT_Mark@plt>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <ASRT_Ptr@plt>
cmp    $0x0,%rax
je     116b <test_StrNullNull+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1177 <test_StrNullNull+0x57>
jmp    1170 <test_StrNullNull+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_StrNullNull>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf61(%rip),%rdx
mov    $0x9c,%esi
call   1040 <ASRT_Mark@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <ASRT_Ptr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [10 x i8] c"p == NULL\00"
define i32 @test_StrNullNull() {
%1 = alloca i32
%2 = alloca i32*
store i32* null, i32** %2
br label %3
3: ; preds = %0
%4 = call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 156, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i64 @ASRT_Ptr(i32* %5, i32* null)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
store i32 1, i32* %1
br label %11
9: ; preds = %3
br label %10
10: ; preds = %9
store i32 0, i32* %1
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [10 x i8] c"p == NULL\00"
define i32 @test_StrNullNull() {
%1 = tail call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 156, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @ASRT_Ptr(i32* null, i32* null)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _cc3_delay_us_4(int);
void _cc3_pixbuf_write_rewind() {
  (*(volatile unsigned long *)((0xE002800C))) = 0x000400;
  (*(volatile unsigned long *)((0xE002800C))) = 0x2000;
  _cc3_delay_us_4(1);
  (*(volatile unsigned long *)((0xE0028004))) = 0x2000;
}


x86 assembly (clang, -O0):
<_cc3_pixbuf_write_rewind>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe002800c,%eax
movq   $0x400,(%rax)
mov    $0xe002800c,%eax
movq   $0x2000,(%rax)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
mov    $0xe0028004,%eax
movq   $0x2000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cc3_pixbuf_write_rewind>:
push   %rbx
mov    $0xe002800c,%ebx
movq   $0x400,(%rbx)
movq   $0x2000,(%rbx)
mov    $0x1,%edi
call   1030 <_cc3_delay_us_4@plt>
movq   $0x2000,-0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @_cc3_pixbuf_write_rewind() {
store volatile i64 1024, i64* inttoptr (i64 3758260236 to i64*)
store volatile i64 8192, i64* inttoptr (i64 3758260236 to i64*)
%1 = call i32 @_cc3_delay_us_4(i32 1)
store volatile i64 8192, i64* inttoptr (i64 3758260228 to i64*)
ret void
}

LLVM IR (-O2):
define void @_cc3_pixbuf_write_rewind() {
store volatile i64 1024, i64* inttoptr (i64 3758260236 to i64*)
store volatile i64 8192, i64* inttoptr (i64 3758260236 to i64*)
%1 = tail call i32 @_cc3_delay_us_4(i32 1)
store volatile i64 8192, i64* inttoptr (i64 3758260228 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_display(int, char *);
int draw_logo() {
  draw_display(0, "    SameGame");
  draw_display(1, "by Josh Williams");
  return 0;
}


x86 assembly (clang, -O0):
<draw_logo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <draw_display@plt>
mov    $0x1,%edi
lea    0xedf(%rip),%rsi
call   1030 <draw_display@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_logo>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <draw_display@plt>
lea    0xee7(%rip),%rsi
mov    $0x1,%edi
call   1030 <draw_display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c" SameGame\00"
@.str.1 = [17 x i8] c"by Josh Williams\00"
define i32 @draw_logo() {
%1 = call i32 @draw_display(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @draw_display(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c" SameGame\00"
@.str.1 = [17 x i8] c"by Josh Williams\00"
define i32 @draw_logo() {
%1 = tail call i32 @draw_display(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @draw_display(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int execute_idle() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_idle() {
ret i32 0
}
/* Variables and functions */
int member_exist(char *);
int /*<<< orphan*/ printf(char *, char *);
int can_add_primitive_member(char *member) {
  if (member_exist(member) == (1)) {
    printf("member %s exists\n", member);
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<can_add_primitive_member>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <member_exist@plt>
cmp    $0x1,%eax
jne    115a <can_add_primitive_member+0x3a>
mov    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1161 <can_add_primitive_member+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_add_primitive_member>:
push   %rbx
mov    %rdi,%rbx
call   1040 <member_exist@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
jne    1146 <can_add_primitive_member+0x26>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"member %s exists\0A\00"
define i32 @can_add_primitive_member(i8* %0) {
%2 = tail call i32 @member_exist(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
struct vc4_val {
  int dummy;
};
struct vc4_info {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ eval(char *);
int /*<<< orphan*/ free(char *);
char *vc4_expand_expr(char const *, struct vc4_info const *,
                      struct vc4_val const *);
int64_t vc4_eval_expr(const char *exp, const struct vc4_info *info,
                      const struct vc4_val *vals) {
  char *exp2;
  int64_t ev;
  exp2 = vc4_expand_expr(exp, info, vals);
  ev = eval(exp2);
  free(exp2);
  return ev;
}


x86 assembly (clang, -O0):
<vc4_eval_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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   1040 <vc4_expand_expr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <eval@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vc4_info = type { i32 }
%struct.vc4_val = type { i32 }
define i32 @vc4_eval_expr(i8* %0, %struct.vc4_info* %1, %struct.vc4_val* %2) {
%4 = alloca i8*
%5 = alloca %struct.vc4_info*
%6 = alloca %struct.vc4_val*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store %struct.vc4_info* %1, %struct.vc4_info** %5
store %struct.vc4_val* %2, %struct.vc4_val** %6
%9 = load i8*, i8** %4
%10 = load %struct.vc4_info*, %struct.vc4_info** %5
%11 = load %struct.vc4_val*, %struct.vc4_val** %6
%12 = call i8* @vc4_expand_expr(i8* %9, %struct.vc4_info* %10, %struct.vc4_val* %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = call i32 @eval(i8* %13)
store i32 %14, i32* %8
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
%struct.vc4_info = type { i32 }
%struct.vc4_val = type { i32 }
define i32 @vc4_eval_expr(i8* %0, %struct.vc4_info* %1, %struct.vc4_val* %2) {
%4 = tail call i8* @vc4_expand_expr(i8* %0, %struct.vc4_info* %1, %struct.vc4_val* %2)
%5 = tail call i32 @eval(i8* %4)
%6 = tail call i32 @free(i8* %4)
ret i32 %5
}