xunge/DecIR huggingface dataset:
int main(void) {
  char original[10 + 1] = "cadena";
  char copia[10 + 1];
  int i;
  for (i = 0; i <= 10; i++) {
    copia[i] = original[i];
    if (copia[i] == '\0') {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xeeb(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xee3(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jg     1175 <main+0x75>
movslq -0x20(%rbp),%rax
mov    -0xf(%rbp,%rax,1),%cl
movslq -0x20(%rbp),%rax
mov    %cl,-0x1a(%rbp,%rax,1)
movslq -0x20(%rbp),%rax
movsbl -0x1a(%rbp,%rax,1),%eax
cmp    $0x0,%eax
jne    1162 <main+0x62>
jmp    1175 <main+0x75>
jmp    1167 <main+0x67>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1131 <main+0x31>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.original = [11 x i8] c"cadena\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca [11 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [11 x i8]* %2 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 10
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 %15
store i8 %13, i8* %16
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %9
br label %28
24: ; preds = %9
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %6
28: ; preds = %23, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int M_PI;
double log(int);
double log_dnorm(double x) { return -0.5 * log(2 * M_PI) - 0.5 * x * x; }


x86 assembly (clang, -O0):
<log_dnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
shl    $0x1,%edi
call   1030 <log@plt>
movsd  0xed2(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xea1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_dnorm>:
push   %rax
movsd  %xmm0,(%rsp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
add    %edi,%edi
call   1030 <log@plt>
movsd  0xed2(%rip),%xmm1
movsd  (%rsp),%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @log_dnorm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_PI
%4 = mul nsw i32 2, %3
%5 = call double @log(i32 %4)
%6 = load double, double* %2
%7 = fmul double 5.000000e-01, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %5, double %10)
ret double %11
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @log_dnorm(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = tail call double @log(i32 %3)
%5 = fmul double %0, -5.000000e-01
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %4, double -5.000000e-01, double %6)
ret double %7
}
/* Variables and functions */
unsigned int page_end(const void *address) {
  return ((((intptr_t)address) + 4096 - 1) / 4096);
}


x86 assembly (clang, -O0):
<page_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1000,%rax
sub    $0x1,%rax
mov    $0x1000,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_end>:
lea    0xfff(%rdi),%rcx
lea    0x1ffe(%rdi),%rax
test   %rcx,%rcx
cmovns %rcx,%rax
shr    $0xc,%rax
ret

LLVM IR (-O0):
define i32 @page_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = add nsw i64 %4, 4096
%6 = sub nsw i64 %5, 1
%7 = sdiv i64 %6, 4096
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @page_end(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = add nsw i64 %2, 4095
%4 = sdiv i64 %3, 4096
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[3] = {'a', 'b', 'c'};
  printf("This isn't a string: '%s'\n", s);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x63,0x6(%rsp)
movw   $0x6261,0x4(%rsp)
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [3 x i8] c"abc"
@.str = [27 x i8] c"This isn't a string: '%s'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
store i32 0, i32* %1
%3 = bitcast [3 x i8]* %2 to i8*
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [3 x i8] c"abc"
@.str = [27 x i8] c"This isn't a string: '%s'\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipwhite(char *cp) {
  while (isspace(*cp))
    cp++;
  return cp;
}


x86 assembly (clang, -O0):
<skipwhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipwhite+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipwhite+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhite>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipwhite+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipwhite(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
float __ocml_add_rtp_f32(float, float);
float __fadd_rd(float x, float y) { return __ocml_add_rtp_f32(x, y); }


x86 assembly (clang, -O0):
<__fadd_rd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__ocml_add_rtp_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fadd_rd>:
jmp    1030 <__ocml_add_rtp_f32@plt>

LLVM IR (-O0):
define float @__fadd_rd(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__ocml_add_rtp_f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fadd_rd(float %0, float %1) {
%3 = tail call float @__ocml_add_rtp_f32(float %0, float %1)
ret float %3
}
void j_to_y(int j, char y[]) {
  j++;
  if (j < 10) {
    y[0] = (char)(j + 48);
    y[1] = '\0';
  } else {
    y[0] = (char)(int)(j / 10 + 48);
    y[1] = (char)(j % 10 + 48);
    y[2] = '\0';
  }
  return;
}


x86 assembly (clang, -O0):
<j_to_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1139 <j_to_y+0x39>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
jmp    116e <j_to_y+0x6e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_to_y>:
cmp    $0x8,%edi
jg     1113 <j_to_y+0x13>
add    $0x31,%dil
mov    %dil,(%rsi)
xor    %edi,%edi
mov    %dil,0x1(%rsi)
ret
add    $0x1,%edi
mov    %edi,%eax
mov    $0xcccccccd,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
lea    0x30(%rcx),%eax
mov    %al,(%rsi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%eax
sub    %eax,%edi
or     $0x30,%dil
movb   $0x0,0x2(%rsi)
mov    %dil,0x1(%rsi)
ret

LLVM IR (-O0):
define void @j_to_y(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 0, i8* %16
br label %32
17: ; preds = %2
%18 = load i32, i32* %3
%19 = sdiv i32 %18, 10
%20 = add nsw i32 %19, 48
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
%24 = load i32, i32* %3
%25 = srem i32 %24, 10
%26 = add nsw i32 %25, 48
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 1
store i8 %27, i8* %29
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8 0, i8* %31
br label %32
32: ; preds = %17, %9
ret void
}

LLVM IR (-O2):
define void @j_to_y(i32 %0, i8* nocapture writeonly %1) {
%3 = add nsw i32 %0, 1
%4 = icmp slt i32 %0, 9
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = trunc i32 %0 to i8
%7 = add i8 %6, 49
store i8 %7, i8* %1
br label %16
8: ; preds = %2
%9 = udiv i32 %3, 10
%10 = trunc i32 %9 to i8
%11 = add i8 %10, 48
store i8 %11, i8* %1
%12 = urem i32 %3, 10
%13 = trunc i32 %12 to i8
%14 = or i8 %13, 48
%15 = getelementptr inbounds i8, i8* %1, i64 2
store i8 0, i8* %15
br label %16
16: ; preds = %8, %5
%17 = phi i8 [ 0, %5 ], [ %14, %8 ]
%18 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %17, i8* %18
ret void
}
void VPutString(str) register char *str;
{
  while (*str)
    VPutChar(*str++);
}


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

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

LLVM IR (-O0):
define void @VPutString(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 (...)* @VPutChar to i32 (i32, ...)*)(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @VPutString(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 (...)* @VPutChar 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*/ printf(char *);
void print_usage(void) {
  printf("Usage: \n");
  printf("bufrdeco_test -i input_file [-h]\n");
  printf("   -h Print this help\n");
  printf("   -i Input file. Complete input path file for bufr file\n");
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [34 x i8] c"bufrdeco_test -i input_file [-h]\0A\00"
@.str.2 = [23 x i8] c" -h Print this help\0A\00"
@.str.3 = [58 x i8] c" -i Input file. Complete input path file for bufr file\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"Usage: \00"
@str.4 = [33 x i8] c"bufrdeco_test -i input_file [-h]\00"
@str.5 = [22 x i8] c" -h Print this help\00"
@str.6 = [57 x i8] c" -i Input file. Complete input path file for bufr file\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.6, i64 0, i64 0))
ret void
}
unsigned long ns_get32(const unsigned char *cp) {
  return (unsigned)cp[0] << 24 | cp[1] << 16 | cp[2] << 8 | cp[3];
}


x86 assembly (clang, -O0):
<ns_get32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_get32>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @ns_get32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
void swap(long *a, long *b) {
  long tmp = *a;
  *a = *b;
  *b = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
store i64 %4, i64* %0
store i64 %3, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void popAdd() {
  emitln("pop\t%%ebx");
  emitln("add\t%%ebx,%%eax");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"add\09%%ebx,%%eax\00"
define void @popAdd() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"add\09%%ebx,%%eax\00"
define void @popAdd() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  int foo;
  int *bar = &foo;
  if (bar) {
  } else {
    assert(0);
  }
  int *baz = NULL;
  if (baz) {
    assert(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1137 <main+0x27>
jmp    113e <main+0x2e>
xor    %edi,%edi
call   1030 <assert@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <main+0x48>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ nosound();
int /*<<< orphan*/ sound(int);
void click(void) {
  int i;
  for (i = 1; i < 2; i++) {
    int freq = 5000 + 2 * i;
    sound(5000 + 2 * i);
    delay(1);
    nosound();
  }
}


x86 assembly (clang, -O0):
<click>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1187 <click+0x57>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1388,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
add    $0x1388,%edi
call   1030 <sound@plt>
mov    $0x1,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1050 <nosound@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <click+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<click>:
push   %rax
mov    $0x138a,%edi
call   1030 <sound@plt>
mov    $0x1,%edi
call   1040 <delay@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <nosound@plt>

LLVM IR (-O0):
define void @click() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
br label %3
3: ; preds = %16, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = load i32, i32* %1
%8 = mul nsw i32 2, %7
%9 = add nsw i32 5000, %8
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = mul nsw i32 2, %10
%12 = add nsw i32 5000, %11
%13 = call i32 @sound(i32 %12)
%14 = call i32 @delay(i32 1)
%15 = call i32 (...) @nosound()
br label %16
16: ; preds = %6
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @click() {
%1 = tail call i32 @sound(i32 5002)
%2 = tail call i32 @delay(i32 1)
%3 = tail call i32 (...) @nosound()
ret void
}
/* Variables and functions */
size_t errno;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char **sys_errlist;
void tty_error(char *s) {
  fprintf(stderr, "\n\nerror: %s, (%s)\n", s, sys_errlist[errno]);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<tty_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    0x2eb8(%rip),%rax
mov    (%rax),%rax
mov    0x2e86(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_error>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ead(%rip),%rbx
mov    (%rbx),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%rax
mov    0x2e92(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"\0A\0Aerror: %s, (%s)\0A\00"
@sys_errlist = global i8** null
@errno = global i64 0
define void @tty_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8**, i8*** @sys_errlist
%6 = load i64, i64* @errno
%7 = getelementptr inbounds i8*, i8** %5, i64 %6
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fflush(i32 %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"\0A\0Aerror: %s, (%s)\0A\00"
@sys_errlist = global i8** null
@errno = global i64 0
define void @tty_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i8**, i8*** @sys_errlist
%4 = load i64, i64* @errno
%5 = getelementptr inbounds i8*, i8** %3, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fflush(i32 %8)
ret void
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EVBUFFER_EOL_CRLF_STRICT;
int /*<<< orphan*/ bufferevent_get_input(struct bufferevent *);
char *evbuffer_readln(int /*<<< orphan*/, size_t *, int /*<<< orphan*/);
char *read_line(struct bufferevent *bev, size_t *n) {
  return evbuffer_readln(bufferevent_get_input(bev), n,
                         EVBUFFER_EOL_CRLF_STRICT);
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bufferevent_get_input@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
call   1040 <evbuffer_readln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rbx
mov    %rsi,%rbx
call   1030 <bufferevent_get_input@plt>
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%edx
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <evbuffer_readln@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
@EVBUFFER_EOL_CRLF_STRICT = global i32 0
define i8* @read_line(%struct.bufferevent* %0, i64* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i64*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i64* %1, i64** %4
%5 = load %struct.bufferevent*, %struct.bufferevent** %3
%6 = call i32 @bufferevent_get_input(%struct.bufferevent* %5)
%7 = load i64*, i64** %4
%8 = load i32, i32* @EVBUFFER_EOL_CRLF_STRICT
%9 = call i8* @evbuffer_readln(i32 %6, i64* %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
@EVBUFFER_EOL_CRLF_STRICT = global i32 0
define i8* @read_line(%struct.bufferevent* %0, i64* %1) {
%3 = tail call i32 @bufferevent_get_input(%struct.bufferevent* %0)
%4 = load i32, i32* @EVBUFFER_EOL_CRLF_STRICT
%5 = tail call i8* @evbuffer_readln(i32 %3, i64* %1, i32 %4)
ret i8* %5
}
int is_emptyline(char *cmd) {
  while (*cmd == ' ')
    cmd++;
  return (*cmd) ? 0 : 1;
}


x86 assembly (clang, -O0):
<is_emptyline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <is_emptyline+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <is_emptyline+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_emptyline>:
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x20,%cl
je     1100 <is_emptyline>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_emptyline(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = icmp eq i8 %4, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ strcasecmp(void *, void *);
int hash_compare_string_insensitive(void *a, void *b) {
  return strcasecmp(a, b) == 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<hash_compare_string_insensitive>:
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 <strcasecmp@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_compare_string_insensitive>:
push   %rax
call   1030 <strcasecmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_compare_string_insensitive(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 i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @hash_compare_string_insensitive(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ List_insert(void *, void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void List_append(void *list, void *node) {
  assert(list != NULL);
  assert(node != NULL);
  List_insert(list, node, NULL);
}


x86 assembly (clang, -O0):
<List_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <List_insert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<List_append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <List_insert@plt>

LLVM IR (-O0):
define void @List_append(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 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @List_insert(i8* %13, i8* %14, i32* null)
ret void
}

LLVM IR (-O2):
define void @List_append(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @List_insert(i8* %0, i8* %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InfoNES_SoundClose();
void InfoNES_pAPUDone(void) { InfoNES_SoundClose(); }


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

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

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

LLVM IR (-O2):
define void @InfoNES_pAPUDone() {
%1 = tail call i32 (...) @InfoNES_SoundClose()
ret void
}
int main(void) {
  unsigned char i, j;
  i = 1;
  j = 2;
  return (i - j) != -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movb   $0x2,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
movzbl -0x6(%rbp),%ecx
sub    %ecx,%eax
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
store i8 2, i8* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = sub nsw i32 %5, %7
%9 = icmp ne i32 %8, -1
%10 = zext i1 %9 to i32
ret i32 %10
}

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

/* Variables and functions */
int dll_putc(int, int /*<<< orphan*/ *);
int __wrap__IO_putc(int c, FILE *stream) { return dll_putc(c, stream); }


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

x86 assembly (clang, -O2):
<__wrap__IO_putc>:
jmp    1030 <dll_putc@plt>

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

LLVM IR (-O2):
define i32 @__wrap__IO_putc(i32 %0, i32* %1) {
%3 = tail call i32 @dll_putc(i32 %0, i32* %1)
ret i32 %3
}
int sys$rename(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(22), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$rename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x16,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$rename>:
mov    $0x16,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$rename"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 22, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$rename"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 22, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ minscanf(char *, int *, double *);
int /*<<< orphan*/ printf(char *, int, double);
int main(void) {
  int a;
  double b;
  minscanf("%d %f", &a, &b);
  printf("%d,%f", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <minscanf@plt>
mov    -0x8(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <minscanf@plt>
mov    0xc(%rsp),%esi
movsd  0x10(%rsp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %f\00"
@.str.1 = [6 x i8] c"%d,%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @minscanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2)
%6 = load i32, i32* %1
%7 = load double, double* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6, double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *self) {
  printf("Usage: %s <pcapfile> <output_file_name> <print_to_screen_flag (0|1) "
         "> [<hcapfile>] [-b] [-g]\nWhen -b provided, checks are less strict "
         "meaning that bad handshakes will be displayed\nWhen -g provided, "
         "pcap2hcap will automatically choose the best handshake\n\n",
         self);
}


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

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

LLVM IR (-O0):
@.str = [255 x i8] c"Usage: %s <pcapfile> <output_file_name> <print_to_screen_flag (0|1) > [<hcapfile>] [-b] [-g]\0AWhen -b provided, checks are less strict meaning that bad handshakes will be displayed\0AWhen -g provided, pcap2hcap will automatically choose the best handshake\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([255 x i8], [255 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [255 x i8] c"Usage: %s <pcapfile> <output_file_name> <print_to_screen_flag (0|1) > [<hcapfile>] [-b] [-g]\0AWhen -b provided, checks are less strict meaning that bad handshakes will be displayed\0AWhen -g provided, pcap2hcap will automatically choose the best handshake\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([255 x i8], [255 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float add_floats(float x, float y) { return x + y; }


x86 assembly (clang, -O0):
<add_floats>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_floats>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @add_floats(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @add_floats(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_set_cache_line_inv(void *target) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_set_cache_line_inv(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
char *calloc(scalar_t__, int);
int /*<<< orphan*/ flu64_do_decode(char *, scalar_t__, char *);
scalar_t__ strlen(char *);
char *flu64_decode(char *in, ssize_t l) {
  if (l < 0)
    l = strlen(in);
  char *out = calloc(l, sizeof(char));
  flu64_do_decode(in, l, out);
  return out;
}


x86 assembly (clang, -O0):
<flu64_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1158 <flu64_decode+0x28>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <flu64_do_decode@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu64_decode>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
jns    114b <flu64_decode+0x1b>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <flu64_do_decode@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @flu64_decode(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %4
br label %11
11: ; preds = %8, %2
%12 = load i64, i64* %4
%13 = call i8* @calloc(i64 %12, i32 1)
store i8* %13, i8** %5
%14 = load i8*, i8** %3
%15 = load i64, i64* %4
%16 = load i8*, i8** %5
%17 = call i32 @flu64_do_decode(i8* %14, i64 %15, i8* %16)
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @flu64_decode(i8* %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %6
6: ; preds = %4, %2
%7 = phi i64 [ %5, %4 ], [ %1, %2 ]
%8 = tail call i8* @calloc(i64 %7, i32 1)
%9 = tail call i32 @flu64_do_decode(i8* %0, i64 %7, i8* %8)
ret i8* %8
}
int not(int x) { return !x; }


x86 assembly (clang, -O0):
<not>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @not(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @not(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void giga_logclose(void) { fflush(stdout); }


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

x86 assembly (clang, -O2):
<giga_logclose>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @giga_logclose() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
time_t seconds(struct timeval *t) { return t->tv_sec + t->tv_usec / 1000000.0; }


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xede(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
cvtsi2sdq 0x8(%rdi),%xmm0
movsd  (%rdi),%xmm1
divsd  0xeee(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define i64 @seconds(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %6, %10
%12 = fptosi double %11 to i64
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define i64 @seconds(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %7, %4
%9 = fptosi double %8 to i64
ret i64 %9
}
void reshUnlock() { ; }


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

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

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

LLVM IR (-O2):
define void @reshUnlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int /*<<< orphan*/ PAPI_perror(char *);
void papif_perror_(char *message, int message_len) {
  char tmp[128];
  Fortran2cstring(tmp, message, 128, message_len);
  PAPI_perror(tmp);
}


x86 assembly (clang, -O0):
<papif_perror_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x80,%edx
call   1030 <Fortran2cstring@plt>
lea    -0x90(%rbp),%rdi
call   1040 <PAPI_perror@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_perror_>:
push   %rbx
sub    $0x80,%rsp
mov    %esi,%ecx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%edx
call   1030 <Fortran2cstring@plt>
mov    %rbx,%rdi
call   1040 <PAPI_perror@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_perror_(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @Fortran2cstring(i8* %6, i8* %7, i32 128, i32 %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i32 @PAPI_perror(i8* %10)
ret void
}

LLVM IR (-O2):
define void @papif_perror_(i8* %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @Fortran2cstring(i8* %4, i8* %0, i32 128, i32 %1)
%6 = call i32 @PAPI_perror(i8* %4)
ret void
}