xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long value_mask;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xconfigurerequest_value_mask(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xconfigurerequest.value_mask = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xconfigurerequest_value_mask(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xconfigurerequest_value_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ fmax(int, int);
int max(int x, int y) { return (int)fmax(x, y); }


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

x86 assembly (clang, -O2):
<max>:
jmp    1030 <fmax@plt>

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @fmax(i32 %5, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = tail call i64 @fmax(i32 %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void leave(void) {
  int i;
  endwin();
  for (i = 0; i < 80; i++)
    fprintf(stderr, "-");
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <endwin@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jge    1163 <leave+0x43>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <leave+0x16>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leave>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <endwin@plt>
mov    $0x50,%ebp
mov    0x2ea9(%rip),%r14
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1140 <leave+0x20>
mov    (%r14),%edi
lea    0xea8(%rip),%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @leave() {
%1 = alloca i32
%2 = call i32 (...) @endwin()
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 80
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @leave() {
%1 = tail call i32 (...) @endwin()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 80
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void common(name) char *name;
{
  outccname(name);
  outop0str("\tCOMM\t");
}


x86 assembly (clang, -O0):
<common>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <outccname@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <outop0str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<common>:
push   %rax
xor    %eax,%eax
call   1040 <outccname@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <outop0str@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\09COMM\09\00"
define void @common(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @outccname to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @outop0str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\09COMM\09\00"
define void @common(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outccname to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outop0str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int xa;
  int ya;
  if (!(xa + ya > 0))
    return 0;
  while (xa > 0) {
    xa--;
    ya++;
  }
  assert(ya >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
jg     113a <main+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1178 <main+0x68>
jmp    113f <main+0x2f>
cmpl   $0x0,-0x8(%rbp)
jle    1160 <main+0x50>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <main+0x2f>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
struct _ipc_peer_impl *_conv_peer(struct ipc_peer *);
long ipc_unlink(struct ipc_peer *pr) {
  struct _ipc_peer_impl *ipi = _conv_peer(pr);
  return 0;
error_ret:
  return -1;
}


x86 assembly (clang, -O0):
<ipc_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_conv_peer@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ipc_peer = type { i32 }
%struct._ipc_peer_impl = type { i32 }
define i64 @ipc_unlink(%struct.ipc_peer* %0) {
%2 = alloca i64
%3 = alloca %struct.ipc_peer*
%4 = alloca %struct._ipc_peer_impl*
store %struct.ipc_peer* %0, %struct.ipc_peer** %3
%5 = load %struct.ipc_peer*, %struct.ipc_peer** %3
%6 = call %struct._ipc_peer_impl* @_conv_peer(%struct.ipc_peer* %5)
store %struct._ipc_peer_impl* %6, %struct._ipc_peer_impl** %4
store i64 0, i64* %2
br label %8
7: ; No predecessors!
store i64 -1, i64* %2
br label %8
8: ; preds = %7, %1
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
%struct.ipc_peer = type { i32 }
%struct._ipc_peer_impl = type { i32 }
define i64 @ipc_unlink(%struct.ipc_peer* %0) {
%2 = tail call %struct._ipc_peer_impl* @_conv_peer(%struct.ipc_peer* %0)
ret i64 0
}
void DoneVars(void) {}


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

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

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

LLVM IR (-O2):
define void @DoneVars() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_kernel;
typedef int /*<<< orphan*/ cl_command_queue;

/* Variables and functions */
int RunKernel(cl_command_queue cmd_q, cl_kernel kernel, int num_elem) {
  const size_t global_size[1] = {(num_elem + 255) / 256 * 256};
  const size_t local_size[1] = {256};
  return 0;
}


x86 assembly (clang, -O0):
<RunKernel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xff,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
shl    $0x8,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.RunKernel.local_size = [1 x i64] [i64 256]
define i32 @RunKernel(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [1 x i64]
%8 = alloca [1 x i64]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = getelementptr inbounds [1 x i64], [1 x i64]* %7, i64 0, i64 0
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 255
%12 = sdiv i32 %11, 256
%13 = mul nsw i32 %12, 256
%14 = sext i32 %13 to i64
store i64 %14, i64* %9
%15 = bitcast [1 x i64]* %8 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @RunKernel(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
void index_reader_doclose(struct _index_reader *_ir) { return; }


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

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

LLVM IR (-O0):
%struct._index_reader = type opaque
define void @index_reader_doclose(%struct._index_reader* %0) {
%2 = alloca %struct._index_reader*
store %struct._index_reader* %0, %struct._index_reader** %2
ret void
}

LLVM IR (-O2):
%struct._index_reader = type opaque
define void @index_reader_doclose(%struct._index_reader* nocapture %0) {
ret void
}
long noshuffle(long i) { return i; }


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

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

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

LLVM IR (-O2):
define i64 @noshuffle(i64 returned %0) {
ret i64 %0
}
testjump(label, ft) int label;
int ft;
{
  ol("cmpl\tr0,$0");
  if (ft)
    ot("jneq\t");
  else
    ot("jeql\t");
  printlabel(label);
  nl();
}


x86 assembly (clang, -O0):
<testjump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1050 <ol@plt>
cmpl   $0x0,-0xc(%rbp)
je     1179 <testjump+0x39>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
jmp    1187 <testjump+0x47>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1060 <printlabel@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testjump>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1050 <ol@plt>
test   %ebx,%ebx
lea    0xeb3(%rip),%rax
lea    0xea6(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <ot@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1060 <printlabel@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"cmpl\09r0,$0\00"
@.str.1 = [6 x i8] c"jneq\09\00"
@.str.2 = [6 x i8] c"jeql\09\00"
define i32 @testjump(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %4
%15 = call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %14)
%16 = call i32 (...) @nl()
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [11 x i8] c"cmpl\09r0,$0\00"
@.str.1 = [6 x i8] c"jneq\09\00"
@.str.2 = [6 x i8] c"jeql\09\00"
define i32 @testjump(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %5)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %0)
%8 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ forktest();
int main(void) {
  forktest();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <forktest@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <forktest@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @forktest()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test24(int a, int b, int c, int d) {
  int x = a == b;
  int y = c == 0;
  return x - y;
}


x86 assembly (clang, -O0):
<test24>:
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
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test24>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
cmp    $0x1,%edx
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @test24(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = sub nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test24(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = zext i1 %5 to i32
%7 = icmp eq i32 %2, 0
%8 = sext i1 %7 to i32
%9 = add nsw i32 %8, %6
ret i32 %9
}
__attribute__((no)) long trampoline_set_gotplt(unsigned long n1,
                                               unsigned long n2) {
  long ret;
  __asm__ __volatile__("leaq 1f(%%rip), %%r11\n\t"
                       "movq %%r11, %%fs:0x20\n\t"
                       "jmpq *%%gs:0x10000+"
                       "0xD8"
                       "\n\t"
                       "1:\n\t"
                       : "=a"(ret)
                       : "D"(n1), "S"(n2)
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<trampoline_set_gotplt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100d8
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_set_gotplt>:
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100d8
ret

LLVM IR (-O0):
define i64 @trampoline_set_gotplt(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xD8\0A\091:\0A\09", "={ax},{di},{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @trampoline_set_gotplt(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xD8\0A\091:\0A\09", "={ax},{di},{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ RTNLGRP_IPV4_IFADDR;
int /*<<< orphan*/ close(int);
int get_socket();
int /*<<< orphan*/ join_multicast(int, int /*<<< orphan*/);
int /*<<< orphan*/ mainloop(int);
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  int fd;
  openlog(argv[0], 0, LOG_USER);
  fd = get_socket();
  join_multicast(fd, RTNLGRP_IPV4_IFADDR);
  mainloop(fd);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <openlog@plt>
mov    $0x0,%al
call   1030 <get_socket@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2e4f(%rip),%rax
mov    (%rax),%esi
call   1040 <join_multicast@plt>
mov    -0x14(%rbp),%edi
call   1070 <mainloop@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    (%rsi),%rdi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <openlog@plt>
xor    %eax,%eax
call   1030 <get_socket@plt>
mov    %eax,%ebx
mov    0x2e6c(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <join_multicast@plt>
mov    %ebx,%edi
call   1070 <mainloop@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_USER = global i32 0
@RTNLGRP_IPV4_IFADDR = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i32, i32* @LOG_USER
%13 = call i32 @openlog(i8* %11, i32 0, i32 %12)
%14 = call i32 (...) @get_socket()
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* @RTNLGRP_IPV4_IFADDR
%17 = call i32 @join_multicast(i32 %15, i32 %16)
%18 = load i32, i32* %6
%19 = call i32 @mainloop(i32 %18)
%20 = load i32, i32* %6
%21 = call i32 @close(i32 %20)
ret i32 0
}

LLVM IR (-O2):
@LOG_USER = global i32 0
@RTNLGRP_IPV4_IFADDR = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i32, i32* @LOG_USER
%5 = tail call i32 @openlog(i8* %3, i32 0, i32 %4)
%6 = tail call i32 (...) @get_socket()
%7 = load i32, i32* @RTNLGRP_IPV4_IFADDR
%8 = tail call i32 @join_multicast(i32 %6, i32 %7)
%9 = tail call i32 @mainloop(i32 %6)
%10 = tail call i32 @close(i32 %6)
ret i32 0
}
void uma_dbg_addTopic_option() {}


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

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

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

LLVM IR (-O2):
define void @uma_dbg_addTopic_option() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int process_status_byte(int c) {
  printf("Status byte %02x not implemented yet\n", c);
  return 0;
}


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

x86 assembly (clang, -O2):
<process_status_byte>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Status byte %02x not implemented yet\0A\00"
define i32 @process_status_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Status byte %02x not implemented yet\0A\00"
define i32 @process_status_byte(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int system(char *);
int main(void) { return system("x64dtv.exe -sounddev dummy"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"x64dtv.exe -sounddev dummy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [27 x i8] c"x64dtv.exe -sounddev dummy\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
unsigned long popcount(unsigned long x) { return __builtin_popcountl(x); }


x86 assembly (clang, -O0):
<popcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount>:
mov    %rdi,%rax
shr    %rax
movabs $0x5555555555555555,%rcx
55 55 55
and    %rax,%rcx
sub    %rcx,%rdi
movabs $0x3333333333333333,%rax
33 33 33
mov    %rdi,%rcx
and    %rax,%rcx
shr    $0x2,%rdi
and    %rdi,%rax
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rax,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rcx,%rdx
movabs $0x101010101010101,%rax
01 01 01
imul   %rdx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i64 @popcount(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctpop.i64(i64 %3)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @popcount(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
ret i64 %2
}
/* Type definitions */
struct vt_mode {
  int dummy;
};
typedef int /*<<< orphan*/ m;

/* Variables and functions */
int main(void) {
  struct vt_mode m;
  (void)m;
  return sizeof(m);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned char, scalar_t__);
void write_byte_mode0(short ioaddr, unsigned char value) {
  outb(value & 0x0f, ioaddr + 0);
  outb((value >> 4) | 0x10, ioaddr + 0);
}


x86 assembly (clang, -O0):
<write_byte_mode0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
and    $0xf,%eax
movswl -0x2(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rsi
movzbl %al,%edi
call   1030 <outb@plt>
movzbl -0x3(%rbp),%eax
sar    $0x4,%eax
or     $0x10,%eax
movswl -0x2(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rsi
movzbl %al,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte_mode0>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
movslq %edi,%r14
mov    %esi,%edi
and    $0xf,%edi
mov    %r14,%rsi
call   1030 <outb@plt>
shr    $0x4,%bl
or     $0x10,%bl
movzbl %bl,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @write_byte_mode0(i16 signext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 15
%8 = trunc i32 %7 to i8
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = add nsw i32 %10, 0
%12 = sext i32 %11 to i64
%13 = call i32 @outb(i8 zeroext %8, i64 %12)
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = ashr i32 %15, 4
%17 = or i32 %16, 16
%18 = trunc i32 %17 to i8
%19 = load i16, i16* %3
%20 = sext i16 %19 to i32
%21 = add nsw i32 %20, 0
%22 = sext i32 %21 to i64
%23 = call i32 @outb(i8 zeroext %18, i64 %22)
ret void
}

LLVM IR (-O2):
define void @write_byte_mode0(i16 signext %0, i8 zeroext %1) {
%3 = and i8 %1, 15
%4 = sext i16 %0 to i64
%5 = tail call i32 @outb(i8 zeroext %3, i64 %4)
%6 = lshr i8 %1, 4
%7 = or i8 %6, 16
%8 = tail call i32 @outb(i8 zeroext %7, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
check(int x) {
  if (!x)
    abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112c <check+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
je     1115 <check+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @check(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put_le32_ptr(uint8_t *p, uint32_t v) {
  p[0] = (v & 0xFF);
  p[1] = (v >> 8) & 0xFF;
  p[2] = (v >> 16) & 0xFF;
  p[3] = (v >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<put_le32_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_le32_ptr>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @put_le32_ptr(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = lshr i32 %1, 24
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
char *strchr(char *, int);
int strlen(char *);
char *xstrchrnul(char *s, int c) {
  char *r = strchr(s, c);
  if (r)
    return r;
  else
    return (char *)s + strlen(s);
}


x86 assembly (clang, -O0):
<xstrchrnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1157 <xstrchrnul+0x37>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <xstrchrnul+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrchrnul>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strchr@plt>
test   %rax,%rax
je     1130 <xstrchrnul+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xstrchrnul(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %2, %5
%10 = phi i8* [ %8, %5 ], [ %3, %2 ]
ret i8* %10
}
/* Variables and functions */
double cblas_ddot(int const, double const *, int const, double const *,
                  int const);
double c_ddot(const int N, const double *X, const int strideX, const double *Y,
              const int strideY) {
  return cblas_ddot(N, X, strideX, Y, strideY);
}


x86 assembly (clang, -O0):
<c_ddot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <cblas_ddot@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_ddot>:
jmp    1030 <cblas_ddot@plt>

LLVM IR (-O0):
define double @c_ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load double*, double** %7
%13 = load i32, i32* %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call double @cblas_ddot(i32 %11, double* %12, i32 %13, double* %14, i32 %15)
ret double %16
}

LLVM IR (-O2):
define double @c_ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = tail call double @cblas_ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4)
ret double %6
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char const *);
void sasutil_path_cmd(int argc, char *argv[]) {
  const char *default_path = "defaults to .";
  const char *sas_path;
  sas_path = getenv("SASSTOREPATH");
  if (sas_path != NULL)
    default_path = sas_path;
  printf("SASSTOREPATH %s\n", default_path);
}


x86 assembly (clang, -O0):
<sasutil_path_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115d <sasutil_path_cmd+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sasutil_path_cmd>:
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xec9(%rip),%rsi
cmovne %rax,%rsi
lea    0xed9(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"defaults to .\00"
@.str.1 = [13 x i8] c"SASSTOREPATH\00"
@.str.2 = [17 x i8] c"SASSTOREPATH %s\0A\00"
define void @sasutil_path_cmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %5
%7 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %6
store i8* %11, i8** %5
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"defaults to .\00"
@.str.1 = [13 x i8] c"SASSTOREPATH\00"
@.str.2 = [17 x i8] c"SASSTOREPATH %s\0A\00"
define void @sasutil_path_cmd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}
int DEC2BCD(int x) { return (((x) / 10) << 4) + ((x) % 10); }


x86 assembly (clang, -O0):
<DEC2BCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
add    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DEC2BCD>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @DEC2BCD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = shl i32 %4, 4
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @DEC2BCD(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = srem i32 %0, 10
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef union fc_sockaddr {
  int dummy;
} fc_sockaddr;
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_prepend(struct genlist *, union fc_sockaddr *);
void fc_sockaddr_list_prepend(struct fc_sockaddr_list *tthis,
                              union fc_sockaddr *pfoo) {
  genlist_prepend((struct genlist *)tthis, pfoo);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_prepend>:
jmp    1030 <genlist_prepend@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_prepend(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1) {
%3 = alloca %struct.fc_sockaddr_list*
%4 = alloca %union.fc_sockaddr*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %3
store %union.fc_sockaddr* %1, %union.fc_sockaddr** %4
%5 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %3
%6 = bitcast %struct.fc_sockaddr_list* %5 to %struct.genlist*
%7 = load %union.fc_sockaddr*, %union.fc_sockaddr** %4
%8 = call i32 @genlist_prepend(%struct.genlist* %6, %union.fc_sockaddr* %7)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_prepend(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1) {
%3 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_prepend(%struct.genlist* %3, %union.fc_sockaddr* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
zsub() { callrts("ccsub"); }


x86 assembly (clang, -O0):
<zsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ccsub\00"
define i32 @zsub() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccsub\00"
define i32 @zsub() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void gdk_window_destroy_notify() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_destroy_notify() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void put_le16(uint8_t *ptr, uint16_t v) {
  ptr[0] = v;
  ptr[1] = v >> 8;
}


x86 assembly (clang, -O0):
<put_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_le16>:
mov    %esi,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @put_le16(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
ret void
}
adr0adrx1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{
  (*((float *)10000000)) =
      (((float *)(11111111 & ~(__alignof__(float) - 1)))[x1]);
}


x86 assembly (clang, -O0):
<adr0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac4,%eax
movss  (%rax,%rcx,4),%xmm0
mov    $0x989680,%eax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrx1_set>:
movslq %esi,%rax
movss  0xa98ac4(,%rax,4),%xmm0
movss  %xmm0,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 11111108 to float*), i64 %17
%19 = load float, float* %18
store float %19, float* inttoptr (i64 10000000 to float*)
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adr0adrx1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 11111108 to float*), i64 %7
%9 = load float, float* %8
store float %9, float* inttoptr (i64 10000000 to float*)
ret i32 undef
}
void PECIDomainMaxReadClear(unsigned long ulBase, unsigned long ulDomain) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000040 + (ulDomain * 4)))) &=
      ~0xFFFF0000;
}


x86 assembly (clang, -O0):
<PECIDomainMaxReadClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rcx
and    $0xffff,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIDomainMaxReadClear>:
andq   $0xffff,0x40(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @PECIDomainMaxReadClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 64
%7 = load i64, i64* %4
%8 = mul i64 %7, 4
%9 = add i64 %6, %8
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, 65535
store volatile i64 %12, i64* %10
ret void
}

LLVM IR (-O2):
define void @PECIDomainMaxReadClear(i64 %0, i64 %1) {
%3 = add i64 %0, 64
%4 = shl i64 %1, 2
%5 = add i64 %3, %4
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 65535
store volatile i64 %8, i64* %6
ret void
}
int f14(int x, int y) {
  if (y < 0)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1127 <f14+0x27>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    112e <f14+0x2e>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f14>:
mov    $0x22,%eax
test   %esi,%esi
js     110a <f14+0xa>
ret
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f14(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 34, %2 ]
ret i32 %8
}
void AiDacrateChanged(int SystemType) {}


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

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

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

LLVM IR (-O2):
define void @AiDacrateChanged(i32 %0) {
ret void
}
float nsvg__sqr(float x) { return x * x; }


x86 assembly (clang, -O0):
<nsvg__sqr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__sqr>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @nsvg__sqr(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @nsvg__sqr(float %0) {
%2 = fmul float %0, %0
ret float %2
}