xunge/DecIR huggingface dataset:
struct param_d *dev_add_param_string(struct device_d *dev, const char *name,
                                     int (*set)(struct param_d *p, void *priv),
                                     int (*get)(struct param_d *p, void *priv),
                                     char **value, void *priv) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<dev_add_param_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.param_d = type opaque
%struct.device_d = type opaque
define %struct.param_d* @dev_add_param_string(%struct.device_d* %0, i8* %1, i32 (%struct.param_d*, i8*)* %2, i32 (%struct.param_d*, i8*)* %3, i8** %4, i8* %5) {
%7 = alloca %struct.device_d*
%8 = alloca i8*
%9 = alloca i32 (%struct.param_d*, i8*)*
%10 = alloca i32 (%struct.param_d*, i8*)*
%11 = alloca i8**
%12 = alloca i8*
store %struct.device_d* %0, %struct.device_d** %7
store i8* %1, i8** %8
store i32 (%struct.param_d*, i8*)* %2, i32 (%struct.param_d*, i8*)** %9
store i32 (%struct.param_d*, i8*)* %3, i32 (%struct.param_d*, i8*)** %10
store i8** %4, i8*** %11
store i8* %5, i8** %12
ret %struct.param_d* null
}

LLVM IR (-O2):
%struct.param_d = type opaque
%struct.device_d = type opaque
define noalias %struct.param_d* @dev_add_param_string(%struct.device_d* nocapture readnone %0, i8* nocapture readnone %1, i32 (%struct.param_d*, i8*)* nocapture readnone %2, i32 (%struct.param_d*, i8*)* nocapture readnone %3, i8** nocapture readnone %4, i8* nocapture readnone %5) {
ret %struct.param_d* null
}
/* Type definitions */
struct pair {
  int dummy;
};

/* Variables and functions */
int is_pair(struct pair const *const);
int is_application(const struct pair *const exp) { return is_pair(exp); }


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

x86 assembly (clang, -O2):
<is_application>:
jmp    1030 <is_pair@plt>

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

