xunge/DecIR huggingface dataset:
long arith(long x, long y, long z) {
  long t1 = x + y;
  long t2 = z + t1;
  long t3 = x + 4;
  long t4 = y * 48;
  long t5 = t3 + t4;
  long rval = t2 * t5;
  return rval;
}


x86 assembly (clang, -O0):
<arith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
imul   $0x30,-0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
imul   -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith>:
lea    (%rsi,%rdi,1),%rcx
add    %rdx,%rcx
lea    (%rsi,%rsi,2),%rax
shl    $0x4,%rax
add    %rdi,%rax
add    $0x4,%rax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @arith(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = add nsw i64 %13, %14
store i64 %15, i64* %7
%16 = load i64, i64* %6
%17 = load i64, i64* %7
%18 = add nsw i64 %16, %17
store i64 %18, i64* %8
%19 = load i64, i64* %4
%20 = add nsw i64 %19, 4
store i64 %20, i64* %9
%21 = load i64, i64* %5
%22 = mul nsw i64 %21, 48
store i64 %22, i64* %10
%23 = load i64, i64* %9
%24 = load i64, i64* %10
%25 = add nsw i64 %23, %24
store i64 %25, i64* %11
%26 = load i64, i64* %8
%27 = load i64, i64* %11
%28 = mul nsw i64 %26, %27
store i64 %28, i64* %12
%29 = load i64, i64* %12
ret i64 %29
}

