xunge/DecIR huggingface dataset:
double d_sign(double *a, double *b) {
  double x;
  x = (*a >= 0 ? *a : -*a);
  return (*b >= 0 ? x : -x);
}


x86 assembly (clang, -O0):
<d_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <d_sign+0x33>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1157 <d_sign+0x57>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1185 <d_sign+0x85>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11a6 <d_sign+0xa6>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_sign>:
movsd  (%rdi),%xmm1
movapd 0xef4(%rip),%xmm2
movapd %xmm1,%xmm3
xorpd  %xmm2,%xmm3
xorpd  %xmm0,%xmm0
xorpd  %xmm4,%xmm4
cmpnlesd %xmm1,%xmm4
andpd  %xmm4,%xmm3
andnpd %xmm1,%xmm4
orpd   %xmm3,%xmm4
cmplesd (%rsi),%xmm0
xorpd  %xmm4,%xmm2
andpd  %xmm0,%xmm4
andnpd %xmm2,%xmm0
orpd   %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @d_sign(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = fcmp oge double %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load double*, double** %3
%11 = load double, double* %10
br label %16
12: ; preds = %2
%13 = load double*, double** %3
%14 = load double, double* %13
%15 = fneg double %14
br label %16
16: ; preds = %12, %9
%17 = phi double [ %11, %9 ], [ %15, %12 ]
store double %17, double* %5
%18 = load double*, double** %4
%19 = load double, double* %18
%20 = fcmp oge double %19, 0.000000e+00
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = load double, double* %5
br label %26
23: ; preds = %16
%24 = load double, double* %5
%25 = fneg double %24
br label %26
26: ; preds = %23, %21
%27 = phi double [ %22, %21 ], [ %25, %23 ]
ret double %27
}

LLVM IR (-O2):
define double @d_sign(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = fcmp ult double %3, 0.000000e+00
%5 = fneg double %3
%6 = select i1 %4, double %5, double %3
%7 = load double, double* %1
%8 = fcmp oge double %7, 0.000000e+00
%9 = fneg double %6
%10 = select i1 %8, double %6, double %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ delay1u();
void delay_m(int n) {
  int i;
  while (n--) {
    for (i = 1000; i--;)
      delay1u();
  }
}


x86 assembly (clang, -O0):
<delay_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     115b <delay_m+0x4b>
movl   $0x3e8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1156 <delay_m+0x46>
mov    $0x0,%al
call   1030 <delay1u@plt>
jmp    1136 <delay_m+0x26>
jmp    111b <delay_m+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_m>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1140 <delay_m+0x30>
mov    %edi,%ebx
nopl   0x0(%rax)
mov    $0xfffffc18,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <delay1u@plt>
inc    %ebp
jne    1130 <delay_m+0x20>
add    $0xffffffff,%ebx
jne    1120 <delay_m+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @delay_m(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %16
8: ; preds = %4
store i32 1000, i32* %3
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, -1
store i32 %11, i32* %3
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @delay1u()
br label %9
15: ; preds = %9
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay_m(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %6
3: ; preds = %8
%4 = add nsw i32 %7, -1
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ %0, %1 ]
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ 1000, %6 ], [ %10, %8 ]
%10 = add nsw i32 %9, -1
%11 = tail call i32 (...) @delay1u()
%12 = icmp eq i32 %10, 0
br i1 %12, label %3, label %8
13: ; preds = %3, %1
ret void
}
void process_simple_pop3_response(struct Seaper *seap, struct NetFrame *frame,
                                  const unsigned char *px, unsigned length) {
  seap;
  frame;
  px;
  length;
}


