xunge/DecIR huggingface dataset:
/* Variables and functions */
int FD_SETSIZE;
int getdtablesize();
int _rpc_dtablesize(void) {
  static int size;
  if (size == 0) {
    size = getdtablesize();
    if (size > FD_SETSIZE)
      size = FD_SETSIZE;
  }
  return (size);
}


x86 assembly (clang, -O0):
<_rpc_dtablesize>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1157 <_rpc_dtablesize+0x47>
mov    $0x0,%al
call   1030 <getdtablesize@plt>
mov    %eax,0x2efe(%rip)
mov    0x2ef8(%rip),%eax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
jle    1152 <_rpc_dtablesize+0x42>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2eda(%rip)
jmp    1157 <_rpc_dtablesize+0x47>
mov    0x2ecf(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rpc_dtablesize>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
je     111d <_rpc_dtablesize+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <getdtablesize@plt>
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%ecx
cmp    %ecx,%eax
cmovg  %ecx,%eax
mov    %eax,0x2ef4(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@_rpc_dtablesize.size = internal global i32 0
@FD_SETSIZE = global i32 0
define i32 @_rpc_dtablesize() {
%1 = load i32, i32* @_rpc_dtablesize.size
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = call i32 (...) @getdtablesize()
store i32 %4, i32* @_rpc_dtablesize.size
%5 = load i32, i32* @_rpc_dtablesize.size
%6 = load i32, i32* @FD_SETSIZE
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = load i32, i32* @FD_SETSIZE
store i32 %9, i32* @_rpc_dtablesize.size
br label %10
10: ; preds = %8, %3
br label %11
11: ; preds = %10, %0
%12 = load i32, i32* @_rpc_dtablesize.size
ret i32 %12
}

LLVM IR (-O2):
@_rpc_dtablesize.size = internal unnamed_addr global i32 0
@FD_SETSIZE = global i32 0
define i32 @_rpc_dtablesize() {
%1 = load i32, i32* @_rpc_dtablesize.size
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 (...) @getdtablesize()
%5 = load i32, i32* @FD_SETSIZE
%6 = icmp sgt i32 %4, %5
%7 = select i1 %6, i32 %5, i32 %4
store i32 %7, i32* @_rpc_dtablesize.size
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ %7, %3 ], [ %1, %0 ]
ret i32 %9
}
/* Variables and functions */
int pm8901_mpp_config(unsigned int, int, unsigned int, unsigned int);
int pm8901_mpp_config_current_sink(unsigned mpp, unsigned level,
                                   unsigned control) {
  return pm8901_mpp_config(mpp, 5, level, control);
}


x86 assembly (clang, -O0):
<pm8901_mpp_config_current_sink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x5,%esi
call   1030 <pm8901_mpp_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8901_mpp_config_current_sink>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x5,%esi
jmp    1030 <pm8901_mpp_config@plt>

LLVM IR (-O0):
define i32 @pm8901_mpp_config_current_sink(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @pm8901_mpp_config(i32 %7, i32 5, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pm8901_mpp_config_current_sink(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8901_mpp_config(i32 %0, i32 5, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ to_array(int *, int /*<<< orphan*/ const);
void encode_domain_and_size(const uint8_t domain, const uint64_t hlen,
                            const uint64_t mlen, uint8_t *result) {
  to_array(result, hlen);
  to_array(result + 8, mlen);
  result[0] = ((domain << 4) & 0xF0) | (result[0] & 0x0F);
}


x86 assembly (clang, -O0):
<encode_domain_and_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <to_array@plt>
mov    -0x18(%rbp),%rdi
add    $0x20,%rdi
mov    -0xc(%rbp),%esi
call   1030 <to_array@plt>
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0,%ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_domain_and_size>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %edi,%ebp
mov    %rcx,%rdi
call   1030 <to_array@plt>
lea    0x20(%rbx),%rdi
mov    %r14d,%esi
call   1030 <to_array@plt>
shl    $0x4,%ebp
movzbl %bpl,%eax
mov    (%rbx),%ecx
and    $0xf,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @encode_domain_and_size(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** %8
%10 = load i32, i32* %6
%11 = call i32 @to_array(i32* %9, i32 %10)
%12 = load i32*, i32** %8
%13 = getelementptr inbounds i32, i32* %12, i64 8
%14 = load i32, i32* %7
%15 = call i32 @to_array(i32* %13, i32 %14)
%16 = load i32, i32* %5
%17 = shl i32 %16, 4
%18 = and i32 %17, 240
%19 = load i32*, i32** %8
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = and i32 %21, 15
%23 = or i32 %18, %22
%24 = load i32*, i32** %8
%25 = getelementptr inbounds i32, i32* %24, i64 0
store i32 %23, i32* %25
ret void
}

LLVM IR (-O2):
define void @encode_domain_and_size(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @to_array(i32* %3, i32 %1)
%6 = getelementptr inbounds i32, i32* %3, i64 8
%7 = tail call i32 @to_array(i32* %6, i32 %2)
%8 = shl i32 %0, 4
%9 = and i32 %8, 240
%10 = load i32, i32* %3
%11 = and i32 %10, 15
%12 = or i32 %11, %9
store i32 %12, i32* %3
ret void
}
int copysingl(singl, num)
int singl, num;
{
  int copy, i;
  copy = mkstate((256 + 1));
  for (i = 1; i <= num; ++i)
    copy = link_machines(copy, dupmachine(singl));
  return copy;
}


x86 assembly (clang, -O0):
<copysingl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x101,%edi
mov    $0x0,%al
call   1030 <mkstate@plt>
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     118d <copysingl+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <dupmachine@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    $0x0,%al
call   1050 <link_machines@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <copysingl+0x24>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysingl>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    $0x101,%edi
xor    %eax,%eax
call   1030 <mkstate@plt>
mov    %eax,%ebp
test   %ebx,%ebx
jle    116c <copysingl+0x3c>
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
xor    %eax,%eax
call   1040 <dupmachine@plt>
mov    %ebp,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <link_machines@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
jne    1150 <copysingl+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @copysingl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (i32, ...) bitcast (i32 (...)* @mkstate to i32 (i32, ...)*)(i32 257)
store i32 %7, i32* %5
store i32 1, i32* %6
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = call i32 (i32, ...) bitcast (i32 (...)* @dupmachine to i32 (i32, ...)*)(i32 %14)
%16 = call i32 (i32, i32, ...) bitcast (i32 (...)* @link_machines to i32 (i32, i32, ...)*)(i32 %13, i32 %15)
store i32 %16, i32* %5
br label %17
17: ; preds = %12
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %8
20: ; preds = %8
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @copysingl(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @mkstate to i32 (i32, ...)*)(i32 257)
%4 = icmp slt i32 %1, 1
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ 1, %2 ]
%7 = phi i32 [ %9, %5 ], [ %3, %2 ]
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @dupmachine to i32 (i32, ...)*)(i32 %0)
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @link_machines to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
%10 = add nuw i32 %6, 1
%11 = icmp eq i32 %6, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ %3, %2 ], [ %9, %5 ]
ret i32 %13
}
upscreen(f, n) {
  update(1);
  return (1);
}


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

x86 assembly (clang, -O2):
<upscreen>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <update@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @upscreen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i32, ...) bitcast (i32 (...)* @update to i32 (i32, ...)*)(i32 1)
ret i32 1
}

