xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ lib_default_search_paths();
int /*<<< orphan*/ push_path(int /*<<< orphan*/);
int /*<<< orphan*/ strdup(char const *);
void lib_add_search_path(const char *path) {
  lib_default_search_paths();
  push_path(strdup(path));
}


x86 assembly (clang, -O0):
<lib_add_search_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <lib_default_search_paths@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
call   1040 <push_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_add_search_path>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <lib_default_search_paths@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <push_path@plt>

LLVM IR (-O0):
define void @lib_add_search_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @lib_default_search_paths()
%4 = load i8*, i8** %2
%5 = call i32 @strdup(i8* %4)
%6 = call i32 @push_path(i32 %5)
ret void
}

LLVM IR (-O2):
define void @lib_add_search_path(i8* %0) {
%2 = tail call i32 (...) @lib_default_search_paths()
%3 = tail call i32 @strdup(i8* %0)
%4 = tail call i32 @push_path(i32 %3)
ret void
}
int _smpy32(int src1, int src2) {
  long long res = (long long)src1 * src2;
  res <<= 1;
  res >>= 32;
  return res;
}


x86 assembly (clang, -O0):
<_smpy32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_smpy32>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
shr    $0x1f,%rax
ret

LLVM IR (-O0):
define i32 @_smpy32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %7, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = shl i64 %11, 1
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = ashr i64 %13, 32
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @_smpy32(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
%6 = lshr i64 %5, 31
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int memcmp(unsigned char *, unsigned char *, int);
int cmp(unsigned char *a, unsigned char *b) { return memcmp(a, b, 16); }


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

x86 assembly (clang, -O2):
<cmp>:
mov    $0x10,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 16)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ graph_set_pixel(unsigned int, unsigned int, int);
void graph_draw_dash(unsigned int x, unsigned int y, unsigned int length) {
  unsigned int i;
  for (i = 0; i < length; i++)
    graph_set_pixel(x + i, y, 0xFF0000FF);
}