LLVM IR (-O2):
define i64 @arith(i64 %0, i64 %1, i64 %2) {
%4 = add nsw i64 %1, %0
%5 = add nsw i64 %4, %2
%6 = add nsw i64 %0, 4
%7 = mul nsw i64 %1, 48
%8 = add nsw i64 %6, %7
%9 = mul nsw i64 %5, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ initialize_node_mcu_io();
void initialize_hal() { initialize_node_mcu_io(); }


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

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

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

LLVM IR (-O2):
define void @initialize_hal() {
%1 = tail call i32 (...) @initialize_node_mcu_io()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ md_control_keyboard(int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
void start_window(void) {
  cbreak();
  noecho();
  nonl();
  md_control_keyboard(0);
}


x86 assembly (clang, -O0):
<start_window>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1050 <noecho@plt>
mov    $0x0,%al
call   1040 <nonl@plt>
xor    %edi,%edi
call   1060 <md_control_keyboard@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_window>:
push   %rax
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1050 <noecho@plt>
xor    %eax,%eax
call   1040 <nonl@plt>
xor    %edi,%edi
pop    %rax
jmp    1060 <md_control_keyboard@plt>

LLVM IR (-O0):
define void @start_window() {
%1 = call i32 (...) @cbreak()
%2 = call i32 (...) @noecho()
%3 = call i32 (...) @nonl()
%4 = call i32 @md_control_keyboard(i32 0)
ret void
}

LLVM IR (-O2):
define void @start_window() {
%1 = tail call i32 (...) @cbreak()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @nonl()
%4 = tail call i32 @md_control_keyboard(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ client_cmd(int, char *, unsigned char *);
void client_upload(char *fn, unsigned char *fh) { client_cmd(2, fn, fh); }


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

x86 assembly (clang, -O2):
<client_upload>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <client_cmd@plt>

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

LLVM IR (-O2):
define void @client_upload(i8* %0, i8* %1) {
%3 = tail call i32 @client_cmd(i32 2, i8* %0, i8* %1)
ret void
}
void compose_name_plus_nr(char basename[256], char str[256], int nr,
                          char filename[256]) {
  sprintf(filename, "%s%s%d", basename, str, nr);
}


x86 assembly (clang, -O0):
<compose_name_plus_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compose_name_plus_nr>:
mov    %edx,%r8d
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee0(%rip),%rsi
mov    %rcx,%rdi
mov    %rax,%rcx
xor    %eax,%eax
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s%s%d\00"
define void @compose_name_plus_nr(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%d\00"
define void @compose_name_plus_nr(i8* %0, i8* %1, i32 %2, i8* nocapture writeonly %3) {
%5 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
int do_797() { return 797; }


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

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

LLVM IR (-O0):
define i32 @do_797() {
ret i32 797
}

LLVM IR (-O2):
define i32 @do_797() {
ret i32 797
}
int HeaderMax(int charlie) {
  if (charlie < 128) {
    return 127;
  } else {
    return 255;
  }
}


x86 assembly (clang, -O0):
<HeaderMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1120 <HeaderMax+0x20>
movl   $0x7f,-0x4(%rbp)
jmp    1127 <HeaderMax+0x27>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HeaderMax>:
xor    %eax,%eax
cmp    $0x7f,%edi
setg   %al
shl    $0x7,%eax
or     $0x7f,%eax
ret

LLVM IR (-O0):
define i32 @HeaderMax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 127, i32* %2
br label %8
7: ; preds = %1
store i32 255, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @HeaderMax(i32 %0) {
%2 = icmp sgt i32 %0, 127
%3 = select i1 %2, i32 255, i32 127
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void release_ptcb(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<release_ptcb>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @release_ptcb(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int TKMM_SizeToFxiD(int sz) {
  int fr, ex;
  int i;
  fr = sz;
  ex = 0;
  while (fr >= 16) {
    fr = fr >> 1;
    ex++;
  }
  i = (fr & 7) | (ex << 3);
  return (i);
}


x86 assembly (clang, -O0):
<TKMM_SizeToFxiD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0x8(%rbp)
jl     1135 <TKMM_SizeToFxiD+0x35>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <TKMM_SizeToFxiD+0x14>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TKMM_SizeToFxiD>:
xor    %ecx,%ecx
cmp    $0x10,%edi
jl     111e <TKMM_SizeToFxiD+0x1e>
xor    %ecx,%ecx
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
shr    %eax
add    $0x8,%ecx
cmp    $0x1f,%edi
mov    %eax,%edi
ja     1110 <TKMM_SizeToFxiD+0x10>
jmp    1120 <TKMM_SizeToFxiD+0x20>
mov    %edi,%eax
and    $0x7,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @TKMM_SizeToFxiD(i32 %0) {
%2 = icmp sgt i32 %0, 15
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = lshr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ugt i32 %4, 31
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = shl i32 %7, 3
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
%13 = phi i32 [ %0, %1 ], [ %6, %9 ]
%14 = and i32 %13, 7
%15 = or i32 %14, %12
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
scalar_t__ decode_inet6_opt(void *, int /*<<< orphan*/);
void *encode_inet6_opt(int /*<<< orphan*/ *);
int main(void) {
  void *eb;
  socklen_t el;
  eb = encode_inet6_opt(&el);
  if (eb == NULL)
    return 1;
  if (decode_inet6_opt(eb, el))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <encode_inet6_opt@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <main+0x33>
movl   $0x1,-0x4(%rbp)
jmp    117c <main+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <decode_inet6_opt@plt>
cmp    $0x0,%rax
je     1175 <main+0x55>
movl   $0x1,-0x4(%rbp)
jmp    117c <main+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <encode_inet6_opt@plt>
test   %rax,%rax
je     1149 <main+0x29>
mov    0x4(%rsp),%esi
mov    %rax,%rdi
call   1030 <decode_inet6_opt@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8* @encode_inet6_opt(i32* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i64 @decode_inet6_opt(i8* %3, i32 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %0
%11 = phi i32 [ 1, %0 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int y() {
  static int c;
  if (c) {
    abort();
  }
  c = 1;
  ;
  return 3;
}


x86 assembly (clang, -O0):
<y>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
je     1128 <y+0x18>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x1,0x2efa(%rip)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<y>:
push   %rax
cmpb   $0x1,0x2f14(%rip)
je     1128 <y+0x18>
movb   $0x1,0x2f0b(%rip)
mov    $0x3,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@y.c = internal global i32 0
define i32 @y() {
%1 = load i32, i32* @y.c
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @abort()
unreachable
5: ; preds = %0
store i32 1, i32* @y.c
ret i32 3
}

LLVM IR (-O2):
@y.c = internal unnamed_addr global i1 false
define i32 @y() {
%1 = load i1, i1* @y.c
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = tail call i32 (...) @abort()
unreachable
4: ; preds = %0
store i1 true, i1* @y.c
ret i32 3
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int netif_queue_stopped(struct net_device *);
int acx_queue_stopped(struct net_device *ndev) {
  return netif_queue_stopped(ndev);
}


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

x86 assembly (clang, -O2):
<acx_queue_stopped>:
jmp    1030 <netif_queue_stopped@plt>

LLVM IR (-O0):
%struct.net_device = type { i32 }
define i32 @acx_queue_stopped(%struct.net_device* %0) {
%2 = alloca %struct.net_device*
store %struct.net_device* %0, %struct.net_device** %2
%3 = load %struct.net_device*, %struct.net_device** %2
%4 = call i32 @netif_queue_stopped(%struct.net_device* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
define i32 @acx_queue_stopped(%struct.net_device* %0) {
%2 = tail call i32 @netif_queue_stopped(%struct.net_device* %0)
ret i32 %2
}
/* Variables and functions */
size_t Bucket(int number) { return (number + sizeof(int)) / sizeof(int); }


x86 assembly (clang, -O0):
<Bucket>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x4,%rax
shr    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bucket>:
movslq %edi,%rax
add    $0x4,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @Bucket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = add i64 %4, 4
%6 = udiv i64 %5, 4
ret i64 %6
}

LLVM IR (-O2):
define i64 @Bucket(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add nsw i64 %2, 4
%4 = lshr i64 %3, 2
ret i64 %4
}
void rtw_netif_start_queue(void *pnetdev) {}


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

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

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

LLVM IR (-O2):
define void @rtw_netif_start_queue(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int exval) {
  fprintf(stderr, "usage: lockbench [-b basename] [-f numfiles] [-l numlocks]\n"
                  "                 [-n numthreads] [-t timeout]\n");
  exit(exval);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [106 x i8] c"usage: lockbench [-b basename] [-f numfiles] [-l numlocks]\0A [-n numthreads] [-t timeout]\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [106 x i8] c"usage: lockbench [-b basename] [-f numfiles] [-l numlocks]\0A [-n numthreads] [-t timeout]\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
int f15(int a, int *b, int c) { return a + *b + c; }


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f15>:
lea    (%rdi,%rdx,1),%eax
add    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @f15(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* %8
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f15(i32 %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add i32 %2, %0
%6 = add i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printUsage(void) {
  fprintf(stderr,
          "Usage: xdriinfo [-display <dpy>] [command]\n"
          "Commands:\n"
          "  nscreens               print the number of screens on display\n"
          "  driver screen          print the DRI driver name of screen\n"
          "  options screen|driver  print configuration information about "
          "screen or driver\n"
          "If no command is given then the DRI drivers for all screens are "
          "listed.\n");
}


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

x86 assembly (clang, -O2):
<printUsage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [331 x i8] c"Usage: xdriinfo [-display <dpy>] [command]\0ACommands:\0A nscreens print the number of screens on display\0A driver screen print the DRI driver name of screen\0A options screen|driver print configuration information about screen or driver\0AIf no command is given then the DRI drivers for all screens are listed.\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [331 x i8] c"Usage: xdriinfo [-display <dpy>] [command]\0ACommands:\0A nscreens print the number of screens on display\0A driver screen print the DRI driver name of screen\0A options screen|driver print configuration information about screen or driver\0AIf no command is given then the DRI drivers for all screens are listed.\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cgiParagraph(char *text) { printf("<P> %s\n", text); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"<P> %s\0A\00"
define void @cgiParagraph(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"<P> %s\0A\00"
define void @cgiParagraph(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void usage(char *prg) {
  puts("Uso:");
  printf("  %s [-bv] [filename.qgtest]\n", prg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Uso:\00"
@.str.1 = [30 x i8] c" %s [-bv] [filename.qgtest]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"Uso:\00"
@.str.1 = [30 x i8] c" %s [-bv] [filename.qgtest]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ launch_game_cmd(char *);
void launch_native_game(char *appid) {
  char *cmd;
  asprintf(&cmd, "steam -applaunch %s", appid);
  launch_game_cmd(cmd);
  free(cmd);
}


x86 assembly (clang, -O0):
<launch_native_game>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <launch_game_cmd@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<launch_native_game>:
push   %rax
mov    %rdi,%rdx
lea    0xec5(%rip),%rsi
mov    %rsp,%rdi
call   1050 <asprintf@plt>
mov    (%rsp),%rdi
call   1040 <launch_game_cmd@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"steam -applaunch %s\00"
define void @launch_native_game(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 @launch_game_cmd(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"steam -applaunch %s\00"
define void @launch_native_game(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i8*, i8** %2
%6 = call i32 @launch_game_cmd(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret void
}
/* Variables and functions */
int fun(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[] = {1, 2, 3, 4, 5, 6};
  printf("%d", fun(a, 0, 6));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <fun@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <fun@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @fun(i32* %3, i32 0, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @fun(i32* %3, i32 0, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int main(void) {
  int c = 0;
  union a;
  typedef union a b;
  union a {
    int a;
  };
  b a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.a = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %union.a
store i32 0, i32* %1
store i32 0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct operation {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ cmp_request(struct operation *, struct operation *);
scalar_t__ gwkv_demarshal_client(char *, struct operation **, int *);
int test_demarshal_get(char *get_str, struct operation *get_request) {
  struct operation *get_op;
  int get_status;
  assert(gwkv_demarshal_client(get_str, &get_op, &get_status) == 0);
  assert(cmp_request(get_op, get_request) == 0);
  return 0;
}


x86 assembly (clang, -O0):
<test_demarshal_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <gwkv_demarshal_client@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <cmp_request@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_demarshal_get>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
lea    0xc(%rsp),%rdx
call   1040 <gwkv_demarshal_client@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
call   1050 <cmp_request@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.operation = type { i32 }
define i32 @test_demarshal_get(i8* %0, %struct.operation* %1) {
%3 = alloca i8*
%4 = alloca %struct.operation*
%5 = alloca %struct.operation*
%6 = alloca i32
store i8* %0, i8** %3
store %struct.operation* %1, %struct.operation** %4
%7 = load i8*, i8** %3
%8 = call i64 @gwkv_demarshal_client(i8* %7, %struct.operation** %5, i32* %6)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.operation*, %struct.operation** %5
%13 = load %struct.operation*, %struct.operation** %4
%14 = call i64 @cmp_request(%struct.operation* %12, %struct.operation* %13)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
%struct.operation = type { i32 }
define i32 @test_demarshal_get(i8* %0, %struct.operation* %1) {
%3 = alloca %struct.operation*
%4 = alloca i32
%5 = bitcast %struct.operation** %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i64 @gwkv_demarshal_client(i8* %0, %struct.operation** %3, i32* %4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load %struct.operation*, %struct.operation** %3
%12 = call i64 @cmp_request(%struct.operation* %11, %struct.operation* %1)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_label();
int main() {
  test_label();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_label()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int semctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int removesem(int semid) { return semctl(semid, 0, IPC_RMID); }


x86 assembly (clang, -O0):
<removesem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <semctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removesem>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @removesem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @semctl(i32 %3, i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @removesem(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char num2char_hex(uint8_t v) {
  if (v > 9)
    return 'a' + v - 10;
  else
    return '0' + v;
}


x86 assembly (clang, -O0):
<num2char_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jle    1122 <num2char_hex+0x22>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    112b <num2char_hex+0x2b>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num2char_hex>:
cmp    $0xa,%edi
mov    $0x57,%ecx
mov    $0x30,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @num2char_hex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 9
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 97, %7
%9 = sub nsw i32 %8, 10
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = add nsw i32 48, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %11, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @num2char_hex(i32 %0) {
%2 = icmp sgt i32 %0, 9
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 87, i8 48
%5 = add i8 %4, %3
ret i8 %5
}
void gdk_draw_arc() {}


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

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

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

LLVM IR (-O2):
define void @gdk_draw_arc() {
ret void
}
void glBlendFunc(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBlendFunc() {
ret void
}
__attribute__((no, noclone)) short foo1(short arg) {
  short ret = 1;
  if (arg + 1 < ((!0) ? -(1L << (sizeof(char) * 8 - 1)) : 0) ||
      arg + 1 > ((!0) ? ((1L << (sizeof(char) * 8 - 1)) - 1)
                      : ((1L << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0xffffffffffffff80,%rax
jl     1137 <foo1+0x37>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x7f,%rax
jle    1144 <foo1+0x44>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1162 <foo1+0x62>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
lea    0x1(%rdi),%ecx
add    $0xffffff81,%edi
movzwl %di,%eax
cmp    $0xff00,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @foo1(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %8, -128
br i1 %9, label %16, label %10
10: ; preds = %1
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp sgt i64 %14, 127
br i1 %15, label %16, label %18
16: ; preds = %10, %1
%17 = load i16, i16* %4
store i16 %17, i16* %2
br label %27
18: ; preds = %10
%19 = load i16, i16* %3
%20 = sext i16 %19 to i32
%21 = add nsw i32 %20, 1
%22 = trunc i32 %21 to i16
store i16 %22, i16* %3
%23 = load i16, i16* %3
%24 = trunc i16 %23 to i8
%25 = sext i8 %24 to i16
store i16 %25, i16* %4
%26 = load i16, i16* %3
store i16 %26, i16* %2
br label %27
27: ; preds = %18, %16
%28 = load i16, i16* %2
ret i16 %28
}

LLVM IR (-O2):
define signext i16 @foo1(i16 signext %0) {
%2 = add i16 %0, 1
%3 = add i16 %0, -127
%4 = icmp ult i16 %3, -256
%5 = select i1 %4, i16 1, i16 %2
ret i16 %5
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_seq_pack(char *s) { return (char *)mock(s); }


x86 assembly (clang, -O0):
<cf_s_seq_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_seq_pack>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_seq_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_seq_pack(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int strlen(char *);
__attribute__((always_)) int strlen_utf8(char *s) { return strlen(s); }


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

x86 assembly (clang, -O2):
<strlen_utf8>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @strlen_utf8(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
int ipow(int b, int e) {
  int r = 1;
  while (e) {
    if (e & 1)
      r *= b;
    e >>= 1;
    b *= b;
  }
  return r;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <ipow+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <ipow+0x34>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <ipow+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %esi,%esi
je     113a <ipow+0x3a>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
sar    %edx
imul   %edi,%edi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <ipow+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ipow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul nsw i32 %10, %5
%12 = ashr i32 %6, 1
%13 = mul nsw i32 %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void secondTohms(int userSecond) {
  int hour = userSecond / 3600;
  int min = (userSecond - 3600 * hour) / 60;
  int second = (userSecond - 3600 * hour) % 60;
  printf("[h : %d, m: %d, s: %d]\n", hour, min, second);
}


x86 assembly (clang, -O0):
<secondTohms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xe10,-0x8(%rbp),%ecx
sub    %ecx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0xe10,-0x8(%rbp),%ecx
sub    %ecx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secondTohms>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0xb,%esi
add    %ecx,%esi
imul   $0xfffff1f0,%esi,%ecx
add    %eax,%ecx
movslq %ecx,%rcx
imul   $0xffffffff88888889,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x5,%edx
add    %eax,%edx
imul   $0x3c,%edx,%eax
sub    %eax,%ecx
lea    0xea8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"[h : %d, m: %d, s: %d]\0A\00"
define void @secondTohms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 3600
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 3600, %9
%11 = sub nsw i32 %8, %10
%12 = sdiv i32 %11, 60
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = mul nsw i32 3600, %14
%16 = sub nsw i32 %13, %15
%17 = srem i32 %16, 60
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"[h : %d, m: %d, s: %d]\0A\00"
define void @secondTohms(i32 %0) {
%2 = sdiv i32 %0, 3600
%3 = mul nsw i32 %2, -3600
%4 = add i32 %3, %0
%5 = sdiv i32 %4, 60
%6 = srem i32 %4, 60
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ block_init();
int /*<<< orphan*/ dentry_init();
int /*<<< orphan*/ inode_init();
int /*<<< orphan*/ superblock_init();
void fs_init(void) {
  block_init();
  superblock_init();
  inode_init();
  dentry_init();
}


x86 assembly (clang, -O0):
<fs_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <block_init@plt>
mov    $0x0,%al
call   1050 <superblock_init@plt>
mov    $0x0,%al
call   1030 <inode_init@plt>
mov    $0x0,%al
call   1040 <dentry_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_init>:
push   %rax
xor    %eax,%eax
call   1060 <block_init@plt>
xor    %eax,%eax
call   1050 <superblock_init@plt>
xor    %eax,%eax
call   1030 <inode_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <dentry_init@plt>

LLVM IR (-O0):
define void @fs_init() {
%1 = call i32 (...) @block_init()
%2 = call i32 (...) @superblock_init()
%3 = call i32 (...) @inode_init()
%4 = call i32 (...) @dentry_init()
ret void
}

LLVM IR (-O2):
define void @fs_init() {
%1 = tail call i32 (...) @block_init()
%2 = tail call i32 (...) @superblock_init()
%3 = tail call i32 (...) @inode_init()
%4 = tail call i32 (...) @dentry_init()
ret void
}
/* Variables and functions */
int virtio_read_many(unsigned long, void *, int);
int virtio_read(unsigned long sector, void *load_addr) {
  return virtio_read_many(sector, load_addr, 1);
}


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

x86 assembly (clang, -O2):
<virtio_read>:
mov    $0x1,%edx
jmp    1030 <virtio_read_many@plt>

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

LLVM IR (-O2):
define i32 @virtio_read(i64 %0, i8* %1) {
%3 = tail call i32 @virtio_read_many(i64 %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
char *longestPalindrome(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", longestPalindrome("dddddddddddd"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1040 <longestPalindrome@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"dddddddddddd\00"
define i32 @main() {
%1 = tail call i8* @longestPalindrome(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int _test_real_time(void *buffer) {
  unsigned char byte = ((unsigned char *)buffer)[0];
  if (byte >= 0xf8 && byte <= 0xff) {
    return (byte != 0xf9) && (byte != 0xfd);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_test_real_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0xf8,%eax
jl     1163 <_test_real_time+0x63>
movzbl -0x11(%rbp),%eax
cmp    $0xff,%eax
jg     1163 <_test_real_time+0x63>
movzbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0xf9,%ecx
mov    %al,-0x12(%rbp)
je     1153 <_test_real_time+0x53>
movzbl -0x11(%rbp),%eax
cmp    $0xfd,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <_test_real_time+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_real_time>:
mov    (%rdi),%al
cmp    $0xf8,%al
setae  %cl
and    $0xfb,%al
cmp    $0xf9,%al
setne  %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @_test_real_time(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
store i8 %7, i8* %4
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = icmp sge i32 %9, 248
br i1 %10, label %11, label %26
11: ; preds = %1
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = icmp sle i32 %13, 255
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = icmp ne i32 %17, 249
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = icmp ne i32 %21, 253
br label %23
23: ; preds = %19, %15
%24 = phi i1 [ false, %15 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
store i32 %25, i32* %2
br label %27
26: ; preds = %11, %1
store i32 0, i32* %2
br label %27
27: ; preds = %26, %23
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @_test_real_time(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ugt i8 %2, -9
%4 = and i8 %2, -5
%5 = icmp ne i8 %4, -7
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned int __perfctr_mk_cstatus(unsigned int tsc_on, unsigned int have_ictrs,
                                  unsigned int nrictrs, unsigned int nractrs) {
  return (tsc_on << 31) | (have_ictrs << 16) | ((nractrs + nrictrs) << 8) |
         nractrs;
}


x86 assembly (clang, -O0):
<__perfctr_mk_cstatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
add    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__perfctr_mk_cstatus>:
shl    $0x1f,%edi
shl    $0x10,%esi
or     %edi,%esi
lea    (%rdx,%rcx,1),%eax
shl    $0x8,%eax
or     %ecx,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @__perfctr_mk_cstatus(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 = shl i32 %9, 31
%11 = load i32, i32* %6
%12 = shl i32 %11, 16
%13 = or i32 %10, %12
%14 = load i32, i32* %8
%15 = load i32, i32* %7
%16 = add i32 %14, %15
%17 = shl i32 %16, 8
%18 = or i32 %13, %17
%19 = load i32, i32* %8
%20 = or i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @__perfctr_mk_cstatus(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 31
%6 = shl i32 %1, 16
%7 = or i32 %6, %5
%8 = add i32 %3, %2
%9 = shl i32 %8, 8
%10 = or i32 %7, %3
%11 = or i32 %10, %9
ret i32 %11
}