LLVM IR (-O2):
define i32 @upscreen(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @update to i32 (i32, ...)*)(i32 1)
ret i32 1
}
void handle_SEGV(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_SEGV(i32 %0) {
ret void
}
int getSliceWidth(int sig_width, int slices, int slice_n) {
  int pos_start = sig_width * slice_n / slices;
  int pos_end = sig_width * (slice_n + 1) / slices;
  return pos_end - pos_start;
}


x86 assembly (clang, -O0):
<getSliceWidth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSliceWidth>:
mov    %edx,%ecx
mov    %edx,%eax
imul   %edi,%eax
cltd
idiv   %esi
mov    %eax,%r8d
add    $0x1,%ecx
imul   %edi,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @getSliceWidth(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
store i32 %13, i32* %7
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
%17 = mul nsw i32 %14, %16
%18 = load i32, i32* %5
%19 = sdiv i32 %17, %18
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = sub nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @getSliceWidth(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = sdiv i32 %4, %1
%6 = add nsw i32 %2, 1
%7 = mul nsw i32 %6, %0
%8 = sdiv i32 %7, %1
%9 = sub nsw i32 %8, %5
ret i32 %9
}
/* Variables and functions */
double fabs(double);
int main(int argc, char const *argv[]) {
  if (fabs(2.0) == 2.0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xee6(%rip),%xmm0
movsd  0xede(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    113e <main+0x3e>
jp     113e <main+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <main+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call double @llvm.fabs.f64(double 2.000000e+00)
%7 = fcmp oeq double %6, 2.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %10
9: ; preds = %2
store i32 1, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int no_it_is_slack(const char **__and_) {
  int he_has_to_supply, _by_a_merchant;
  for (he_has_to_supply = 0;
       '0' <= (_by_a_merchant = **__and_) && _by_a_merchant <= '9'; ++*__and_)
    he_has_to_supply = he_has_to_supply * 10 + _by_a_merchant - '0';
  return he_has_to_supply;
}


x86 assembly (clang, -O0):
<no_it_is_slack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edx
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jg     1138 <no_it_is_slack+0x38>
cmpl   $0x39,-0x10(%rbp)
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <no_it_is_slack+0x48>
jmp    1168 <no_it_is_slack+0x68>
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    110f <no_it_is_slack+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_it_is_slack>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
lea    -0x30(%rdx),%esi
xor    %eax,%eax
cmp    $0x9,%sil
ja     113f <no_it_is_slack+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movzbl %dl,%edx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
mov    %rcx,(%rdi)
movzbl (%rcx),%edx
lea    -0x30(%rdx),%esi
add    $0x1,%rcx
cmp    $0xa,%sil
jb     1120 <no_it_is_slack+0x20>
ret

LLVM IR (-O0):
define i32 @no_it_is_slack(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %5
5: ; preds = %22, %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp sle i32 48, %9
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %11, %5
%15 = phi i1 [ false, %5 ], [ %13, %11 ]
br i1 %15, label %16, label %26
16: ; preds = %14
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 10
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
%21 = sub nsw i32 %20, 48
store i32 %21, i32* %3
br label %22
22: ; preds = %16
%23 = load i8**, i8*** %2
%24 = load i8*, i8** %23
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %23
br label %5
26: ; preds = %14
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @no_it_is_slack(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %3, %1 ]
%8 = phi i8* [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %19
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_toss_pack(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_toss_pack>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_toss_pack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_toss_pack(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
adr0adrx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*((double *)10000000)) <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adrx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    $0x989680,%eax
movsd  (%rax),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1149 <adr0adrx1+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1150 <adr0adrx1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrx1>:
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0x989680,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @adr0adrx1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double, double* inttoptr (i64 10000000 to double*)
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %16
%18 = load double, double* %17
%19 = fcmp ole double %14, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @adr0adrx1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = load double, double* inttoptr (i64 10000000 to double*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %8
%10 = load double, double* %9
%11 = fcmp ole double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void g_list_remove() {}


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

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

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

LLVM IR (-O2):
define void @g_list_remove() {
ret void
}
/* Variables and functions */
char _toupper(char);
void toUpperCase(char *s) {
  while (*s != 0) {
    *s = _toupper(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<toUpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <toUpperCase+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <_toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <toUpperCase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @toUpperCase(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 signext i8 @_toupper(i8 signext %5)
store i8 %7, i8* %6
%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
}
unsigned int find_span(unsigned int n, const double t[n + 1], double x) {
  assert(x >= t[0]);
  unsigned int i = 0;
  while (x >= t[i])
    i++;
  i--;
  return i;
}


x86 assembly (clang, -O0):
<find_span>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movl   $0x0,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
ucomisd (%rax,%rcx,8),%xmm0
jb     116c <find_span+0x5c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1147 <find_span+0x37>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_span>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%rbx
xor    %edi,%edi
ucomisd (%rsi),%xmm0
setae  %dil
xor    %eax,%eax
call   1030 <assert@plt>
movsd  0x8(%rsp),%xmm0
mov    $0xfffffffe,%eax
nopw   0x0(%rax,%rax,1)
lea    0x2(%rax),%ecx
add    $0x1,%eax
ucomisd (%rbx,%rcx,8),%xmm0
jae    1140 <find_span+0x30>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @find_span(i32 %0, double* nocapture %1, double %2) {
%4 = load double, double* %1
%5 = fcmp ole double %4, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %6)
br label %8
8: ; preds = %8, %3
%9 = phi i32 [ 0, %3 ], [ %14, %8 ]
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = load double, double* %11
%13 = fcmp ugt double %12, %2
%14 = add i32 %9, 1
br i1 %13, label %15, label %8
15: ; preds = %8
%16 = add i32 %9, -1
ret i32 %16
}
int test_imm_F6uint16_mem(unsigned short *val) {
  return ((*val) & (-0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff0a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F6uint16_mem>:
movzwl (%rdi),%eax
test   $0xff0a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F6uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -246
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_F6uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -246
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int isActive(int /*<<< orphan*/);
int /*<<< orphan*/ readPidFile(char *);
int isParActive(void) { return isActive(readPidFile("/tmp/.pidlbr-dmn")); }


x86 assembly (clang, -O0):
<isParActive>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <readPidFile@plt>
mov    %eax,%edi
call   1030 <isActive@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isParActive>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <readPidFile@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <isActive@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/tmp/.pidlbr-dmn\00"
define i32 @isParActive() {
%1 = call i32 @readPidFile(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @isActive(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [17 x i8] c"/tmp/.pidlbr-dmn\00"
define i32 @isParActive() {
%1 = tail call i32 @readPidFile(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @isActive(i32 %1)
ret i32 %2
}
void bitmap_clear_bit(int nr, unsigned long *maskp) {
  maskp[((nr) / (8 * sizeof(long)))] &= ~(1UL << ((nr) % (8 * sizeof(long))));
}


x86 assembly (clang, -O0):
<bitmap_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
and    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_clear_bit>:
movslq %edi,%rcx
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
shr    $0x6,%rcx
and    %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @bitmap_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = urem i64 %6, 64
%8 = shl i64 1, %7
%9 = xor i64 %8, -1
%10 = load i64*, i64** %4
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = udiv i64 %12, 64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
%15 = load i64, i64* %14
%16 = and i64 %15, %9
store i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @bitmap_clear_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = xor i64 %5, -1
%7 = lshr i64 %3, 6
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = and i64 %9, %6
store i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Hardware_Init();
int /*<<< orphan*/ Library_Init();
int /*<<< orphan*/ Special_Init();
int main(void) {
  Hardware_Init();
  Special_Init();
  Library_Init();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Hardware_Init@plt>
mov    $0x0,%al
call   1050 <Special_Init@plt>
mov    $0x0,%al
call   1040 <Library_Init@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Hardware_Init@plt>
xor    %eax,%eax
call   1050 <Special_Init@plt>
xor    %eax,%eax
call   1040 <Library_Init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Hardware_Init()
%3 = call i32 (...) @Special_Init()
%4 = call i32 (...) @Library_Init()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Hardware_Init()
%2 = tail call i32 (...) @Special_Init()
%3 = tail call i32 (...) @Library_Init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f(long, int);
main() {
  if (f(2L, 0xdecadeL) != 0xdecadeL)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0xdecade,%esi
call   1040 <f@plt>
cltq
cmp    $0xdecade,%rax
je     1163 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xdecade,%esi
call   1040 <f@plt>
cmp    $0xdecade,%eax
jne    114e <main+0x1e>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i64 2, i32 14600926)
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, 14600926
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i64 2, i32 14600926)
%2 = icmp eq i32 %1, 14600926
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: tracepath6 [-n] [-b] [-l <len>] <destination>[/<port>]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"Usage: tracepath6 [-n] [-b] [-l <len>] <destination>[/<port>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"Usage: tracepath6 [-n] [-b] [-l <len>] <destination>[/<port>]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void fatals(fmt, x1, x2, x3, x4, x5, x6, x7, x8) char *fmt;
{
  char buffer[200];
  sprintf(buffer, fmt, x1, x2, x3, x4, x5, x6, x7, x8);
  fatal(buffer);
}


x86 assembly (clang, -O0):
<fatals>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x108,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    -0xf0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%ebx
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatals>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0xf0(%rsp),%r11d
mov    0xf8(%rsp),%r14d
mov    0x100(%rsp),%r15d
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
push   %r15
push   %r14
push   %r11
push   %r10
call   1030 <sprintf@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fatals(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca [200 x i8]
store i8* %0, i8** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%20 = getelementptr inbounds [200 x i8], [200 x i8]* %19, i64 0, i64 0
%21 = load i8*, i8** %10
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = load i32, i32* %13
%25 = load i32, i32* %14
%26 = load i32, i32* %15
%27 = load i32, i32* %16
%28 = load i32, i32* %17
%29 = load i32, i32* %18
%30 = call i32 (i8*, i8*, ...) @sprintf(i8* %20, i8* %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 %28, i32 %29)
%31 = getelementptr inbounds [200 x i8], [200 x i8]* %19, i64 0, i64 0
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* %31)
ret void
}

LLVM IR (-O2):
define void @fatals(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca [200 x i8]
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* dereferenceable(1) %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8)
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* %11)
ret void
}
/* Variables and functions */
int strlen(char *s) {
  char *p = s;
  while (*p != '\0')
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void RTAvlHCPhysDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlHCPhysDestroy() {
ret void
}
int delta(int a, int b, int c) { return ((b * b) - (4 * a * c)); }


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
mov    %esi,%eax
imul   %esi,%eax
imul   %edx,%edi
shl    $0x2,%edi
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @delta(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %1
%5 = mul i32 %0, -4
%6 = mul i32 %5, %2
%7 = add i32 %6, %4
ret i32 %7
}
/* Type definitions */
struct input_event {
  int /*<<< orphan*/ code;
  int /*<<< orphan*/ type;
};
typedef int /*<<< orphan*/ ev;

/* Variables and functions */
int /*<<< orphan*/ EV_SYN;
int /*<<< orphan*/ SYN_REPORT;
int /*<<< orphan*/ memset(struct input_event *, int /*<<< orphan*/, int);
int write(int, struct input_event *, int);
int uinput_syn_event(int fd) {
  struct input_event ev;
  memset(&ev, 0, sizeof(ev));
  ev.type = EV_SYN;
  ev.code = SYN_REPORT;
  return write(fd, &ev, sizeof(ev));
}


x86 assembly (clang, -O0):
<uinput_syn_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uinput_syn_event>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.input_event = type { i32, i32 }
@EV_SYN = global i32 0
@SYN_REPORT = global i32 0
define i32 @uinput_syn_event(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.input_event
store i32 %0, i32* %2
%4 = call i32 @memset(%struct.input_event* %3, i32 0, i32 8)
%5 = load i32, i32* @EV_SYN
%6 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 1
store i32 %5, i32* %6
%7 = load i32, i32* @SYN_REPORT
%8 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 0
store i32 %7, i32* %8
%9 = load i32, i32* %2
%10 = call i32 @write(i32 %9, %struct.input_event* %3, i32 8)
ret i32 %10
}

LLVM IR (-O2):
%struct.input_event = type { i32, i32 }
@EV_SYN = global i32 0
@SYN_REPORT = global i32 0
define i32 @uinput_syn_event(i32 %0) {
%2 = alloca %struct.input_event
%3 = bitcast %struct.input_event* %2 to i8*
%4 = call i32 @memset(%struct.input_event* %2, i32 0, i32 8)
%5 = load i32, i32* @EV_SYN
%6 = getelementptr inbounds %struct.input_event, %struct.input_event* %2, i64 0, i32 1
store i32 %5, i32* %6
%7 = load i32, i32* @SYN_REPORT
%8 = getelementptr inbounds %struct.input_event, %struct.input_event* %2, i64 0, i32 0
store i32 %7, i32* %8
%9 = call i32 @write(i32 %0, %struct.input_event* %2, i32 8)
ret i32 %9
}
int test_imm_48int64_lowword_mem(long long *val) {
  return ((*val) & (0x48 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_48int64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x48,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_48int64_lowword_mem>:
testb  $0x48,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_48int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 72
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_48int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 72
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsprintf(int const *, char const *, int /*<<< orphan*/);
int vsnprintf(const *str, size_t size, const char *format, va_list ap) {
  return vsprintf(str, format, ap);
}


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

x86 assembly (clang, -O2):
<vsnprintf>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vsprintf@plt>

LLVM IR (-O0):
define i32 @vsnprintf(i32* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @vsprintf(i32* %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @vsnprintf(i32* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsprintf(i32* %0, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DebugLogging(char *);
void MacroTune(int devHandle, int channel) { DebugLogging("MacroTune\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"MacroTune\0A\00"
define void @MacroTune(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @DebugLogging(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"MacroTune\0A\00"
define void @MacroTune(i32 %0, i32 %1) {
%3 = tail call i32 @DebugLogging(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_l1();
int /*<<< orphan*/ take_struct_l1(int /*<<< orphan*/);
void test_struct_l1() { take_struct_l1(return_struct_l1()); }


x86 assembly (clang, -O0):
<test_struct_l1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_l1@plt>
mov    %eax,%edi
call   1030 <take_struct_l1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_l1>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_l1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_l1@plt>

LLVM IR (-O0):
define void @test_struct_l1() {
%1 = call i32 (...) @return_struct_l1()
%2 = call i32 @take_struct_l1(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_l1() {
%1 = tail call i32 (...) @return_struct_l1()
%2 = tail call i32 @take_struct_l1(i32 %1)
ret void
}
void av_rescale_q_rnd() {}


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

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

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

LLVM IR (-O2):
define void @av_rescale_q_rnd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ all_the_river_stuff();
void gc__all_the_river_stuff() { all_the_river_stuff(); }


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

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

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

LLVM IR (-O2):
define void @gc__all_the_river_stuff() {
%1 = tail call i32 (...) @all_the_river_stuff()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glXGetFBConfigsSGIX(int /*<<< orphan*/ *);
void glXGetFBConfigsSGIX() {
  { mock_push(pack_glXGetFBConfigsSGIX(NULL)); };
}


x86 assembly (clang, -O0):
<glXGetFBConfigsSGIX>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pack_glXGetFBConfigsSGIX@plt>
mov    %eax,%edi
call   1030 <mock_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glXGetFBConfigsSGIX>:
push   %rax
xor    %edi,%edi
call   1040 <pack_glXGetFBConfigsSGIX@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <mock_push@plt>

LLVM IR (-O0):
define void @glXGetFBConfigsSGIX() {
%1 = call i32 @pack_glXGetFBConfigsSGIX(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @glXGetFBConfigsSGIX() {
%1 = tail call i32 @pack_glXGetFBConfigsSGIX(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
void toggle_int_flag(int *flag) {
  *flag = !*flag;
  return;
}


x86 assembly (clang, -O0):
<toggle_int_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<toggle_int_flag>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @toggle_int_flag(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
store i32 %4, i32* %0
ret void
}
unsigned short BigShort(unsigned short x) {
  return (unsigned short)((x >> 8) | (x << 8));
}


x86 assembly (clang, -O0):
<BigShort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigShort>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @BigShort(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @BigShort(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}