xunge/DecIR huggingface dataset:
int ucnvpsiz(unsigned long cidr) {
  switch (((cidr >> 8) & 0xF)) {
  case 1:
    return 8;
    break;
  case 2:
    return 16;
    break;
  case 3:
    return 32;
    break;
  case 5:
    return 64;
    break;
  case 7:
    return 128;
    break;
  case 9:
    return 256;
    break;
  case 10:
    return 512;
    break;
  case 12:
    return 1024;
    break;
  case 14:
    return 2048;
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<ucnvpsiz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x8,%eax
and    $0xf,%eax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
sub    $0xd,%rax
ja     11a3 <ucnvpsiz+0xa3>
mov    -0x18(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x8,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0x10,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0x20,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0x40,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0x80,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0x100,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0x200,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0x400,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0x800,-0x4(%rbp)
jmp    11aa <ucnvpsiz+0xaa>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucnvpsiz>:
shr    $0x8,%edi
and    $0xf,%edi
lea    -0x1(%rdi),%rcx
mov    $0xffffffff,%eax
cmp    $0xd,%rcx
ja     1120 <ucnvpsiz+0x20>
lea    0xee4(%rip),%rax
mov    -0x4(%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @ucnvpsiz(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = lshr i64 %4, 8
%6 = and i64 %5, 15
switch i64 %6, label %16 [
i64 1, label %7
i64 2, label %8
i64 3, label %9
i64 5, label %10
i64 7, label %11
i64 9, label %12
i64 10, label %13
i64 12, label %14
i64 14, label %15
]
7: ; preds = %1
store i32 8, i32* %2
br label %17
8: ; preds = %1
store i32 16, i32* %2
br label %17
9: ; preds = %1
store i32 32, i32* %2
br label %17
10: ; preds = %1
store i32 64, i32* %2
br label %17
11: ; preds = %1
store i32 128, i32* %2
br label %17
12: ; preds = %1
store i32 256, i32* %2
br label %17
13: ; preds = %1
store i32 512, i32* %2
br label %17
14: ; preds = %1
store i32 1024, i32* %2
br label %17
15: ; preds = %1
store i32 2048, i32* %2
br label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@switch.table.ucnvpsiz = [14 x i32] [i32 8, i32 16, i32 32, i32 -1, i32 64, i32 -1, i32 128, i32 -1, i32 256, i32 512, i32 -1, i32 1024, i32 -1, i32 2048]
define i32 @ucnvpsiz(i64 %0) {
%2 = lshr i64 %0, 8
%3 = and i64 %2, 15
%4 = add nsw i64 %3, -1
%5 = icmp ult i64 %4, 14
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = getelementptr inbounds [14 x i32], [14 x i32]* @switch.table.ucnvpsiz, i64 0, i64 %4
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ -1, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
void update_pixels(__m256i *sig) {
  int i;
  for (i = 0; i < 3; ++i) {
    sig[i] = sig[i + 1];
    sig[i + 4] = sig[i + 5];
  }
}


x86 assembly (clang, -O0):
<update_pixels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1162 <update_pixels+0x62>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <update_pixels+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_pixels>:
mov    0x4(%rdi),%rax
mov    %rax,(%rdi)
mov    0xc(%rdi),%eax
mov    %eax,0x8(%rdi)
mov    0x14(%rdi),%rax
mov    %rax,0x10(%rdi)
mov    0x1c(%rdi),%eax
mov    %eax,0x18(%rdi)
ret

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

LLVM IR (-O2):
define void @update_pixels(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = getelementptr i32, i32* %0, i64 1
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds i32, i32* %0, i64 5
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 6
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = getelementptr inbounds i32, i32* %0, i64 7
%11 = load i32, i32* %10
store i32 %11, i32* %8
ret void
}
unsigned char unsignedchar_ignoring_unsignedchar(unsigned char x,
                                                 unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedchar_ignoring_unsignedchar>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @unsignedchar_ignoring_unsignedchar(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_unsignedchar(i8 returned zeroext %0, i8 zeroext %1) {
ret i8 %0
}
void gtk_combo_box_get_model() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_get_model() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_write(char, int);
void lcd_putc(char c) { lcd_write(c, 1); }


x86 assembly (clang, -O0):
<lcd_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%esi
movsbl -0x1(%rbp),%edi
call   1030 <lcd_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_putc>:
mov    $0x1,%esi
jmp    1030 <lcd_write@plt>

LLVM IR (-O0):
define void @lcd_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @lcd_write(i8 signext %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @lcd_putc(i8 signext %0) {
%2 = tail call i32 @lcd_write(i8 signext %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
double __attribute__((stdcall)) Sub(double x, double y) {
  printf("In sub!\nx = %f\ny = %f\n", x, y);
  return (x - y);
}


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

x86 assembly (clang, -O2):
<Sub>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"In sub!\0Ax = %f\0Ay = %f\0A\00"
define double @Sub(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fsub double %8, %9
ret double %10
}

LLVM IR (-O2):
@.str = [23 x i8] c"In sub!\0Ax = %f\0Ay = %f\0A\00"
define double @Sub(double %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %0, double %1)
%4 = fsub double %0, %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ S_IRWXU;
int errno;
scalar_t__ mkdir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int makedir(char *dir1) {
  if (mkdir(dir1, S_IRWXU) < 0) {
    perror(dir1);
    return (errno);
  }
  return 0;
}


x86 assembly (clang, -O0):
<makedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
jge    1162 <makedir+0x42>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <makedir+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makedir>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113e <makedir+0x1e>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@S_IRWXU = global i32 0
@errno = global i32 0
define i32 @makedir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @S_IRWXU
%6 = call i64 @mkdir(i8* %4, i32 %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @perror(i8* %9)
%11 = load i32, i32* @errno
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@errno = global i32 0
define i32 @makedir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = tail call i64 @mkdir(i8* %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @perror(i8* %0)
%7 = load i32, i32* @errno
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
float clamp(float, double, double);
float saturate(float v) { return clamp(v, 0.0, 1.0); }


x86 assembly (clang, -O0):
<saturate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
movsd  0xed3(%rip),%xmm2
call   1030 <clamp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturate>:
movsd  0xee8(%rip),%xmm2
xorps  %xmm1,%xmm1
jmp    1030 <clamp@plt>

LLVM IR (-O0):
define float @saturate(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @clamp(float %3, double 0.000000e+00, double 1.000000e+00)
ret float %4
}

LLVM IR (-O2):
define float @saturate(float %0) {
%2 = tail call float @clamp(float %0, double 0.000000e+00, double 1.000000e+00)
ret float %2
}
void g_closure_invalidate() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_invalidate() {
ret void
}
int is_even(int n) { return (n & 0x01) == 0; }


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_even(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
  putchar(EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi i32 [ %1, %0 ], [ %7, %4 ]
%12 = tail call i32 @putchar(i32 %11)
ret i32 0
}
int hsm_get_cl_error(int flags) {
  return (((flags << (15 - 6)) & 0xFFFF) >> (15 - 6 + 0));
}


x86 assembly (clang, -O0):
<hsm_get_cl_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x9,%eax
and    $0xffff,%eax
sar    $0x9,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsm_get_cl_error>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @hsm_get_cl_error(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) {
  int i;
  i = vsnprintf(buf, size, fmt, args);
  if (i < size)
    return i;
  if (size != 0)
    return size - 1;
  return 0;
}


x86 assembly (clang, -O0):
<vscnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x28(%rbp)
movslq -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1157 <vscnprintf+0x47>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <vscnprintf+0x69>
cmpq   $0x0,-0x18(%rbp)
je     1172 <vscnprintf+0x62>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x4(%rbp)
jmp    1179 <vscnprintf+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscnprintf>:
push   %rbx
mov    %rsi,%rbx
call   1030 <vsnprintf@plt>
movslq %eax,%rcx
cmp    %rbx,%rcx
jb     112b <vscnprintf+0x1b>
test   %rbx,%rbx
je     112d <vscnprintf+0x1d>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @vscnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, %1
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = icmp eq i64 %1, 0
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = trunc i64 %1 to i32
%12 = add i32 %11, -1
br label %13
13: ; preds = %8, %4, %10
%14 = phi i32 [ %12, %10 ], [ %5, %4 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fB() { printf("Press b\n"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Press b\0A\00"
define void @fB() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"Press b\00"
define void @fB() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void *yalex_memset(void *s, int c, unsigned int n) {
  if (s == 0)
    return 0;
  unsigned char *p = s;
  while (n--)
    *p++ = (unsigned char)c;
  return s;
}


x86 assembly (clang, -O0):
<yalex_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <yalex_memset+0x26>
movq   $0x0,-0x8(%rbp)
jmp    1165 <yalex_memset+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     115d <yalex_memset+0x5d>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    112e <yalex_memset+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yalex_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1127 <yalex_memset+0x17>
test   %edx,%edx
je     1127 <yalex_memset+0x17>
mov    %edx,%edx
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @yalex_memset(i8* writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i32 %2, 0
%6 = or i1 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = trunc i32 %1 to i8
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %7, %3
ret i8* %0
}
int fun332() { return 332; }


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

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

LLVM IR (-O0):
define i32 @fun332() {
ret i32 332
}

LLVM IR (-O2):
define i32 @fun332() {
ret i32 332
}
void testfn(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @testfn(i8* nocapture %0) {
ret void
}
int foo() { return 5; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 5
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 5
}
unsigned int decode(unsigned int instruction, unsigned int mask, int shift) {
  unsigned int output;
  output = (instruction & mask) >> shift;
  return output;
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    %edx,%ecx
mov    %edi,%eax
and    %esi,%eax
shr    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @decode(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = lshr i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cmdline_destroy();
int /*<<< orphan*/ game_destroy();
void server_destroy() {
  cmdline_destroy();
  game_destroy();
  return;
}


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

x86 assembly (clang, -O2):
<server_destroy>:
push   %rax
xor    %eax,%eax
call   1030 <cmdline_destroy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <game_destroy@plt>

LLVM IR (-O0):
define void @server_destroy() {
%1 = call i32 (...) @cmdline_destroy()
%2 = call i32 (...) @game_destroy()
ret void
}

LLVM IR (-O2):
define void @server_destroy() {
%1 = tail call i32 (...) @cmdline_destroy()
%2 = tail call i32 (...) @game_destroy()
ret void
}
void io_wait(void) { asm("jmp 1f;1:jmp 1f;1:"); }


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <io_wait+0x9>
jmp    110e <io_wait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
jmp    1102 <io_wait+0x2>
jmp    1104 <io_wait+0x4>
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect "jmp 1f;1:jmp 1f;1:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
long inb(int);
int /*<<< orphan*/ outl(long, int);
long cbfetch(long cfgadr) {
  outl((cfgadr | 0x80000000) & ~3, 0xcf8);
  return inb((0xcfc + (cfgadr & 3)));
}


x86 assembly (clang, -O0):
<cbfetch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x80000000,%rdi
or     -0x8(%rbp),%rdi
and    $0xfffffffffffffffc,%rdi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    -0x8(%rbp),%rax
and    $0x3,%rax
add    $0xcfc,%rax
mov    %eax,%edi
call   1040 <inb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbfetch>:
push   %rbx
mov    %rdi,%rbx
movabs $0xffffffff7ffffffc,%rax
ff ff ff
and    %rdi,%rax
mov    $0x80000000,%edi
or     %rax,%rdi
mov    $0xcf8,%esi
call   1030 <outl@plt>
or     $0xcfc,%ebx
and    $0xcff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <inb@plt>

LLVM IR (-O0):
define i64 @cbfetch(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 2147483648
%5 = and i64 %4, -4
%6 = call i32 @outl(i64 %5, i32 3320)
%7 = load i64, i64* %2
%8 = and i64 %7, 3
%9 = add nsw i64 3324, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @inb(i32 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @cbfetch(i64 %0) {
%2 = and i64 %0, -2147483652
%3 = or i64 %2, 2147483648
%4 = tail call i32 @outl(i64 %3, i32 3320)
%5 = trunc i64 %0 to i32
%6 = and i32 %5, 3
%7 = or i32 %6, 3324
%8 = tail call i64 @inb(i32 %7)
ret i64 %8
}
/* Variables and functions */
scalar_t__ errno;
int strtol(char const *, char **, int /*<<< orphan*/);
int parse_int(int *dst, const char *in) {
  int value;
  char *next;
  errno = 0;
  value = strtol(in, &next, 0);
  if (!errno && next != in) {
    *dst = value;
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e99(%rip),%rax
cmpq   $0x0,(%rax)
jne    1174 <parse_int+0x64>
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1174 <parse_int+0x64>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    117b <parse_int+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2eba(%rip),%r15
movq   $0x0,(%r15)
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
cmpq   $0x0,(%r15)
mov    $0xffffffff,%eax
jne    1155 <parse_int+0x45>
cmp    %rbx,0x8(%rsp)
je     1155 <parse_int+0x45>
mov    %ecx,(%r14)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@errno = global i64 0
define i32 @parse_int(i32* nocapture writeonly %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i64 0, i64* @errno
%5 = call i32 @strtol(i8* %1, i8** %3, i32 0)
%6 = load i64, i64* @errno
%7 = icmp ne i64 %6, 0
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, %1
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 %5, i32* %0
br label %12
12: ; preds = %2, %11
%13 = phi i32 [ 0, %11 ], [ -1, %2 ]
ret i32 %13
}
void rop3_141_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ S;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_141_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_141_1_0>:
mov    (%rdi),%al
or     %esi,%edx
or     %al,%dl
not    %dl
and    %al,%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_141_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_141_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
store i8 %9, i8* %0
ret void
}
void U_EMRBEGINPATH_print(const char *contents) { (void)(contents); }


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

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

LLVM IR (-O0):
define void @U_EMRBEGINPATH_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @U_EMRBEGINPATH_print(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ logging_null(char *, char const *, char const *,
                                unsigned long long);
scalar_t__ sysfsparser_getvalue(char *, char const *, char const *);
uint64_t fc_host_get_statistic(const char *which, const char *host) {
  uint64_t value = sysfsparser_getvalue("/sys/class"
                                        "/fc_host"
                                        "/%s/statistics/%s",
                                        host, which);
  logging_null("/sys/class"
               "/fc_host"
               "/%s/statistics/%s = %llu\n",
               host, which, (unsigned long long)value);
  return value;
}


x86 assembly (clang, -O0):
<fc_host_get_statistic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1040 <sysfsparser_getvalue@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
call   1030 <logging_null@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc_host_get_statistic>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xece(%rip),%rdi
mov    %r14,%rdx
call   1040 <sysfsparser_getvalue@plt>
mov    %rax,%rbx
lea    0xee0(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rax,%rcx
call   1030 <logging_null@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [36 x i8] c"/sys/class/fc_host/%s/statistics/%s\00"
@.str.1 = [44 x i8] c"/sys/class/fc_host/%s/statistics/%s = %llu\0A\00"
define i64 @fc_host_get_statistic(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @sysfsparser_getvalue(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = load i64, i64* %5
%12 = call i32 @logging_null(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %10, i64 %11)
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
@.str = [36 x i8] c"/sys/class/fc_host/%s/statistics/%s\00"
@.str.1 = [44 x i8] c"/sys/class/fc_host/%s/statistics/%s = %llu\0A\00"
define i64 @fc_host_get_statistic(i8* %0, i8* %1) {
%3 = tail call i64 @sysfsparser_getvalue(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%4 = tail call i32 @logging_null(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %0, i64 %3)
ret i64 %3
}
/* Type definitions */
struct aiocb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int aio_fsync(int op, struct aiocb *cb) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<aio_fsync>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_fsync>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_fsync(i32 %0, %struct.aiocb* %1) {
%3 = alloca i32
%4 = alloca %struct.aiocb*
store i32 %0, i32* %3
store %struct.aiocb* %1, %struct.aiocb** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_fsync(i32 %0, %struct.aiocb* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
scalar_t__ endst();
int /*<<< orphan*/ expression();
int /*<<< orphan*/ ol(char *);
int /*<<< orphan*/ zret();
doreturn() {
  if (endst() == 0)
    expression();
  ol("movl %ebp, %esp");
  ol("popl %ebp");
  zret();
}


x86 assembly (clang, -O0):
<doreturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <endst@plt>
cmp    $0x0,%rax
jne    1160 <doreturn+0x20>
mov    $0x0,%al
call   1030 <expression@plt>
lea    0xe99(%rip),%rdi
call   1040 <ol@plt>
lea    0xe9d(%rip),%rdi
call   1040 <ol@plt>
mov    $0x0,%al
call   1050 <zret@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doreturn>:
push   %rax
xor    %eax,%eax
call   1060 <endst@plt>
test   %rax,%rax
jne    1154 <doreturn+0x14>
xor    %eax,%eax
call   1030 <expression@plt>
lea    0xea5(%rip),%rdi
call   1040 <ol@plt>
lea    0xea9(%rip),%rdi
call   1040 <ol@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <zret@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"movl %ebp, %esp\00"
@.str.1 = [10 x i8] c"popl %ebp\00"
define i32 @doreturn() {
%1 = alloca i32
%2 = call i64 (...) @endst()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @expression()
br label %6
6: ; preds = %4, %0
%7 = call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @zret()
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"movl %ebp, %esp\00"
@.str.1 = [10 x i8] c"popl %ebp\00"
define i32 @doreturn() {
%1 = tail call i64 (...) @endst()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @expression()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @ol(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @zret()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ dxl_write_byte(unsigned char, int, unsigned char);
void setCWComplianceMargin(unsigned char id, unsigned char margin) {
  dxl_write_byte(id, (26), margin);
}


x86 assembly (clang, -O0):
<setCWComplianceMargin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x1a,%esi
movzbl %al,%edi
movzbl -0x2(%rbp),%edx
call   1030 <dxl_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCWComplianceMargin>:
mov    %esi,%edx
mov    $0x1a,%esi
jmp    1030 <dxl_write_byte@plt>

LLVM IR (-O0):
define void @setCWComplianceMargin(i8 zeroext %0, i8 zeroext %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 @dxl_write_byte(i8 zeroext %5, i32 26, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @setCWComplianceMargin(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @dxl_write_byte(i8 zeroext %0, i32 26, i8 zeroext %1)
ret void
}
double div_by(x, y)
double x;
double y;
{ return x / y; }


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

x86 assembly (clang, -O2):
<div_by>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @div_by(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htobe16(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void pack_to_be16(void *v, uint16_t u) {
  u = htobe16(u);
  memcpy(v, &u, sizeof(uint16_t));
}


x86 assembly (clang, -O0):
<pack_to_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <htobe16@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_to_be16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <htobe16@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @pack_to_be16(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 = call i32 @htobe16(i32 %5)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i8* %7, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @pack_to_be16(i8* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htobe16(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putstr(char const *s) {
  while (*s) {
    ft_putchar(s[0]);
    s += 1;
  }
}


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

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

LLVM IR (-O0):
define void @ft_putstr(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 %14
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = call i32 @ft_putchar(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @ft_putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char const *);
void startElement(void *userData, const char *name, const char **atts) {
  int i;
  int *depthPtr = (int *)userData;
  for (i = 0; i < *depthPtr; i++)
    putchar('\t');
  puts(name);
  *depthPtr += 1;
}


x86 assembly (clang, -O0):
<startElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    116a <startElement+0x4a>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1143 <startElement+0x23>
mov    -0x10(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startElement>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
cmpl   $0x0,(%rdi)
jle    1151 <startElement+0x31>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%rbx),%ebp
jl     1140 <startElement+0x20>
mov    %r14,%rdi
call   1040 <puts@plt>
addl   $0x1,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @startElement(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %8
store i32 0, i32* %7
br label %11
11: ; preds = %18, %3
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %13
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = call i32 @putchar(i8 signext 9)
br label %18
18: ; preds = %16
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
br label %11
21: ; preds = %11
%22 = load i8*, i8** %5
%23 = call i32 @puts(i8* %22)
%24 = load i32*, i32** %8
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @startElement(i8* nocapture %0, i8* nocapture %1, i8** nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 0, %3 ]
%9 = tail call i32 @putchar(i8 signext 9)
%10 = add nuw nsw i32 %8, 1
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %7, label %13
13: ; preds = %7, %3
%14 = tail call i32 @puts(i8* dereferenceable(1) %1)
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
ret void
}
int f(int y, int m) {
  if (m <= 2)
    return y - 1;
  else
    return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1122 <f+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <f+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
xor    %ecx,%ecx
cmp    $0x3,%esi
setl   %cl
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 3
%4 = sext i1 %3 to i32
%5 = add nsw i32 %4, %0
ret i32 %5
}