xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t GPIOIntStatus(uint32_t ui32Port, bool bMasked) {
  ;
  if (bMasked) {
    return ((*((volatile unsigned long *)(ui32Port + 0x00000418))));
  } else {
    return ((*((volatile unsigned long *)(ui32Port + 0x00000414))));
  }
}


x86 assembly (clang, -O0):
<GPIOIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1129 <GPIOIntStatus+0x29>
mov    -0x10(%rbp),%rax
mov    0x418(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <GPIOIntStatus+0x38>
mov    -0x10(%rbp),%rax
mov    0x414(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOIntStatus>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x414(%rcx,%rax,4),%rax
ret

LLVM IR (-O0):
define i64 @GPIOIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store volatile i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load volatile i64, i64* %4
%10 = add i64 %9, 1048
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
store i64 %12, i64* %3
br label %18
13: ; preds = %2
%14 = load volatile i64, i64* %4
%15 = add i64 %14, 1044
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
store i64 %17, i64* %3
br label %18
18: ; preds = %13, %8
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @GPIOIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 1044, i64 1048
%7 = add i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Variables and functions */
int shutdown(int, int);
__attribute__((weak)) int __real_shutdown(int fd, int how) {
  return shutdown(fd, how);
}


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

x86 assembly (clang, -O2):
<__real_shutdown>:
jmp    1030 <shutdown@plt>

LLVM IR (-O0):
define weak i32 @__real_shutdown(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 @shutdown(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @__real_shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
scalar_t__ real_Date();
uint64_t GetDirFile(uint64_t i_rotate_size, int64_t i_wanted) {
  if (i_wanted <= 0)
    i_wanted += real_Date();
  if (i_wanted <= 0)
    return 0;
  return i_wanted / i_rotate_size;
}


x86 assembly (clang, -O0):
<GetDirFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     113c <GetDirFile+0x2c>
mov    $0x0,%al
call   1030 <real_Date@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1152 <GetDirFile+0x42>
movl   $0x0,-0x4(%rbp)
jmp    115c <GetDirFile+0x4c>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDirFile>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
test   %esi,%esi
jg     112e <GetDirFile+0x1e>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <real_Date@plt>
add    %ebp,%eax
mov    %eax,%ebp
test   %eax,%eax
jle    1136 <GetDirFile+0x26>
mov    %ebp,%eax
cltd
idiv   %r14d
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @GetDirFile(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, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = call i64 (...) @real_Date()
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %5
br label %14
14: ; preds = %8, %2
%15 = load i32, i32* %5
%16 = icmp sle i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %3
br label %22
18: ; preds = %14
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = sdiv i32 %19, %20
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %17
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @GetDirFile(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i64 (...) @real_Date()
%6 = trunc i64 %5 to i32
%7 = add i32 %6, %1
%8 = icmp slt i32 %7, 1
br i1 %8, label %12, label %9
9: ; preds = %2, %4
%10 = phi i32 [ %7, %4 ], [ %1, %2 ]
%11 = sdiv i32 %10, %0
br label %12
12: ; preds = %4, %9
%13 = phi i32 [ %11, %9 ], [ 0, %4 ]
ret i32 %13
}
/* Variables and functions */
int toptoi();
int topdiff() {
  int b = toptoi();
  int a = toptoi();
  return (a - b);
}


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

x86 assembly (clang, -O2):
<topdiff>:
push   %rbx
xor    %eax,%eax
call   1030 <toptoi@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <toptoi@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @topdiff() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @toptoi()
store i32 %3, i32* %1
%4 = call i32 (...) @toptoi()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @topdiff() {
%1 = tail call i32 (...) @toptoi()
%2 = tail call i32 (...) @toptoi()
%3 = sub nsw i32 %2, %1
ret i32 %3
}
int ffc(int start, int len, long field) {
  register int i;
  for (i = start; i < len; i++) {
    if ((field & 1) == 0)
      break;
    field >>= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<ffc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1151 <ffc+0x51>
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1137 <ffc+0x37>
jmp    1151 <ffc+0x51>
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <ffc+0x14>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffc>:
mov    %edi,%eax
cmp    %esi,%edi
jge    1128 <ffc+0x28>
mov    %edx,%ecx
and    $0x1,%ecx
test   %rcx,%rcx
je     1128 <ffc+0x28>
add    $0x1,%eax
cmp    %esi,%eax
jge    1128 <ffc+0x28>
mov    %rdx,%rcx
sar    %rcx
and    $0x2,%edx
test   %rdx,%rdx
mov    %rcx,%rdx
jne    1110 <ffc+0x10>
ret

LLVM IR (-O0):
define i32 @ffc(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
store i32 %8, i32* %7
br label %9
9: ; preds = %21, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load i64, i64* %6
%15 = and i64 %14, 1
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
br label %24
18: ; preds = %13
%19 = load i64, i64* %6
%20 = ashr i64 %19, 1
store i64 %20, i64* %6
br label %21
21: ; preds = %18
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %9
24: ; preds = %17, %9
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @ffc(i32 %0, i32 %1, i64 %2) {
%4 = icmp sge i32 %0, %1
%5 = and i64 %2, 1
%6 = icmp eq i64 %5, 0
%7 = or i1 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %3, %8
%9 = phi i32 [ %12, %8 ], [ %0, %3 ]
%10 = phi i64 [ %11, %8 ], [ %2, %3 ]
%11 = ashr i64 %10, 1
%12 = add nsw i32 %9, 1
%13 = icmp sge i32 %12, %1
%14 = and i64 %10, 2
%15 = icmp eq i64 %14, 0
%16 = select i1 %13, i1 true, i1 %15
br i1 %16, label %17, label %8
17: ; preds = %8, %3
%18 = phi i32 [ %0, %3 ], [ %12, %8 ]
ret i32 %18
}
/* Variables and functions */
double fma(double, double, double);
double fnms64(double x, double y, double z) { return fma(x, y, -z); }


x86 assembly (clang, -O0):
<fnms64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
call   1030 <fma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnms64>:
xorps  0xee9(%rip),%xmm2
jmp    1030 <fma@plt>

LLVM IR (-O0):
define double @fnms64(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fneg double %9
%11 = call double @llvm.fma.f64(double %7, double %8, double %10)
ret double %11
}

LLVM IR (-O2):
define double @fnms64(double %0, double %1, double %2) {
%4 = fneg double %2
%5 = tail call double @llvm.fma.f64(double %0, double %1, double %4)
ret double %5
}
/* Variables and functions */
void destroy_labels(int *jump_array) { jump_array = NULL; }


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

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

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

LLVM IR (-O2):
define void @destroy_labels(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int syscall(int, int);
int uv__epoll_create1(int flags) { return syscall(291, flags); }


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

x86 assembly (clang, -O2):
<uv__epoll_create1>:
mov    %edi,%esi
mov    $0x123,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @uv__epoll_create1(i32 %0) {
%2 = tail call i32 @syscall(i32 291, i32 %0)
ret i32 %2
}
/* Variables and functions */
int laguna_readb(int);
int /*<<< orphan*/ laguna_writeb(int, int);
void __svgalib_laguna_inpal(int i, int *r, int *g, int *b) {
  laguna_writeb(0xa4, i);
  *r = laguna_readb(0xac);
  *g = laguna_readb(0xac);
  *b = laguna_readb(0xac);
}


x86 assembly (clang, -O0):
<__svgalib_laguna_inpal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xa4,%edi
call   1030 <laguna_writeb@plt>
mov    $0xac,%edi
call   1040 <laguna_readb@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0xac,%edi
call   1040 <laguna_readb@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0xac,%edi
call   1040 <laguna_readb@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_laguna_inpal>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%esi
mov    $0xa4,%edi
call   1030 <laguna_writeb@plt>
mov    $0xac,%edi
call   1040 <laguna_readb@plt>
mov    %eax,(%rbx)
mov    $0xac,%edi
call   1040 <laguna_readb@plt>
mov    %eax,(%r15)
mov    $0xac,%edi
call   1040 <laguna_readb@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @__svgalib_laguna_inpal(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = call i32 @laguna_writeb(i32 164, i32 %9)
%11 = call i32 @laguna_readb(i32 172)
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = call i32 @laguna_readb(i32 172)
%14 = load i32*, i32** %7
store i32 %13, i32* %14
%15 = call i32 @laguna_readb(i32 172)
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @__svgalib_laguna_inpal(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @laguna_writeb(i32 164, i32 %0)
%6 = tail call i32 @laguna_readb(i32 172)
store i32 %6, i32* %1
%7 = tail call i32 @laguna_readb(i32 172)
store i32 %7, i32* %2
%8 = tail call i32 @laguna_readb(i32 172)
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
char toupper(char);
int hex_value(char c) { return isdigit(c) ? c - '0' : toupper(c) - 'A' + 10; }


x86 assembly (clang, -O0):
<hex_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <hex_value+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <hex_value+0x45>
movsbl -0x1(%rbp),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_value>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
mov    $0xffffffd0,%ecx
test   %rax,%rax
jne    1141 <hex_value+0x21>
movsbl %bl,%edi
call   1040 <toupper@plt>
mov    %eax,%ebx
mov    $0xffffffc9,%ecx
movsbl %bl,%eax
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hex_value(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @toupper(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @hex_value(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call signext i8 @toupper(i8 signext %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8 [ %5, %4 ], [ %0, %1 ]
%8 = phi i32 [ -55, %4 ], [ -48, %1 ]
%9 = sext i8 %7 to i32
%10 = add nsw i32 %8, %9
ret i32 %10
}
void fill(char *target, char value, int count) {

  __asm__ volatile("mov %1,%%al; rep stosb"
                   : "=D"(target)
                   : "m"(value), "c"(count), "0"(target)
                   : "%eax", "memory");
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
rep stos %al,%es:(%rdi)
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
mov    %edx,%ecx
mov    %sil,-0x1(%rsp)
mov    -0x1(%rsp),%al
rep stos %al,%es:(%rdi)
ret

LLVM IR (-O0):
define void @fill(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = call i8* asm sideeffect "mov $1,%al; rep stosb", "={di},*m,{cx},0,~{eax},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %5, i32 %7, i8* %8)
store i8* %9, i8** %4
ret void
}

LLVM IR (-O2):
define void @fill(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8
store i8 %1, i8* %4
%5 = call i8* asm sideeffect "mov $1,%al; rep stosb", "={di},*m,{cx},0,~{eax},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %4, i32 %2, i8* %0)
ret void
}
int mxml_isspace(int ch) {
  return (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n');
}


x86 assembly (clang, -O0):
<mxml_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <mxml_isspace+0x3e>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <mxml_isspace+0x3e>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <mxml_isspace+0x3e>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mxml_isspace>:
cmp    $0x20,%edi
ja     111d <mxml_isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    111d <mxml_isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @mxml_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 13
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @mxml_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
char *_ultoa(int /*<<< orphan*/);
int strlen(char const *);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char const *, int);
int main(int argc, char *argv[]) {
  const char *p = _ultoa(sysconf(_SC_PAGESIZE));
  write(1, p, strlen(p));
  write(1, "\n", 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1060 <sysconf@plt>
mov    %eax,%edi
call   1050 <_ultoa@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe64(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1060 <sysconf@plt>
mov    %eax,%edi
call   1050 <_ultoa@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xe89(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @_SC_PAGESIZE
%8 = call i32 @sysconf(i32 %7)
%9 = call i8* @_ultoa(i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @write(i32 1, i8* %10, i32 %12)
%14 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @_SC_PAGESIZE
%4 = tail call i32 @sysconf(i32 %3)
%5 = tail call i8* @_ultoa(i32 %4)
%6 = tail call i32 @strlen(i8* %5)
%7 = tail call i32 @write(i32 1, i8* %5, i32 %6)
%8 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int getgid();
int getuid();
int /*<<< orphan*/ setregid(int, int);
int /*<<< orphan*/ setreuid(int, int);
void dropprivs() {
  int uid = getuid(), gid = getgid();
  setreuid(uid, uid);
  setregid(gid, gid);
}


x86 assembly (clang, -O0):
<dropprivs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getgid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <setreuid@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <setregid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropprivs>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %ebx,%esi
call   1050 <setreuid@plt>
mov    %ebp,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <setregid@plt>

LLVM IR (-O0):
define void @dropprivs() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getuid()
store i32 %3, i32* %1
%4 = call i32 (...) @getgid()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @setreuid(i32 %5, i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @setregid(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @dropprivs() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @getgid()
%3 = tail call i32 @setreuid(i32 %1, i32 %1)
%4 = tail call i32 @setregid(i32 %2, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
int main() {
  printf("%s%c", "Hola a todos", '\n');
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%s%c\00"
@.str.1 = [13 x i8] c"Hola a todos\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%c\00"
@.str.1 = [13 x i8] c"Hola a todos\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext 10)
ret i32 0
}
int interpolation_search(int *list, int key, int low, int high) {
  return low + (key - list[low]) * (high - low) / (list[high] - list[low]);
}


x86 assembly (clang, -O0):
<interpolation_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
sub    (%rcx,%rdx,4),%eax
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
mov    -0x8(%rbp),%rdx
movslq -0x10(%rbp),%rsi
sub    (%rdx,%rsi,4),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolation_search>:
mov    %ecx,%eax
movslq %edx,%rcx
mov    (%rdi,%rcx,4),%edx
sub    %edx,%esi
movslq %eax,%r8
sub    %ecx,%eax
imul   %esi,%eax
mov    (%rdi,%r8,4),%esi
sub    %edx,%esi
cltd
idiv   %esi
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @interpolation_search(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = sub nsw i32 %10, %15
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = sub nsw i32 %17, %18
%20 = mul nsw i32 %16, %19
%21 = load i32*, i32** %5
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = load i32*, i32** %5
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = load i32, i32* %29
%31 = sub nsw i32 %25, %30
%32 = sdiv i32 %20, %31
%33 = add nsw i32 %9, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @interpolation_search(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sub nsw i32 %1, %7
%9 = sub nsw i32 %3, %2
%10 = mul nsw i32 %8, %9
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = sub nsw i32 %13, %7
%15 = sdiv i32 %10, %14
%16 = add nsw i32 %15, %2
ret i32 %16
}
void __DELETE_java_nio_CharArrayBuffer(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_nio_CharArrayBuffer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_nio_CharArrayBuffer(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
void setContextNum(uint8_t largekey[0x40]) { memset(largekey + 0x38, 0xff, 8); }


x86 assembly (clang, -O0):
<setContextNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xe0,%rdi
mov    $0xff,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setContextNum>:
add    $0xe0,%rdi
mov    $0xff,%esi
mov    $0x8,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @setContextNum(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 56
%5 = call i32 @memset(i32* %4, i32 255, i32 8)
ret void
}

LLVM IR (-O2):
define void @setContextNum(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 56
%3 = tail call i32 @memset(i32* %2, i32 255, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SkipListFree(void *);
void SkipListDBRemove(void *beData) { SkipListFree(beData); }


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

x86 assembly (clang, -O2):
<SkipListDBRemove>:
jmp    1030 <SkipListFree@plt>

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

LLVM IR (-O2):
define void @SkipListDBRemove(i8* %0) {
%2 = tail call i32 @SkipListFree(i8* %0)
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
void _gettime(struct timespec *const t) {
  struct timespec tt;
  clock_gettime(CLOCK_MONOTONIC, &tt);
  t->tv_sec = tt.tv_sec;
  t->tv_nsec = tt.tv_nsec;
}


x86 assembly (clang, -O0):
<_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gettime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x4(%rbx)
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define void @_gettime(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca %struct.timespec
store %struct.timespec* %0, %struct.timespec** %2
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %3)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
store i32 %7, i32* %9
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load %struct.timespec*, %struct.timespec** %2
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 0
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define void @_gettime(%struct.timespec* nocapture writeonly %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 %10, i32* %11
ret void
}
void foo251(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo251(i32 %0) {
ret void
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ sigaction(int, struct sigaction *, int /*<<< orphan*/ *);
int /*<<< orphan*/ unlock_and_exit(int);
void guarded_sigaction(int signum, struct sigaction *sa) {
  if (sigaction(signum, sa, NULL) < 0) {
    perror("sigaction");
    unlock_and_exit(1);
  }
}


x86 assembly (clang, -O0):
<guarded_sigaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
cmp    $0x0,%rax
jge    116f <guarded_sigaction+0x3f>
lea    0xea0(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1040 <unlock_and_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guarded_sigaction>:
push   %rax
xor    %edx,%edx
call   1030 <sigaction@plt>
test   %rax,%rax
js     113f <guarded_sigaction+0xf>
pop    %rax
ret
lea    0xeba(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <unlock_and_exit@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@.str = [10 x i8] c"sigaction\00"
define void @guarded_sigaction(i32 %0, %struct.sigaction* %1) {
%3 = alloca i32
%4 = alloca %struct.sigaction*
store i32 %0, i32* %3
store %struct.sigaction* %1, %struct.sigaction** %4
%5 = load i32, i32* %3
%6 = load %struct.sigaction*, %struct.sigaction** %4
%7 = call i64 @sigaction(i32 %5, %struct.sigaction* %6, i32* null)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @unlock_and_exit(i32 1)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@.str = [10 x i8] c"sigaction\00"
define void @guarded_sigaction(i32 %0, %struct.sigaction* %1) {
%3 = tail call i64 @sigaction(i32 %0, %struct.sigaction* %1, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @unlock_and_exit(i32 1)
br label %8
8: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int u_int16_t;
struct ibuf {
  int dummy;
};

/* Variables and functions */
int ibuf_add(struct ibuf *, void *, int);
int /*<<< orphan*/ ibuf_free(struct ibuf *);
int imsg_add(struct ibuf *msg, void *data, u_int16_t datalen) {
  if (datalen)
    if (ibuf_add(msg, data, datalen) == -1) {
      ibuf_free(msg);
      return (-1);
    }
  return (datalen);
}


x86 assembly (clang, -O0):
<imsg_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1170 <imsg_add+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <ibuf_add@plt>
cmp    $0xffffffff,%eax
jne    116b <imsg_add+0x4b>
mov    -0x10(%rbp),%rdi
call   1030 <ibuf_free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <imsg_add+0x56>
jmp    1170 <imsg_add+0x50>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imsg_add>:
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1146 <imsg_add+0x26>
mov    %edx,%ebx
mov    %rdi,%r14
call   1040 <ibuf_add@plt>
cmp    $0xffffffff,%eax
jne    1148 <imsg_add+0x28>
mov    %r14,%rdi
call   1030 <ibuf_free@plt>
mov    $0xffffffff,%ebx
jmp    1148 <imsg_add+0x28>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ibuf = type { i32 }
define i32 @imsg_add(%struct.ibuf* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.ibuf*
%6 = alloca i8*
%7 = alloca i32
store %struct.ibuf* %0, %struct.ibuf** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load %struct.ibuf*, %struct.ibuf** %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @ibuf_add(%struct.ibuf* %11, i8* %12, i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load %struct.ibuf*, %struct.ibuf** %5
%18 = call i32 @ibuf_free(%struct.ibuf* %17)
store i32 -1, i32* %4
br label %22
19: ; preds = %10
br label %20
20: ; preds = %19, %3
%21 = load i32, i32* %7
store i32 %21, i32* %4
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
%struct.ibuf = type { i32 }
define i32 @imsg_add(%struct.ibuf* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @ibuf_add(%struct.ibuf* %0, i8* %1, i32 %2)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @ibuf_free(%struct.ibuf* %0)
br label %10
10: ; preds = %3, %5, %8
%11 = phi i32 [ -1, %8 ], [ %2, %5 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ is_space(char);
char *skip_to_space(char *p) {
  while (*p && !is_space(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skip_to_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <skip_to_space+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_space@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <skip_to_space+0x48>
jmp    1169 <skip_to_space+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_to_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_to_space>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <skip_to_space+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <is_space@plt>
test   %eax,%eax
jne    1138 <skip_to_space+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_to_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_to_space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @is_space(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @skip_to_space(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @is_space(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
int fn4(signed char a) { return ((int)a) | ((int)~a); }


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x1(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn4(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = xor i32 %6, -1
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @fn4(i8 signext %0) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;

/* Variables and functions */
void m_print_wm(const mpfr_t valueToPrint, const char *msg) {}


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

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

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

LLVM IR (-O2):
define void @m_print_wm(i32 %0, i8* nocapture %1) {
ret void
}
int main() {
  int j = 0;
  for (int b = 0;;) {
    j += j;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %4, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, %5
store i32 %7, i32* %2
br label %4
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help_show_message() {
  fprintf(stderr, "Usage: dexinfo <file.dex> [options]\n");
  fprintf(stderr, " options:\n");
  fprintf(stderr, "    -V             print verbose information\n");
}


x86 assembly (clang, -O0):
<help_show_message>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xeec(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xee2(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_show_message>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef3(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: dexinfo <file.dex> [options]\0A\00"
@.str.1 = [11 x i8] c" options:\0A\00"
@.str.2 = [46 x i8] c" -V print verbose information\0A\00"
define void @help_show_message() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: dexinfo <file.dex> [options]\0A\00"
@.str.1 = [11 x i8] c" options:\0A\00"
@.str.2 = [46 x i8] c" -V print verbose information\0A\00"
define void @help_show_message() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
long _InterlockedDecrement(long *);
long test2(long *p) { return _InterlockedDecrement(p); }


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

x86 assembly (clang, -O2):
<test2>:
jmp    1030 <_InterlockedDecrement@plt>

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

LLVM IR (-O2):
define i64 @test2(i64* %0) {
%2 = tail call i64 @_InterlockedDecrement(i64* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void run() { puts("Test plugin!"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Test plugin!\00"
define void @run() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Test plugin!\00"
define void @run() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int strcmp(char *a, char *b) {
  while (*a == *b) {
    if (*a == '\0') {
      return 0;
    }
    a++;
    b++;
  }
  return *a - *b;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Type definitions */
typedef scalar_t__ __v8qi;
typedef scalar_t__ __m64;

/* Variables and functions */
__m64 __attribute__((__always___, __nodebug__))
_mm_add_pi8(__m64 __m1, __m64 __m2) {
  return (__m64)((__v8qi)__m1 + (__v8qi)__m2);
}


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

x86 assembly (clang, -O2):
<_mm_add_pi8>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @_mm_add_pi8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @_mm_add_pi8(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}