x86 assembly (clang, -O0):
<graph_draw_dash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1155 <graph_draw_dash+0x45>
mov    -0x4(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xff0000ff,%edx
call   1030 <graph_set_pixel@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <graph_draw_dash+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph_draw_dash>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
je     1137 <graph_draw_dash+0x27>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
nop
mov    %ebp,%edi
mov    %r14d,%esi
mov    $0xff0000ff,%edx
call   1030 <graph_set_pixel@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1120 <graph_draw_dash+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @graph_draw_dash(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %18, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %7
%15 = add i32 %13, %14
%16 = load i32, i32* %5
%17 = call i32 @graph_set_pixel(i32 %15, i32 %16, i32 -16776961)
br label %18
18: ; preds = %12
%19 = load i32, i32* %7
%20 = add i32 %19, 1
store i32 %20, i32* %7
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @graph_draw_dash(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = add i32 %6, %0
%8 = tail call i32 @graph_set_pixel(i32 %7, i32 %1, i32 -16776961)
%9 = add nuw i32 %6, 1
%10 = icmp eq i32 %9, %2
br i1 %10, label %11, label %5
11: ; preds = %5, %3
ret void
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_callback {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
void wl_callback_destroy(struct wl_callback *wl_callback) {
  wl_proxy_destroy((struct wl_proxy *)wl_callback);
}


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

x86 assembly (clang, -O2):
<wl_callback_destroy>:
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_callback = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_callback_destroy(%struct.wl_callback* %0) {
%2 = alloca %struct.wl_callback*
store %struct.wl_callback* %0, %struct.wl_callback** %2
%3 = load %struct.wl_callback*, %struct.wl_callback** %2
%4 = bitcast %struct.wl_callback* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %4)
ret void
}

LLVM IR (-O2):
%struct.wl_callback = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_callback_destroy(%struct.wl_callback* %0) {
%2 = bitcast %struct.wl_callback* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
/* Type definitions */
struct json_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ json_object_new_string(char *);
int /*<<< orphan*/ json_object_object_add(struct json_object *, char *,
                                          int /*<<< orphan*/);
void controller_set_device_info(struct json_object *request,
                                struct json_object *response) {
  json_object_object_add(response, "result",
                         json_object_new_string("controller_set_device_info"));
}


x86 assembly (clang, -O0):
<controller_set_device_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <json_object_new_string@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xeaf(%rip),%rsi
call   1040 <json_object_object_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<controller_set_device_info>:
push   %rbx
mov    %rsi,%rbx
lea    0xedc(%rip),%rdi
call   1030 <json_object_new_string@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
pop    %rbx
jmp    1040 <json_object_object_add@plt>

LLVM IR (-O0):
%struct.json_object = type { i32 }
@.str = [7 x i8] c"result\00"
@.str.1 = [27 x i8] c"controller_set_device_info\00"
define void @controller_set_device_info(%struct.json_object* %0, %struct.json_object* %1) {
%3 = alloca %struct.json_object*
%4 = alloca %struct.json_object*
store %struct.json_object* %0, %struct.json_object** %3
store %struct.json_object* %1, %struct.json_object** %4
%5 = load %struct.json_object*, %struct.json_object** %4
%6 = call i32 @json_object_new_string(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @json_object_object_add(%struct.json_object* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
%struct.json_object = type { i32 }
@.str = [7 x i8] c"result\00"
@.str.1 = [27 x i8] c"controller_set_device_info\00"
define void @controller_set_device_info(%struct.json_object* nocapture readnone %0, %struct.json_object* %1) {
%3 = tail call i32 @json_object_new_string(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @json_object_object_add(%struct.json_object* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
char string__NativeString___91d_93d(char *self, long p0) {
  char var;
  char var1;
  var1 = self[p0];
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<string__NativeString___91d_93d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @string__NativeString___91d_93d(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %6
%11 = load i8, i8* %6
store i8 %11, i8* %5
br label %12
12: ; preds = %2
%13 = load i8, i8* %5
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @string__NativeString___91d_93d(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
ret i8 %4
}
int NearestPowerOfTwo(int val) {
  int answer;
  for (answer = 1; answer < val; answer <<= 1)
    ;
  return answer;
}


x86 assembly (clang, -O0):
<NearestPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <NearestPowerOfTwo+0x2d>
jmp    111f <NearestPowerOfTwo+0x1f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <NearestPowerOfTwo+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NearestPowerOfTwo>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jl     1110 <NearestPowerOfTwo+0x10>
ret

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

LLVM IR (-O2):
define i32 @NearestPowerOfTwo(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp slt i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
long get_dec(char const **);
long get_hex(char const **);
int /*<<< orphan*/ skip_space(char const **);
long get_num(const char **s) {
  if ((**s) != '$')
    return get_dec(s);
  (*s)++;
  skip_space(s);
  return get_hex(s);
}


x86 assembly (clang, -O0):
<get_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
je     1161 <get_num+0x31>
mov    -0x10(%rbp),%rdi
call   1040 <get_dec@plt>
mov    %rax,-0x8(%rbp)
jmp    1185 <get_num+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <skip_space@plt>
mov    -0x10(%rbp),%rdi
call   1050 <get_hex@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
cmpb   $0x24,(%rax)
jne    1154 <get_num+0x24>
add    $0x1,%rax
mov    %rax,(%rbx)
mov    %rbx,%rdi
call   1030 <skip_space@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <get_hex@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <get_dec@plt>

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

LLVM IR (-O2):
define i64 @get_num(i8** %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 36
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i64 @get_dec(i8** %0)
br label %11
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %8, i8** %0
%9 = tail call i32 @skip_space(i8** %0)
%10 = tail call i64 @get_hex(i8** %0)
br label %11
11: ; preds = %7, %5
%12 = phi i64 [ %6, %5 ], [ %10, %7 ]
ret i64 %12
}
double lerp(double a, double b, double r) { return (a * (1.0 - r) + b * r); }


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @lerp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %7, double %9, double %12)
ret double %13
}

LLVM IR (-O2):
define double @lerp(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %2
%5 = fmul double %1, %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x = 4;
  int y = -x;
  assert(y == -4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xfffffffc,-0xc(%rbp)
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    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -4
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cpu_sig();
int main() {
  cpu_sig();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cpu_sig()
ret i32 0
}
void __change_bit(int nr, volatile unsigned long *addr) {
  __asm__ __volatile__("btcl %1,%0"
                       : "=m"((*(volatile long *)addr))
                       : "Ir"(nr));
}


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

x86 assembly (clang, -O2):
<__change_bit>:
btc    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @__change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @__change_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btcl $1,$0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
isan(c) { return isal(c) || isdi(c); }


x86 assembly (clang, -O0):
<isan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <isal@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1158 <isan+0x38>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <isdi@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isan>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <isal@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1137 <isan+0x17>
pop    %rbx
ret
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <isdi@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isan(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @isal to i32 (i32, ...)*)(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i32, ...) bitcast (i32 (...)* @isdi to i32 (i32, ...)*)(i32 %7)
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isan(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @isal to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @isdi to i32 (i32, ...)*)(i32 %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main() {
  while (1)
    sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int find_nth_str(char *, char *, int);
int find_str(char *line, char *str) { return find_nth_str(line, str, 1); }


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

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

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

LLVM IR (-O2):
define i32 @find_str(i8* %0, i8* %1) {
%3 = tail call i32 @find_nth_str(i8* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *);
void Input(int *inX, int *inY) { scanf("%d %d", inX, inY); }


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

x86 assembly (clang, -O2):
<Input>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <scanf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define void @Input(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 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @Input(i32* %0, i32* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutSolidIcosahedron();
void drawSolidIcosahedron(void) { glutSolidIcosahedron(); }


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

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

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

LLVM IR (-O2):
define void @drawSolidIcosahedron() {
%1 = tail call i32 (...) @glutSolidIcosahedron()
ret void
}
int test_imm_25int16_mem(short *val) {
  return ((*val) & (0x25 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_25int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 37
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_12uint8_reg(unsigned char val) {
  return ((val) & (-0x12 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_12uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffee,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_12uint8_reg>:
test   $0xee,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_12uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -18
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct group {
  scalar_t__ gr_gid;
};

/* Variables and functions */
int /*<<< orphan*/ endgrent();
struct group *getgrnam(char *);
int Privsep_GetGroup(char *name) {
  int os_gid = -1;
  struct group *grp;
  grp = getgrnam(name);
  if (grp == NULL)
    return (-1);
  os_gid = (int)grp->gr_gid;
  endgrent();
  return (os_gid);
}


x86 assembly (clang, -O0):
<Privsep_GetGroup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getgrnam@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1157 <Privsep_GetGroup+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <Privsep_GetGroup+0x4e>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <endgrent@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Privsep_GetGroup>:
push   %rbx
call   1040 <getgrnam@plt>
test   %rax,%rax
je     1136 <Privsep_GetGroup+0x16>
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <endgrent@plt>
jmp    113b <Privsep_GetGroup+0x1b>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.group = type { i64 }
define i32 @Privsep_GetGroup(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.group*
store i8* %0, i8** %3
store i32 -1, i32* %4
%6 = load i8*, i8** %3
%7 = call %struct.group* @getgrnam(i8* %6)
store %struct.group* %7, %struct.group** %5
%8 = load %struct.group*, %struct.group** %5
%9 = icmp eq %struct.group* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %18
11: ; preds = %1
%12 = load %struct.group*, %struct.group** %5
%13 = getelementptr inbounds %struct.group, %struct.group* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
store i32 %15, i32* %4
%16 = call i32 (...) @endgrent()
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.group = type { i64 }
define i32 @Privsep_GetGroup(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = tail call i32 (...) @endgrent()
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
double asin(double);
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double Arcseno(double a) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &a);
  return (asin(a));
}


x86 assembly (clang, -O0):
<Arcseno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <asin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Arcseno>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <asin@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Arcseno(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @asin(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Arcseno(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @asin(double %6)
ret double %7
}
void simple_rmdir(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<simple_rmdir>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_rmdir>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.simple_rmdir = [13 x i8] c"simple_rmdir\00"
define void @simple_rmdir() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.simple_rmdir, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.simple_rmdir = [13 x i8] c"simple_rmdir\00"
define void @simple_rmdir() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.simple_rmdir, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sample_exp();
double sample_gauss();
double sample_sum2(void) { return (sample_exp() + sample_gauss()) / 2.0; }


x86 assembly (clang, -O0):
<sample_sum2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <sample_exp@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <sample_gauss@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_sum2>:
push   %rax
xor    %eax,%eax
call   1040 <sample_exp@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <sample_gauss@plt>
addsd  (%rsp),%xmm0
mulsd  0xebf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sample_sum2() {
%1 = call double (...) @sample_exp()
%2 = call double (...) @sample_gauss()
%3 = fadd double %1, %2
%4 = fdiv double %3, 2.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @sample_sum2() {
%1 = tail call double (...) @sample_exp()
%2 = tail call double (...) @sample_gauss()
%3 = fadd double %1, %2
%4 = fmul double %3, 5.000000e-01
ret double %4
}
void stress_set_timer_slack(void) {}


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

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

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

LLVM IR (-O2):
define void @stress_set_timer_slack() {
ret void
}
void IE_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @IE_Shutdown() {
ret void
}
int test_imm_C6uint32_reg(unsigned int val) {
  return ((val) & (0xC6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C6uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C6uint32_reg>:
test   $0xc6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C6uint32_reg(i32 %0) {
%2 = and i32 %0, 198
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
int main(void) {
  int num = 2147483647;
  unsigned int j = 4294967295;
  printf("num=%d %d %d \n", num, num + 1, num + 2);
  printf("j=%u %u %u \n", j, j + 1, j + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7fffffff,%esi
mov    $0x80000000,%edx
mov    $0x80000001,%ecx
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0xffffffff,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"num=%d %d %d \0A\00"
@.str.1 = [13 x i8] c"j=%u %u %u \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 -2147483648, i32 -2147483647)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 0, i32 1)
ret i32 0
}
void _ht_pointer_swap(void **first, void **second) {
  void *temp = *first;
  *first = *second;
  *second = temp;
}


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

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

LLVM IR (-O0):
define void @_ht_pointer_swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @_ht_pointer_swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + (unsigned short)48993;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0x30dd5ac,%rax
add    $0x20ea,%rax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1147 <RandomFunc+0x47>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1129 <RandomFunc+0x29>
movzwl -0x12(%rbp),%eax
add    $0xbf61,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0xffffb5f7,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i64
%11 = add i64 %10, 51238316
%12 = add i64 %11, 8426
%13 = trunc i64 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %6
br label %15
15: ; preds = %19, %2
%16 = load i16, i16* %6
%17 = zext i16 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i16, i16* %6
%21 = zext i16 %20 to i64
%22 = add i64 %21, 2
%23 = trunc i64 %22 to i16
store i16 %23, i16* %6
br label %15
24: ; preds = %15
%25 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%26 = load i16, i16* %25
%27 = zext i16 %26 to i32
%28 = add nsw i32 %27, 48993
%29 = trunc i32 %28 to i16
%30 = load i16*, i16** %4
%31 = getelementptr inbounds i16, i16* %30, i64 0
store i16 %29, i16* %31
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, -18953
store i16 %4, i16* %1
ret void
}
XDeleteProperty() {}


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

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

LLVM IR (-O0):
define i32 @XDeleteProperty() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XDeleteProperty() {
ret i32 undef
}
/* Variables and functions */
int PAPI_write(int, long long *);
void PAPIF_WRITE(int *EventSet, long long *values, int *check) {
  *check = PAPI_write(*EventSet, values);
}


x86 assembly (clang, -O0):
<PAPIF_WRITE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <PAPI_write@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_WRITE>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_write@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_WRITE(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_write(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
void __attribute__((hot)) f1(int x) {
  register float f asm("%xmm0") = x;
  asm volatile("" ::"x"(f));
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cvtsi2ss %edi,%xmm0
ret
cs nopw 0x0(%rax,%rax,1)
nop

LLVM IR (-O0):
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
ret void
}

LLVM IR (-O2):
define void @f1(i32 %0) {
%2 = sitofp i32 %0 to float
tail call void asm sideeffect "", "{xmm0},~{dirflag},~{fpsr},~{flags}"(float %2)
ret void
}
/* Type definitions */
struct dev_printer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dev_printer *);
void dev_printer_destroy(void *dev) {
  struct dev_printer *printer = dev;
  free(printer);
}


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

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

LLVM IR (-O0):
%struct.dev_printer = type { i32 }
define void @dev_printer_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.dev_printer*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.dev_printer*
store %struct.dev_printer* %5, %struct.dev_printer** %3
%6 = load %struct.dev_printer*, %struct.dev_printer** %3
%7 = call i32 @free(%struct.dev_printer* %6)
ret void
}

LLVM IR (-O2):
%struct.dev_printer = type { i32 }
define void @dev_printer_destroy(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.dev_printer*
%3 = tail call i32 @free(%struct.dev_printer* %2)
ret void
}
int addInt(int n, int m) { return (n + m); }


x86 assembly (clang, -O0):
<addInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @addInt(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addInt(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *KmlStringCopy(const char *str) {
  char *res;
  res = (char *)malloc((strlen(str) + 1) * sizeof(char));
  strcpy(res, str);
  return res;
}


x86 assembly (clang, -O0):
<KmlStringCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KmlStringCopy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @KmlStringCopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @KmlStringCopy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_CMPLT(int s1, int s2, int dst) { C67_asm("CMPLT.L1", s1, s2, dst); }


x86 assembly (clang, -O0):
<C67_CMPLT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_CMPLT>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"CMPLT.L1\00"
define void @C67_CMPLT(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"CMPLT.L1\00"
define void @C67_CMPLT(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
void SetBit(int data, int bit) {
  if (bit > 31) {
    return;
  }
  data = data | (0x1 << bit);
  return;
}


x86 assembly (clang, -O0):
<SetBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jle    1119 <SetBit+0x19>
jmp    112d <SetBit+0x2d>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SetBit(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 = icmp sgt i32 %5, 31
br i1 %6, label %7, label %8
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = or i32 %9, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @SetBit(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
char *keygen(char *);
int /*<<< orphan*/ printf(char *, char *);
void main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Usage: %s <challenge>\n", argv[0]);
    return;
  }
  printf("B%lu\n", keygen(argv[1]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1151 <main+0x31>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
jmp    116d <main+0x4d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <keygen@plt>
mov    %rax,%rsi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1136 <main+0x16>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>
mov    0x8(%rsi),%rdi
call   1030 <keygen@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s <challenge>\0A\00"
@.str.1 = [6 x i8] c"B%lu\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %18
12: ; preds = %2
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i8* @keygen(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s <challenge>\0A\00"
@.str.1 = [6 x i8] c"B%lu\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i8* @keygen(i8* %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %7, %4
ret void
}