xunge/DecIR huggingface dataset:
/* Variables and functions */
int sin(double);
double f2_prime(double x) { return -sin(x) - 3 * x * x; }


x86 assembly (clang, -O0):
<f2_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2_prime>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
neg    %eax
cvtsi2sd %eax,%xmm1
movsd  0xed7(%rip),%xmm0
movsd  (%rsp),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f2_prime(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sin(double %3)
%5 = sub nsw i32 0, %4
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = fmul double 3.000000e+00, %7
%9 = load double, double* %2
%10 = fneg double %8
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double %6)
ret double %11
}

LLVM IR (-O2):
define double @f2_prime(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = sub nsw i32 0, %2
%4 = sitofp i32 %3 to double
%5 = fmul double %0, -3.000000e+00
%6 = tail call double @llvm.fmuladd.f64(double %5, double %0, double %4)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ russian(int, int);
int main(void) {
  printf("4 * 2: %lld\n", russian(4, 2));
  printf("16 * 42: %lld\n", russian(16, 42));
  printf("999 * 999: %lld\n", russian(999, 999));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <russian@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x10,%edi
mov    $0x2a,%esi
call   1030 <russian@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3e7,%esi
mov    %esi,%edi
call   1030 <russian@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x2,%esi
call   1030 <russian@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x10,%edi
mov    $0x2a,%esi
call   1030 <russian@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x3e7,%edi
mov    $0x3e7,%esi
call   1030 <russian@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"4 * 2: %lld\0A\00"
@.str.1 = [15 x i8] c"16 * 42: %lld\0A\00"
@.str.2 = [17 x i8] c"999 * 999: %lld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @russian(i32 4, i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @russian(i32 16, i32 42)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @russian(i32 999, i32 999)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"4 * 2: %lld\0A\00"
@.str.1 = [15 x i8] c"16 * 42: %lld\0A\00"
@.str.2 = [17 x i8] c"999 * 999: %lld\0A\00"
define i32 @main() {
%1 = tail call i32 @russian(i32 4, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @russian(i32 16, i32 42)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @russian(i32 999, i32 999)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
long inw(long);
long pwfetch(long port) { return inw(port); }


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

x86 assembly (clang, -O2):
<pwfetch>:
jmp    1030 <inw@plt>

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

LLVM IR (-O2):
define i64 @pwfetch(i64 %0) {
%2 = tail call i64 @inw(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char,
                           unsigned char);
void print_reg(FILE *out, unsigned char reg) {
  fprintf(out, "%%%c%d", (reg >> 3) + 'a', reg & 7);
}


x86 assembly (clang, -O0):
<print_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
sar    $0x3,%eax
add    $0x61,%eax
mov    %al,%cl
movzbl -0x9(%rbp),%eax
and    $0x7,%eax
lea    0xec0(%rip),%rsi
movzbl %cl,%edx
movzbl %al,%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_reg>:
mov    %esi,%ecx
mov    %ecx,%eax
shr    $0x3,%al
add    $0x61,%al
and    $0x7,%ecx
movzbl %al,%edx
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%%%c%d\00"
define void @print_reg(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 3
%9 = add nsw i32 %8, 97
%10 = trunc i32 %9 to i8
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = and i32 %12, 7
%14 = trunc i32 %13 to i8
%15 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %10, i8 zeroext %14)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%%%c%d\00"
define void @print_reg(i32* nocapture %0, i8 zeroext %1) {
%3 = lshr i8 %1, 3
%4 = add nuw i8 %3, 97
%5 = and i8 %1, 7
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %4, i8 zeroext %5)
ret void
}
void NOROM_PRCMAudioClockExternalSource(void) {
  (*((volatile unsigned long
          *)(((unsigned long)(0x40082000 + 0x000000C8) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40082000 + 0x000000C8) & 0x000FFFFF) << 5) |
             ((0) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<NOROM_PRCMAudioClockExternalSource>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43041900,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<NOROM_PRCMAudioClockExternalSource>:
movq   $0x0,0x43041900
ret

LLVM IR (-O0):
define void @NOROM_PRCMAudioClockExternalSource() {
store volatile i64 0, i64* inttoptr (i64 1124342016 to i64*)
ret void
}

LLVM IR (-O2):
define void @NOROM_PRCMAudioClockExternalSource() {
store volatile i64 0, i64* inttoptr (i64 1124342016 to i64*)
ret void
}
int compare(int x) {
  switch (x) {
  case '*':
  case '/':
    return 2;
  case '+':
  case '-':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1148 <compare+0x48>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x4(%rbp)
jmp    114f <compare+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
add    $0xffffffd6,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     1117 <compare+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @compare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 42, label %5
i32 47, label %5
i32 43, label %6
i32 45, label %6
]
5: ; preds = %1, %1
store i32 2, i32* %2
br label %8
6: ; preds = %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.compare = [6 x i32] [i32 2, i32 1, i32 0, i32 1, i32 0, i32 2]
define i32 @compare(i32 %0) {
%2 = add i32 %0, -42
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.compare, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ NMI_WriteDibcomLogClose();
void NMI320_Deinit() { NMI_WriteDibcomLogClose(); }


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

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

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

LLVM IR (-O2):
define void @NMI320_Deinit() {
%1 = tail call i32 (...) @NMI_WriteDibcomLogClose()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ strcpy_char_to_wchar(int /*<<< orphan*/ *, char const *);
int strlen(char const *);
wchar_t *strdup_char_to_wchar(const char *src) {
  wchar_t *dst = malloc((strlen(src) + 1) * sizeof(wchar_t));
  if (!dst)
    return NULL;
  strcpy_char_to_wchar(dst, src);
  return dst;
}


x86 assembly (clang, -O0):
<strdup_char_to_wchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1171 <strdup_char_to_wchar+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1186 <strdup_char_to_wchar+0x56>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcpy_char_to_wchar@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup_char_to_wchar>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x4(,%rax,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115b <strdup_char_to_wchar+0x2b>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcpy_char_to_wchar@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @strdup_char_to_wchar(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = shl i32 %2, 2
%4 = add i32 %3, 4
%5 = tail call i32* @malloc(i32 %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy_char_to_wchar(i32* %5, i8* %0)
br label %9
9: ; preds = %1, %7
ret i32* %5
}
void foo500(int p) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @foo500(i32 %0) {
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
void chomp(char *string, ssize_t length) {
  if (string[length - 1] == '\n') {
    string[length - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1136 <chomp+0x36>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
movslq %esi,%rax
cmpb   $0xa,-0x1(%rax,%rdi,1)
jne    110f <chomp+0xf>
movb   $0x0,-0x1(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %2
store i8 0, i8* %5
br label %9
9: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TimerHardware_Init();
void TimerConductor_Init(void) { TimerHardware_Init(); }


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

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

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

LLVM IR (-O2):
define void @TimerConductor_Init() {
%1 = tail call i32 (...) @TimerHardware_Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int _3_d_s;
  printf("%lu\n", sizeof(float));
  printf("%lu\n", sizeof(double));
  printf("%lu\n", sizeof(float));
  printf("%lu\n", sizeof(3.5));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
scalar_t__ fabsf(float);
float sum2f_unchecked(float, float, float *);
float sum2f(float lhs, float rhs, float *roundoff) {
  if (fabsf(lhs) < fabsf(rhs)) {
    float tmp = lhs;
    lhs = rhs;
    rhs = tmp;
  }
  return sum2f_unchecked(lhs, rhs, roundoff);
}


x86 assembly (clang, -O0):
<sum2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
mov    %rax,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabsf@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    117c <sum2f+0x5c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rdi
call   1040 <sum2f_unchecked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum2f>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1030 <fabsf@plt>
mov    %rax,%rbx
movss  (%rsp),%xmm0
call   1030 <fabsf@plt>
cmp    %rax,%rbx
jl     1156 <sum2f+0x36>
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm0
jmp    1161 <sum2f+0x41>
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sum2f_unchecked@plt>

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

LLVM IR (-O2):
define float @sum2f(float %0, float %1, float* %2) {
%4 = tail call i64 @fabsf(float %0)
%5 = tail call i64 @fabsf(float %1)
%6 = icmp slt i64 %4, %5
%7 = select i1 %6, float %0, float %1
%8 = select i1 %6, float %1, float %0
%9 = tail call float @sum2f_unchecked(float %8, float %7, float* %2)
ret float %9
}
/* Variables and functions */
int big_file_test(int, char **);
int main(int argc, char **argv) {
  int ret = 0;
  while (ret == 0) {
    ret = big_file_test(argc, argv);
  }
  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   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114b <main+0x3b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <big_file_test@plt>
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <big_file_test@plt>
test   %eax,%eax
je     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @big_file_test(i32 %11, i8** %12)
store i32 %13, i32* %6
br label %7
14: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @big_file_test(i32 %0, i8** %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *program_name) {
  fprintf(stderr,
          "USAGE: %s -v | [-s] data_filename index_filename fasta_filename\n"
          "\t-s\tsort index file\n"
          "\nBases on a Design and Implementation of Andreas W. Hauser "
          "<hauser@genzentrum.lmu.de>.\n",
          program_name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [172 x i8] c"USAGE: %s -v | [-s] data_filename index_filename fasta_filename\0A\09-s\09sort index file\0A\0ABases on a Design and Implementation of Andreas W. Hauser <hauser@genzentrum.lmu.de>.\0A\00"
define void @usage(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 ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [172 x i8] c"USAGE: %s -v | [-s] data_filename index_filename fasta_filename\0A\09-s\09sort index file\0A\0ABases on a Design and Implementation of Andreas W. Hauser <hauser@genzentrum.lmu.de>.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copy(char *, char *, int);
void substring(char *dst, char *src, int beg, int end) {
  int len = end - beg;
  copy(dst, src + beg, len);
  dst[len] = '\0';
}


x86 assembly (clang, -O0):
<substring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <copy@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substring>:
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %rdi,%r14
sub    %edx,%ebx
movslq %edx,%rax
add    %rax,%rsi
mov    %ebx,%edx
call   1030 <copy@plt>
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @substring(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %9
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i32, i32* %9
%19 = call i32 @copy(i8* %13, i8* %17, i32 %18)
%20 = load i8*, i8** %5
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 0, i8* %23
ret void
}

LLVM IR (-O2):
define void @substring(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %3, %2
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = tail call i32 @copy(i8* %0, i8* %7, i32 %5)
%9 = sext i32 %5 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *idhash_fopen(char const *file_name, char const *mode) {
  return fopen(file_name, mode);
}


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

x86 assembly (clang, -O2):
<idhash_fopen>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i32* @idhash_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32* @fopen(i8* %5, i8* %6)
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @idhash_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
int subOK(int x, int y) {
  int a = x >> 31 & 0x1;
  int b = y >> 31 & 0x1;
  int c = (x + ~y + 1) >> 31 & 0x1;
  return (!a & !b) | (a & c) | (b & !c);
}


x86 assembly (clang, -O0):
<subOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
add    $0x1,%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x10(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
and    -0x14(%rbp),%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
cmpl   $0x0,-0x14(%rbp)
setne  %dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<subOK>:
mov    %edi,%eax
sub    %esi,%eax
mov    %esi,%ecx
or     %edi,%ecx
not    %ecx
and    %eax,%edi
or     %edi,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @subOK(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = ashr i32 %8, 31
%10 = and i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = ashr i32 %11, 31
%13 = and i32 %12, 1
store i32 %13, i32* %6
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = xor i32 %15, -1
%17 = add nsw i32 %14, %16
%18 = add nsw i32 %17, 1
%19 = ashr i32 %18, 31
%20 = and i32 %19, 1
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 0
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = and i32 %24, %28
%30 = load i32, i32* %5
%31 = load i32, i32* %7
%32 = and i32 %30, %31
%33 = or i32 %29, %32
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = icmp ne i32 %35, 0
%37 = xor i1 %36, true
%38 = zext i1 %37 to i32
%39 = and i32 %34, %38
%40 = or i32 %33, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @subOK(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = or i32 %1, %0
%5 = xor i32 %4, -1
%6 = and i32 %3, %0
%7 = or i32 %6, %5
%8 = xor i32 %3, -1
%9 = and i32 %8, %1
%10 = or i32 %7, %9
%11 = lshr i32 %10, 31
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p) {
    fputs("Memory exhausted", stderr);
    exit(2);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Memory exhausted\00"
@stderr = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 2)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"Memory exhausted\00"
@stderr = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to i8*
ret i8* %9
}
/* Variables and functions */
int toupper(int);
int _toupper(int c) { return toupper(c); }


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

x86 assembly (clang, -O2):
<_toupper>:
jmp    1030 <toupper@plt>

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

LLVM IR (-O2):
define i32 @_toupper(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
ret i32 %2
}
/* Variables and functions */
int _Print(char **, int *);
int ksprintf(char *out, const char *format, ...) {
  register int *varg = (int *)(&format);
  return _Print(&out, varg);
}


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

x86 assembly (clang, -O2):
<ksprintf>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <_Print@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @ksprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = bitcast i8** %4 to i32*
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @_Print(i8** %3, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @ksprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = bitcast i8** %4 to i32*
%6 = call i32 @_Print(i8** %3, i32* %5)
ret i32 %6
}
/* Variables and functions */
int open(char const *, int);
int /*<<< orphan*/ panic(char *);
int open_or_die(const char *file, int flags) {
  int ret = open(file, flags);
  if (ret < 0)
    panic("Cannot open file!\n");
  return ret;
}


x86 assembly (clang, -O0):
<open_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1154 <open_or_die+0x34>
lea    0xeb1(%rip),%rdi
call   1030 <panic@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_or_die>:
push   %rbx
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <open_or_die+0x18>
lea    0xecd(%rip),%rdi
call   1030 <panic@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Cannot open file!\0A\00"
define i32 @open_or_die(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** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"Cannot open file!\0A\00"
define i32 @open_or_die(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
void sendstr(p) register char *p;
{
  while (*p)
    sendbyte(*p++);
}


x86 assembly (clang, -O0):
<sendstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <sendstr+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <sendbyte@plt>
jmp    111c <sendstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <sendstr+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <sendbyte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <sendstr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @sendstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @sendbyte to i32 (i32, ...)*)(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @sendstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @sendbyte to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
void output_label_terminator() { output_byte(':'); }


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

x86 assembly (clang, -O2):
<output_label_terminator>:
mov    $0x3a,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define void @output_label_terminator() {
%1 = call i32 @output_byte(i8 signext 58)
ret void
}

LLVM IR (-O2):
define void @output_label_terminator() {
%1 = tail call i32 @output_byte(i8 signext 58)
ret void
}
/* Type definitions */
struct scv_vector {
  int dummy;
};

/* Variables and functions */
int scv_replace(struct scv_vector *, size_t, size_t, void const *, size_t);
int scv_insert(struct scv_vector *v, size_t i, const void *data, size_t nobj) {
  return scv_replace(v, i, i, data, nobj);
}


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

x86 assembly (clang, -O2):
<scv_insert>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
jmp    1030 <scv_replace@plt>

LLVM IR (-O0):
%struct.scv_vector = type { i32 }
define i32 @scv_insert(%struct.scv_vector* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca %struct.scv_vector*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store %struct.scv_vector* %0, %struct.scv_vector** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load %struct.scv_vector*, %struct.scv_vector** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @scv_replace(%struct.scv_vector* %9, i64 %10, i64 %11, i8* %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.scv_vector = type { i32 }
define i32 @scv_insert(%struct.scv_vector* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @scv_replace(%struct.scv_vector* %0, i64 %1, i64 %1, i8* %2, i64 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int ets_vsprintf(char *, char const *, int /*<<< orphan*/);
int vsprintf(char *s, const char *fmt, va_list ap) {
  return ets_vsprintf(s, fmt, ap);
}


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

x86 assembly (clang, -O2):
<vsprintf>:
jmp    1030 <ets_vsprintf@plt>

LLVM IR (-O0):
define i32 @vsprintf(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @ets_vsprintf(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ets_vsprintf(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XWindowChanges;

/* Variables and functions */
void set_XWindowChanges_x(void *_p, int _v) {
  ((XWindowChanges *)_p)->x = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowChanges_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowChanges_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowChanges_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main() {
  struct rlimit lim;
  printf("stack size: %ld\n", 0L);
  printf("process limit: %ld\n", 0L);
  printf("max file descriptors: %ld\n", 0L);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@.str = [17 x i8] c"stack size: %ld\0A\00"
@.str.1 = [20 x i8] c"process limit: %ld\0A\00"
@.str.2 = [27 x i8] c"max file descriptors: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rlimit
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i64 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"stack size: %ld\0A\00"
@.str.1 = [20 x i8] c"process limit: %ld\0A\00"
@.str.2 = [27 x i8] c"max file descriptors: %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i64 0)
ret i32 0
}
float *mat3_assign_mat2(float *result, float *m) {
  result[0] = m[0];
  result[1] = m[1];
  result[3] = m[2];
  result[4] = m[3];
  return result;
}


x86 assembly (clang, -O0):
<mat3_assign_mat2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3_assign_mat2>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define float* @mat3_assign_mat2(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 3
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %0, i64 4
store float %11, float* %12
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ serialWrite(int, int);
void sendSTX(int fd) {
  printf("<STX>");
  serialWrite(fd, 0x0F);
}


x86 assembly (clang, -O0):
<sendSTX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
call   1040 <serialWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendSTX>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
mov    $0xf,%esi
pop    %rbx
jmp    1040 <serialWrite@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"<STX>\00"
define void @sendSTX(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @serialWrite(i32 %4, i32 15)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"<STX>\00"
define void @sendSTX(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @serialWrite(i32 %0, i32 15)
ret void
}
void ft_striter(char *s, void (*f)(char *)) {
  if (s && f) {
    while (*s)
      f(s++);
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <ft_striter+0x57>
cmpq   $0x0,-0x10(%rbp)
je     1157 <ft_striter+0x57>
jmp    112b <ft_striter+0x2b>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <ft_striter+0x52>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    %rdi,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
call   *%rax
jmp    112b <ft_striter+0x2b>
jmp    1157 <ft_striter+0x57>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striter+0x33>
mov    %rsi,%r14
test   %rsi,%rsi
je     1133 <ft_striter+0x33>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striter+0x33>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1120 <ft_striter+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
tail call void %1(i8* %10)
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR8D_set(void) { return U_WMRCORENONE_set("U_WMR8D"); }


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

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

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

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