x86 assembly (clang, -O0):
<process_simple_pop3_response>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @process_simple_pop3_response(%struct.Seaper* %0, %struct.NetFrame* %1, i8* %2, i32 %3) {
%5 = alloca %struct.Seaper*
%6 = alloca %struct.NetFrame*
%7 = alloca i8*
%8 = alloca i32
store %struct.Seaper* %0, %struct.Seaper** %5
store %struct.NetFrame* %1, %struct.NetFrame** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.Seaper*, %struct.Seaper** %5
%10 = load %struct.NetFrame*, %struct.NetFrame** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @process_simple_pop3_response(%struct.Seaper* nocapture %0, %struct.NetFrame* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int getInfo(char *buf, int bufLen) {
  static const char *INFO = "info { name=Zeichenfolge }";
  int reqLen = strlen(INFO) + 1;
  if (buf != 0 && reqLen <= bufLen) {
    memcpy(buf, INFO, reqLen);
  }
  return reqLen;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2efa(%rip),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <getInfo+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116b <getInfo+0x4b>
mov    -0x8(%rbp),%rdi
mov    0x2ecd(%rip),%rsi
mov    -0x10(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
test   %rbx,%rbx
je     1154 <getInfo+0x34>
cmp    %r14d,%eax
jge    1154 <getInfo+0x34>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@getInfo.INFO = internal global i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i32 0, i32 0)
@.str = [27 x i8] c"info { name=Zeichenfolge }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** @getInfo.INFO
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8*, i8** @getInfo.INFO
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %11, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [27 x i8] c"info { name=Zeichenfolge }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %3, 1
%5 = icmp ne i8* %0, null
%6 = icmp slt i32 %3, %1
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
10: ; preds = %8, %2
ret i32 %4
}
/* Variables and functions */
void broke(int s) {}


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

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

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

LLVM IR (-O2):
define void @broke(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double,
                           double);
void print_cycle(FILE *stream, double const *cycle) {
  double ampl, mean, count;
  ampl = cycle[0];
  mean = cycle[1];
  count = cycle[2];
  fprintf(stream, "%.5G;%.5G;%.5G\n", ampl, mean, count / 2.0);
}


x86 assembly (clang, -O0):
<print_cycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  0xe9c(%rip),%xmm3
divsd  %xmm3,%xmm2
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cycle>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm2
mulsd  0xeda(%rip),%xmm2
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%.5G;%.5G;%.5G\0A\00"
define void @print_cycle(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32* %0, i32** %3
store double* %1, double** %4
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
store double %10, double* %5
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
store double %13, double* %6
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
store double %16, double* %7
%17 = load i32*, i32** %3
%18 = load double, double* %5
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fdiv double %20, 2.000000e+00
%22 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %18, double %19, double %21)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%.5G;%.5G;%.5G\0A\00"
define void @print_cycle(i32* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 2
%7 = load double, double* %6
%8 = fmul double %7, 5.000000e-01
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %3, double %5, double %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void SysCtlResetBehaviorSet(uint32_t ui32Behavior) {
  (*((volatile uint32_t *)(0x400FE1D8))) = ui32Behavior;
}


x86 assembly (clang, -O0):
<SysCtlResetBehaviorSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fe1d8,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlResetBehaviorSet>:
mov    %edi,0x400fe1d8
ret

LLVM IR (-O0):
define void @SysCtlResetBehaviorSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1074782680 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlResetBehaviorSet(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1074782680 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void print(unsigned int number, unsigned int encrypted) {
  printf("\nOrigional Number : %x\n", number);
  printf("\nEncrypted Number : %x\n", encrypted);
}


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

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0AOrigional Number : %x\0A\00"
@.str.1 = [24 x i8] c"\0AEncrypted Number : %x\0A\00"
define void @print(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 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AOrigional Number : %x\0A\00"
@.str.1 = [24 x i8] c"\0AEncrypted Number : %x\0A\00"
define void @print(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
void action(void *dg, void *cf, int len) {}


x86 assembly (clang, -O0):
<action>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @action(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hola Mundo.\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 = [13 x i8] c"Hola Mundo.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hola Mundo.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, int, int);
void ptrace_event_chroot(int event) {
  syscall(SYS_gettid, 0x7a711e06171129a2UL, 0xc6925d1ed6dcd674UL, event);
}


x86 assembly (clang, -O0):
<ptrace_event_chroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
mov    $0x171129a2,%esi
mov    $0xd6dcd674,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_event_chroot>:
mov    %edi,%ecx
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
mov    $0x171129a2,%esi
mov    $0xd6dcd674,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define void @ptrace_event_chroot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_gettid
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 387000738, i32 -690170252, i32 %4)
ret void
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define void @ptrace_event_chroot(i32 %0) {
%2 = load i32, i32* @SYS_gettid
%3 = tail call i32 @syscall(i32 %2, i32 387000738, i32 -690170252, i32 %0)
ret void
}
void rotr(int *a, int *b, int *c) {
  int swap1, swap2;
  swap1 = *b;
  *b = *a;
  swap2 = *c;
  *c = swap1;
  *a = swap2;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rsi),%eax
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
mov    (%rdx),%ecx
mov    %eax,(%rdx)
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32*, i32** %6
store i32 %16, i32* %17
%18 = load i32, i32* %8
%19 = load i32*, i32** %4
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %0
store i32 %5, i32* %1
%6 = load i32, i32* %2
store i32 %4, i32* %2
store i32 %6, i32* %0
ret void
}
void RTStrmPrintf(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmPrintf() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void tabify(FILE *f, int tab) {
  while (tab--) {
    (void)fputc('\t', f);
  }
}


x86 assembly (clang, -O0):
<tabify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1146 <tabify+0x36>
mov    -0x8(%rbp),%rsi
mov    $0x9,%edi
call   1030 <fputc@plt>
jmp    111f <tabify+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabify>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1132 <tabify+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x9,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <tabify+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @tabify(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = call i32 @fputc(i8 signext 9, i32* %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @tabify(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @fputc(i8 signext 9, i32* %0)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int foo() {
  printf("Hello from x86_64\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Hello from x86_64\00"
define i32 @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int strncasecmp(char *, char *, int);
void strncasecmp_diff_length_0() {
  char *x = "abcde";
  char *y = "aBd";
  if (strncasecmp(x, y, 5) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncasecmp_diff_length_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0xffffffff,%eax
je     1149 <strncasecmp_diff_length_0+0x39>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [4 x i8] c"aBd\00"
define void @strncasecmp_diff_length_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncasecmp(i8* %3, i8* %4, i32 5)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strncasecmp_diff_length_0() {
ret void
}
int foo(void) {
  int x;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Type definitions */
struct memhash {
  int dummy;
};
struct memblock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mem_freePool(struct memblock *);
int memhash_free(struct memhash *mh) {
  struct memblock *mb = (struct memblock *)mh;
  mem_freePool(mb);
}


x86 assembly (clang, -O0):
<memhash_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <mem_freePool@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.memhash = type { i32 }
%struct.memblock = type { i32 }
define i32 @memhash_free(%struct.memhash* %0) {
%2 = alloca i32
%3 = alloca %struct.memhash*
%4 = alloca %struct.memblock*
store %struct.memhash* %0, %struct.memhash** %3
%5 = load %struct.memhash*, %struct.memhash** %3
%6 = bitcast %struct.memhash* %5 to %struct.memblock*
store %struct.memblock* %6, %struct.memblock** %4
%7 = load %struct.memblock*, %struct.memblock** %4
%8 = call i32 @mem_freePool(%struct.memblock* %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.memhash = type { i32 }
%struct.memblock = type { i32 }
define i32 @memhash_free(%struct.memhash* %0) {
%2 = bitcast %struct.memhash* %0 to %struct.memblock*
%3 = tail call i32 @mem_freePool(%struct.memblock* %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void closeFd(int fd) {
  if (close(fd)) {
    printf("error closing file descriptor\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<closeFd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     1167 <closeFd+0x37>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeFd>:
push   %rax
call   1040 <close@plt>
test   %rax,%rax
jne    113d <closeFd+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"error closing file descriptor\0A\00"
@EXIT_FAILURE = global i32 0
define void @closeFd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [30 x i8] c"error closing file descriptor\00"
define void @closeFd(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t regread8(uint8_t addr) {
  uint8_t value = *(volatile uint8_t *)addr;
  return value;
}


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

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

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

LLVM IR (-O2):
define i64 @regread8(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ floor(scalar_t__);
scalar_t__ sqrt(double);
int arrangeCoins(int n) {
  if (n <= 0)
    return 0;
  long long nll = n;
  return (int)floor(sqrt(2.0 * nll + 0.25) - 0.5);
}


x86 assembly (clang, -O0):
<arrangeCoins>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1141 <arrangeCoins+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1182 <arrangeCoins+0x62>
movslq -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xead(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %rax,%xmm0
movsd  0xe8f(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrangeCoins>:
test   %edi,%edi
jle    1159 <arrangeCoins+0x39>
push   %rax
cvtsi2sd %edi,%xmm0
addsd  %xmm0,%xmm0
addsd  0xecb(%rip),%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xebe(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1040 <floor@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @arrangeCoins(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %20
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
store i64 %10, i64* %4
%11 = load i64, i64* %4
%12 = sitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %12, double 2.500000e-01)
%14 = call i64 @sqrt(double %13)
%15 = sitofp i64 %14 to double
%16 = fsub double %15, 5.000000e-01
%17 = fptosi double %16 to i64
%18 = call i64 @floor(i64 %17)
%19 = trunc i64 %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %8, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @arrangeCoins(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 2.000000e+00, double 2.500000e-01)
%6 = tail call i64 @sqrt(double %5)
%7 = sitofp i64 %6 to double
%8 = fadd double %7, -5.000000e-01
%9 = fptosi double %8 to i64
%10 = tail call i64 @floor(i64 %9)
%11 = trunc i64 %10 to i32
br label %12
12: ; preds = %1, %3
%13 = phi i32 [ %11, %3 ], [ 0, %1 ]
ret i32 %13
}
int *getPrevContext(int *context) { return (int *)*(context + 1); }


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

x86 assembly (clang, -O2):
<getPrevContext>:
movslq 0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @getPrevContext(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
ret i32* %7
}

LLVM IR (-O2):
define i32* @getPrevContext(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void RTSha512(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSha512() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_67() {
  Assert_real((isqrt(67) == 8),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              340, ("Integer square root of 67 should be 8"));
}


x86 assembly (clang, -O0):
<t_sqrt_67>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
call   1030 <isqrt@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x154,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_67>:
push   %rax
mov    $0x43,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x154,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 67 should be 8\00"
define void @t_sqrt_67() {
%1 = call i32 @isqrt(i32 67)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 67 should be 8\00"
define void @t_sqrt_67() {
%1 = tail call i32 @isqrt(i32 67)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int main1(int, int);
int main(void) {
  check_vect();
  return main1(2, 7);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
mov    $0x2,%edi
mov    $0x7,%esi
call   1040 <main1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x2,%edi
mov    $0x7,%esi
pop    %rax
jmp    1040 <main1@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 2, i32 7)
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
void chomp_string(char *str) {
  int last_index = strlen(str) - 1;
  if (last_index >= 0 && str[last_index] == '\n') {
    str[last_index] = '\0';
  }
}


x86 assembly (clang, -O0):
<chomp_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1156 <chomp_string+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1156 <chomp_string+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112a <chomp_string+0x1a>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112a <chomp_string+0x1a>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
/* Type definitions */
struct xmms_convert_buffers {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct xmms_convert_buffers *);
int /*<<< orphan*/ xmms_convert_buffers_free(struct xmms_convert_buffers *);
void xmms_convert_buffers_destroy(struct xmms_convert_buffers *buf) {
  if (!buf)
    return;
  xmms_convert_buffers_free(buf);
  free(buf);
}


x86 assembly (clang, -O0):
<xmms_convert_buffers_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <xmms_convert_buffers_destroy+0x1c>
jmp    114e <xmms_convert_buffers_destroy+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <xmms_convert_buffers_free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmms_convert_buffers_destroy>:
test   %rdi,%rdi
je     1137 <xmms_convert_buffers_destroy+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <xmms_convert_buffers_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.xmms_convert_buffers = type { i32 }
define void @xmms_convert_buffers_destroy(%struct.xmms_convert_buffers* %0) {
%2 = alloca %struct.xmms_convert_buffers*
store %struct.xmms_convert_buffers* %0, %struct.xmms_convert_buffers** %2
%3 = load %struct.xmms_convert_buffers*, %struct.xmms_convert_buffers** %2
%4 = icmp ne %struct.xmms_convert_buffers* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load %struct.xmms_convert_buffers*, %struct.xmms_convert_buffers** %2
%8 = call i32 @xmms_convert_buffers_free(%struct.xmms_convert_buffers* %7)
%9 = load %struct.xmms_convert_buffers*, %struct.xmms_convert_buffers** %2
%10 = call i32 @free(%struct.xmms_convert_buffers* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.xmms_convert_buffers = type { i32 }
define void @xmms_convert_buffers_destroy(%struct.xmms_convert_buffers* %0) {
%2 = icmp eq %struct.xmms_convert_buffers* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @xmms_convert_buffers_free(%struct.xmms_convert_buffers* %0)
%5 = tail call i32 @free(%struct.xmms_convert_buffers* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int openSerialPort(char *portName) {
  int fd = 0;
  fd = open(portName, O_RDWR);
  return (fd);
}


x86 assembly (clang, -O0):
<openSerialPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openSerialPort>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @openSerialPort(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @openSerialPort(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
int xmlUCSIsHangulCompatibilityJamo(int code) {
  return (((code >= 0x3130) && (code <= 0x318F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsHangulCompatibilityJamo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x3130,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsHangulCompatibilityJamo+0x26>
cmpl   $0x318f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsHangulCompatibilityJamo>:
add    $0xffffced0,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsHangulCompatibilityJamo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 12592
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 12687
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsHangulCompatibilityJamo(i32 %0) {
%2 = add i32 %0, -12592
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *m_alloc(int, int);
int /*<<< orphan*/ m_free(void *);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *m_stretch(void *p, int newlen, int oldlen, int size) {
  void *newp = m_alloc(newlen, size);
  memcpy(newp, p, oldlen * size);
  m_free(p);
  return newp;
}


x86 assembly (clang, -O0):
<m_stretch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <m_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
imul   -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1050 <m_free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_stretch>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    %ecx,%esi
call   1040 <m_alloc@plt>
mov    %rax,%r15
imul   %ebx,%ebp
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %r14,%rdi
call   1050 <m_free@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @m_stretch(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = call i8* @m_alloc(i32 %10, i32 %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = mul nsw i32 %15, %16
%18 = call i32 @memcpy(i8* %13, i8* %14, i32 %17)
%19 = load i8*, i8** %5
%20 = call i32 @m_free(i8* %19)
%21 = load i8*, i8** %9
ret i8* %21
}

LLVM IR (-O2):
define i8* @m_stretch(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i8* @m_alloc(i32 %1, i32 %3)
%6 = mul nsw i32 %3, %2
%7 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %6)
%8 = tail call i32 @m_free(i8* %0)
ret i8* %5
}
/* Variables and functions */
int close(int);
int tosFile_close(int fd) {
  int res = close(fd);
  return res;
}


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

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

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

LLVM IR (-O2):
define i32 @tosFile_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int initialize_standard_homotopy(int fixed_gamma) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(500, &fixed_gamma, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<initialize_standard_homotopy>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1f4,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @initialize_standard_homotopy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 500, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nBom dia, ola mundo\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0ABom dia, ola mundo\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"\0ABom dia, ola mundo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *open() {
  FILE *fp = fopen("../vec/test.txt", "r");
  if (fp == NULL) {
    perror("Unable to open test data file.\n");
    exit(errno);
  }
  return fp;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1174 <open+0x44>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     114b <open+0x1b>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"../vec/test.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [32 x i8] c"Unable to open test data file.\0A\00"
@errno = global i32 0
define i32* @open() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @errno
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = load i32*, i32** %1
ret i32* %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"../vec/test.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [32 x i8] c"Unable to open test data file.\0A\00"
@errno = global i32 0
define noalias i32* @open() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* @errno
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  char x[4];
  *((int *)&x) = 1;
  printf("%i\n", x[0]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xecc(%rip),%rdi
movsbl -0x14(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [4 x i8]* %6 to i32*
store i32 1, i32* %7
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret i32 0
}

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


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

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

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

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