LLVM IR (-O2):
%struct.pair = type { i32 }
define i32 @is_application(%struct.pair* %0) {
%2 = tail call i32 @is_pair(%struct.pair* %0)
ret i32 %2
}
unsigned int simple_hash(const char *str) {
  unsigned int hash = 0;
  int c;
  while ((c = *str++) != 0)
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<simple_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     114b <simple_hash+0x4b>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <simple_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <simple_hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <simple_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @simple_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 65599
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ newtermio();
void echoOff() { newtermio(); }


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

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

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

LLVM IR (-O2):
define void @echoOff() {
%1 = tail call i32 (...) @newtermio()
ret void
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ev_break(struct ev_loop *, int);
void __attribute__((unused)) ev_unloop(struct ev_loop *loop, int how) {
  ev_break(loop, how);
}


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

x86 assembly (clang, -O2):
<ev_unloop>:
jmp    1030 <ev_break@plt>

LLVM IR (-O0):
%struct.ev_loop = type { i32 }
define void @ev_unloop(%struct.ev_loop* %0, i32 %1) {
%3 = alloca %struct.ev_loop*
%4 = alloca i32
store %struct.ev_loop* %0, %struct.ev_loop** %3
store i32 %1, i32* %4
%5 = load %struct.ev_loop*, %struct.ev_loop** %3
%6 = load i32, i32* %4
%7 = call i32 @ev_break(%struct.ev_loop* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define void @ev_unloop(%struct.ev_loop* %0, i32 %1) {
%3 = tail call i32 @ev_break(%struct.ev_loop* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(pthread_mutex_t *__mutex) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_lock(i32* nocapture readnone %0) {
ret i32 0
}
int Count(int array[]) {
  int res = 0;
  for (int i = 0; i < 5; i++) {
    if (array[i] != 0) {
      res++;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<Count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    114e <Count+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113b <Count+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <Count+0x40>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <Count+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Count>:
movdqu (%rdi),%xmm0
pxor   %xmm1,%xmm1
pcmpeqd %xmm0,%xmm1
movmskps %xmm1,%eax
xor    $0xf,%eax
mov    %eax,%ecx
shr    %cl
and    $0x5,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
movzbl %cl,%eax
cmpl   $0x1,0x10(%rdi)
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @Count(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = icmp ne <4 x i32> %3, zeroinitializer
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = bitcast <4 x i1> %4 to i4
%10 = call i4 @llvm.ctpop.i4(i4 %9)
%11 = zext i4 %10 to i32
%12 = add nuw nsw i32 %11, %8
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x89() {
  Assert_real((isascii(137) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              690, ("isascii should be 0 for 0x89"));
}


x86 assembly (clang, -O0):
<t_isascii_0x89>:
push   %rbp
mov    %rsp,%rbp
mov    $0x89,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2b2,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x89>:
push   %rax
mov    $0x89,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x89\00"
define void @t_isascii_0x89() {
%1 = call i64 @isascii(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x89\00"
define void @t_isascii_0x89() {
%1 = tail call i64 @isascii(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo_cold(void) {
  asm("foo_cold_label: .globl foo_cold_label");
  baz();
  asm("foo_cold_label2: .globl foo_cold_label2");
}


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

x86 assembly (clang, -O2):
<foo_cold>:
push   %rax

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

LLVM IR (-O2):
define void @foo_cold() {
tail call void asm sideeffect "foo_cold_label: .globl foo_cold_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @baz()
tail call void asm sideeffect "foo_cold_label2: .globl foo_cold_label2", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void x4(void) {}


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

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

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

LLVM IR (-O2):
define void @x4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ voronoi(float, float, float, float *, float *, int,
                           int /*<<< orphan*/);
float voronoi_F4S(float x, float y, float z) {
  float da[4], pa[12];
  voronoi(x, y, z, da, pa, 1, 0);
  return (2.0f * da[3] - 1.0f);
}


x86 assembly (clang, -O0):
<voronoi_F4S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  -0x14(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xea5(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voronoi_F4S>:
sub    $0x48,%rsp
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  0xc(%rsp),%xmm0
addss  %xmm0,%xmm0
addss  0xec6(%rip),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define float @voronoi_F4S(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [4 x float]
%8 = alloca [12 x float]
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = load float, float* %6
%12 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%13 = getelementptr inbounds [12 x float], [12 x float]* %8, i64 0, i64 0
%14 = call i32 @voronoi(float %9, float %10, float %11, float* %12, float* %13, i32 1, i32 0)
%15 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 3
%16 = load float, float* %15
%17 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %16, float -1.000000e+00)
ret float %17
}

LLVM IR (-O2):
define float @voronoi_F4S(float %0, float %1, float %2) {
%4 = alloca [4 x float]
%5 = alloca [12 x float]
%6 = bitcast [4 x float]* %4 to i8*
%7 = bitcast [12 x float]* %5 to i8*
%8 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%9 = getelementptr inbounds [12 x float], [12 x float]* %5, i64 0, i64 0
%10 = call i32 @voronoi(float %0, float %1, float %2, float* %8, float* %9, i32 1, i32 0)
%11 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 3
%12 = load float, float* %11
%13 = call float @llvm.fmuladd.f32(float %12, float 2.000000e+00, float -1.000000e+00)
ret float %13
}
/* Variables and functions */
char *getenv(char *);
scalar_t__ system(char *);
int do_shell(char *args, int extra) {
  if (*args)
    return system(args) == 0;
  else
    return system(getenv("SHELL")) == 0;
}


x86 assembly (clang, -O0):
<do_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <do_shell+0x39>
mov    -0x10(%rbp),%rdi
call   1040 <system@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <do_shell+0x5c>
lea    0xea0(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1040 <system@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_shell>:
push   %rax
cmpb   $0x0,(%rdi)
jne    1135 <do_shell+0x15>
lea    0xed3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1040 <system@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"SHELL\00"
define i32 @do_shell(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i64 @system(i8* %10)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %3
br label %19
14: ; preds = %2
%15 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%16 = call i64 @system(i8* %15)
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
br label %19
19: ; preds = %14, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"SHELL\00"
define i32 @do_shell(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i64 @system(i8* %0)
br label %10
7: ; preds = %2
%8 = tail call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = tail call i64 @system(i8* %8)
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
void dsb_(void) {}


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

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

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

LLVM IR (-O2):
define void @dsb_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_internal(unsigned long, unsigned long);
void delay(unsigned long ms) {
  delay_internal(ms / 1000L, (ms % 1000L) * 1000L);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
imul   $0x3e8,%rdx,%rsi
call   1030 <delay_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    %rdi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
shr    $0x4,%rdx
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0x3e8,%rdi,%rsi
mov    %rdx,%rdi
jmp    1030 <delay_internal@plt>

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 1000
%5 = load i64, i64* %2
%6 = urem i64 %5, 1000
%7 = mul i64 %6, 1000
%8 = call i32 @delay_internal(i64 %4, i64 %7)
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = udiv i64 %0, 1000
%3 = urem i64 %0, 1000
%4 = mul nuw nsw i64 %3, 1000
%5 = tail call i32 @delay_internal(i64 %2, i64 %4)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t twofish_get_preferred_block_size(void) { return 16; }


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

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

LLVM IR (-O0):
define i32 @twofish_get_preferred_block_size() {
ret i32 16
}

LLVM IR (-O2):
define i32 @twofish_get_preferred_block_size() {
ret i32 16
}
int sqrt_func(k)
int k;
{
  int i, j;
  j = 1;
  for (i = 0; i < k; i++) {
    if (j * j != k)
      j = (j + k / j) / 2;
    else
      break;
  }
  return (j);
}


x86 assembly (clang, -O0):
<sqrt_func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116d <sqrt_func+0x6d>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1155 <sqrt_func+0x55>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    115a <sqrt_func+0x5a>
jmp    116d <sqrt_func+0x6d>
jmp    115f <sqrt_func+0x5f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <sqrt_func+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_func>:
mov    $0x1,%ecx
cmp    $0x2,%edi
jl     1140 <sqrt_func+0x40>
mov    $0x1,%esi
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cmp    %edi,%esi
jge    1140 <sqrt_func+0x40>
mov    %ecx,%eax
imul   %ecx,%eax
add    $0x1,%esi
cmp    %edi,%eax
jne    1120 <sqrt_func+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sqrt_func(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 1, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = sdiv i32 %0, %4
%7 = add nsw i32 %6, %4
%8 = sdiv i32 %7, 2
%9 = add nuw nsw i32 %5, 1
%10 = icmp sge i32 %9, %0
%11 = mul nsw i32 %8, %8
%12 = icmp eq i32 %11, %0
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 1, %1 ], [ %8, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void sigHandler(int sig) {
  if (sig == SIGINT)
    fprintf(stderr, "\nReceived signal SIGINT (%d): exiting.\n", sig);
  else
    fprintf(stderr, "\nReceived signal %d: exiting.\n", sig);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    115a <sigHandler+0x3a>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1172 <sigHandler+0x52>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigHandler>:
push   %rax
mov    %edi,%edx
mov    0x2ebe(%rip),%rax
cmp    %edi,(%rax)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rax
lea    0xee5(%rip),%rsi
cmove  %rax,%rsi
call   1030 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@stderr = global i32 0
@.str = [40 x i8] c"\0AReceived signal SIGINT (%d): exiting.\0A\00"
@.str.1 = [31 x i8] c"\0AReceived signal %d: exiting.\0A\00"
@EXIT_FAILURE = global i32 0
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i32, i32* %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %14
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i32, i32* %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i32 0
@stderr = global i32 0
@.str = [40 x i8] c"\0AReceived signal SIGINT (%d): exiting.\0A\00"
@.str.1 = [31 x i8] c"\0AReceived signal %d: exiting.\0A\00"
@EXIT_FAILURE = global i32 0
define void @sigHandler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @stderr
%5 = select i1 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32 %4, i8* %5, i32 %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void my_puts(const char *msg) { printf("I'm thinking: %s\n", msg); }


x86 assembly (clang, -O0):
<my_puts>:
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):
<my_puts>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"I'm thinking: %s\0A\00"
define void @my_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"I'm thinking: %s\0A\00"
define void @my_puts(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Menus_OpenByName(char *);
void CG_ShowTeamMenu() { Menus_OpenByName("teamMenu"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"teamMenu\00"
define void @CG_ShowTeamMenu() {
%1 = tail call i32 @Menus_OpenByName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ca7-virtex820-m400-2 USING_OS_MEMORY=0 "
         "API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= "
         "BUILD_DATE=Fri Jun 27 14:42:50 CEST 2014 BUILD=RELEASE CPU= "
         "USING_UMP=1 USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 "
         "USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/mali400-pmu/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [431 x i8] c"malidrv: CONFIG=ca7-virtex820-m400-2 USING_OS_MEMORY=0 API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Jun 27 14:42:50 CEST 2014 BUILD=RELEASE CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/mali400-pmu/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([431 x i8], [431 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [431 x i8] c"malidrv: CONFIG=ca7-virtex820-m400-2 USING_OS_MEMORY=0 API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Jun 27 14:42:50 CEST 2014 BUILD=RELEASE CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/mali400-pmu/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([431 x i8], [431 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS12;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ASN1_item_i2d_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS12_it;
int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12) {
  return ASN1_item_i2d_fp(&PKCS12_it, fp, p12);
}


x86 assembly (clang, -O0):
<i2d_PKCS12_fp>:
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    0x2eb1(%rip),%rdi
call   1030 <ASN1_item_i2d_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_PKCS12_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_i2d_fp@plt>

LLVM IR (-O0):
@PKCS12_it = global i32 0
define i32 @i2d_PKCS12_fp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @ASN1_item_i2d_fp(i32* @PKCS12_it, i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@PKCS12_it = global i32 0
define i32 @i2d_PKCS12_fp(i32* %0, i32* %1) {
%3 = tail call i32 @ASN1_item_i2d_fp(i32* @PKCS12_it, i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void File_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<File_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @File_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int _close_r(void *);
int devo_fclose(void *fp) { return _close_r(fp); }


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

x86 assembly (clang, -O2):
<devo_fclose>:
jmp    1030 <_close_r@plt>

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

LLVM IR (-O2):
define i32 @devo_fclose(i8* %0) {
%2 = tail call i32 @_close_r(i8* %0)
ret i32 %2
}
const char *idea_options(void) {
  if (sizeof(short) != sizeof(unsigned int))
    return ("idea(int)");
  else
    return ("idea(short)");
}


x86 assembly (clang, -O0):
<idea_options>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idea_options>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"idea(int)\00"
define i8* @idea_options() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"idea(int)\00"
define i8* @idea_options() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int c_nline() { return fputs("[E", stdout); }


x86 assembly (clang, -O0):
<c_nline>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_nline>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[E\00"
@stdout = global i32 0
define i32 @c_nline() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[E\00"
@stdout = global i32 0
define i32 @c_nline() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
void modUser() {}


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

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

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

LLVM IR (-O2):
define void @modUser() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dancing_partner();
int main(int argc, char *argv[]) {
  dancing_partner();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @dancing_partner()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @dancing_partner()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rotate_left(int, int);
int main(int argc, char *argv[]) {
  assert(rotate_left(0x12345678, 4) == 0x23456781);
  assert(rotate_left(0x12345678, 20) == 0x67812345);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x12345678,%edi
mov    $0x4,%esi
call   1040 <rotate_left@plt>
cmp    $0x23456781,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x12345678,%edi
mov    $0x14,%esi
call   1040 <rotate_left@plt>
cmp    $0x67812345,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
mov    $0x4,%esi
call   1040 <rotate_left@plt>
xor    %edi,%edi
cmp    $0x23456781,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x12345678,%edi
mov    $0x14,%esi
call   1040 <rotate_left@plt>
xor    %edi,%edi
cmp    $0x67812345,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @rotate_left(i32 305419896, i32 4)
%7 = icmp eq i32 %6, 591751041
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @rotate_left(i32 305419896, i32 20)
%11 = icmp eq i32 %10, 1736516421
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @rotate_left(i32 305419896, i32 4)
%4 = icmp eq i32 %3, 591751041
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @rotate_left(i32 305419896, i32 20)
%8 = icmp eq i32 %7, 1736516421
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret i32 0
}
/* Variables and functions */
char const *strong_l2();
const char *__attribute__((section(".test.b"))) call_strong_l2(void) {
  return strong_l2() + 1;
}


x86 assembly (clang, -O0):
<call_strong_l2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <strong_l2@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_strong_l2>:
push   %rax
xor    %eax,%eax
call   1030 <strong_l2@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_strong_l2() section ".test.b" {
%1 = call i8* (...) @strong_l2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_strong_l2() section ".test.b" {
%1 = tail call i8* (...) @strong_l2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Variables and functions */
int mergeSort(int *, int *, int /*<<< orphan*/, int);
int inversions_count(int array[], int n) {
  int aux[n];
  return mergeSort(array, aux, 0, n - 1);
}


x86 assembly (clang, -O0):
<inversions_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <mergeSort@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inversions_count>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%ecx
mov    %rsp,%rax
lea    0xf(,%rcx,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rax
mov    %rax,%rsp
lea    -0x1(%rsi),%ecx
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <mergeSort@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inversions_count(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i32, i64 %8
store i64 %8, i64* %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = call i32 @mergeSort(i32* %11, i32* %10, i32 0, i32 %13)
%15 = load i8*, i8** %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @inversions_count(i32* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i32, i64 %3
%5 = add nsw i32 %1, -1
%6 = call i32 @mergeSort(i32* %0, i32* %4, i32 0, i32 %5)
ret i32 %6
}
/* Type definitions */
struct statvfs {
  int dummy;
};

/* Variables and functions */
int syscall(int, char const *, int, struct statvfs *);
int statvfs(const char *path, struct statvfs *buf) {
  return syscall(268, path, sizeof *buf, buf);
}


x86 assembly (clang, -O0):
<statvfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x10c,%edi
mov    $0x4,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<statvfs>:
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    $0x10c,%edi
mov    $0x4,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.statvfs = type { i32 }
define i32 @statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca i8*
%4 = alloca %struct.statvfs*
store i8* %0, i8** %3
store %struct.statvfs* %1, %struct.statvfs** %4
%5 = load i8*, i8** %3
%6 = load %struct.statvfs*, %struct.statvfs** %4
%7 = call i32 @syscall(i32 268, i8* %5, i32 4, %struct.statvfs* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
define i32 @statvfs(i8* %0, %struct.statvfs* %1) {
%3 = tail call i32 @syscall(i32 268, i8* %0, i32 4, %struct.statvfs* %1)
ret i32 %3
}
double distd(const void *arg_a, const void *arg_b) {
  double *b = (double *)arg_b;
  double *a = (double *)arg_a;
  return (double)(*b - *a);
}


x86 assembly (clang, -O0):
<distd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distd>:
movsd  (%rsi),%xmm0
subsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @distd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to double*
store double* %8, double** %5
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to double*
store double* %10, double** %6
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = fsub double %12, %14
ret double %15
}

LLVM IR (-O2):
define double @distd(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to double*
%4 = bitcast i8* %0 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short, unsigned short,
                          unsigned short);
unsigned short test_func_fn(unsigned short a1, unsigned short a2) {
  unsigned short result;
  result = a1 + a2;
  printf("%d %d: %d\n", a1, a2, result);
  return result;
}


x86 assembly (clang, -O0):
<test_func_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
lea    0xebd(%rip),%rdi
movzwl %cx,%esi
movzwl %ax,%edx
movzwl -0x6(%rbp),%ecx
call   1030 <printf@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_fn>:
push   %rbx
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%eax
movzwl %ax,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d %d: %d\0A\00"
define zeroext i16 @test_func_fn(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %3
%13 = load i16, i16* %4
%14 = load i16, i16* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %12, i16 zeroext %13, i16 zeroext %14)
%16 = load i16, i16* %5
ret i16 %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d %d: %d\0A\00"
define zeroext i16 @test_func_fn(i16 zeroext %0, i16 zeroext %1) {
%3 = add i16 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i16 zeroext %3)
ret i16 %3
}
OP(dd, bf) {
  illegal_1();
  op_bf();
}


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

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

LLVM IR (-O0):
define i32 @OP(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 (...) @illegal_1()
%7 = call i32 (...) @op_bf()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_bf()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *program) {
  printf("%s get|set {gpio num} {value} [repeat times]\n", program);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"%s get|set {gpio num} {value} [repeat times]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"%s get|set {gpio num} {value} [repeat times]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void qsort(void *base, unsigned short num, unsigned short size,
           int (*comparator)(const void *a, const void *b)) {}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @qsort(i8* %0, i16 zeroext %1, i16 zeroext %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
ret void
}

LLVM IR (-O2):
define void @qsort(i8* nocapture %0, i16 zeroext %1, i16 zeroext %2, i32 (i8*, i8*)* nocapture %3) {
ret void
}
/* Variables and functions */
int hwtstamp_config_set(char const *, int /*<<< orphan*/, int);
int hwtstamp_config_set_hwtstamp(const char *ifname) {
  return hwtstamp_config_set(ifname, 0, 1);
}


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

x86 assembly (clang, -O2):
<hwtstamp_config_set_hwtstamp>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <hwtstamp_config_set@plt>

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

LLVM IR (-O2):
define i32 @hwtstamp_config_set_hwtstamp(i8* %0) {
%2 = tail call i32 @hwtstamp_config_set(i8* %0, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ proc_search_keyword(char *, char *);
scalar_t__ strncmp(int /*<<< orphan*/, char *, int);
char proc_cpu_fpu() {
  if (strncmp(proc_search_keyword("/proc/cpuinfo", "fpu"), "Nothing",
              sizeof("Nothing")) != 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<proc_cpu_fpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <proc_search_keyword@plt>
mov    %eax,%edi
lea    0xece(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1161 <proc_cpu_fpu+0x41>
movb   $0x1,-0x1(%rbp)
jmp    1165 <proc_cpu_fpu+0x45>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_cpu_fpu>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1040 <proc_search_keyword@plt>
lea    0xed7(%rip),%rsi
mov    %eax,%edi
mov    $0x8,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [4 x i8] c"fpu\00"
@.str.2 = [8 x i8] c"Nothing\00"
define signext i8 @proc_cpu_fpu() {
%1 = alloca i8
%2 = call i32 @proc_search_keyword(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i64 @strncmp(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8 1, i8* %1
br label %7
6: ; preds = %0
store i8 0, i8* %1
br label %7
7: ; preds = %6, %5
%8 = load i8, i8* %1
ret i8 %8
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [4 x i8] c"fpu\00"
@.str.2 = [8 x i8] c"Nothing\00"
define signext i8 @proc_cpu_fpu() {
%1 = tail call i32 @proc_search_keyword(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @strncmp(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 8)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i8
ret i8 %4
}