xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int vsotaStevk(int, int);
int main() {
  int p, q, n;
  scanf("%d %d %d\n", &p, &q, &n);
  printf("%d\n", vsotaStevk(p * q, n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <vsotaStevk@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%edi
imul   0x14(%rsp),%edi
mov    0xc(%rsp),%esi
call   1050 <vsotaStevk@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = call i32 @vsotaStevk(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %8
%11 = load i32, i32* %3
%12 = call i32 @vsotaStevk(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int ZW_GetRoutingInformation(unsigned int id) {
  unsigned char buf[255];
  buf[0] = 0x00;
  buf[1] = 0x80;
  buf[2] = id;
  return SerialAPI_request(buf, 3);
}


x86 assembly (clang, -O0):
<ZW_GetRoutingInformation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x110(%rbp)
movb   $0x80,-0x10f(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x10e(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x3,%esi
call   1030 <SerialAPI_request@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZW_GetRoutingInformation>:
sub    $0x108,%rsp
movw   $0x8000,(%rsp)
mov    %dil,0x2(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <SerialAPI_request@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @ZW_GetRoutingInformation(i32 %0) {
%2 = alloca i32
%3 = alloca [255 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 1
store i8 -128, i8* %5
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 2
store i8 %7, i8* %8
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%10 = call i32 @SerialAPI_request(i8* %9, i32 3)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ZW_GetRoutingInformation(i32 %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 1
store i8 -128, i8* %4
%5 = trunc i32 %0 to i8
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 2
store i8 %5, i8* %6
%7 = call i32 @SerialAPI_request(i8* %3, i32 3)
ret i32 %7
}
/* Variables and functions */
void *realloc(void *, size_t);
void *_xrealloc(void *ptr, size_t len) {
  if (ptr == NULL && len == 0)
    return NULL;
  return realloc(ptr, len);
}


x86 assembly (clang, -O0):
<_xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <_xrealloc+0x33>
cmpq   $0x0,-0x18(%rbp)
jne    1143 <_xrealloc+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1154 <_xrealloc+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xrealloc>:
test   %rdi,%rdi
jne    111d <_xrealloc+0xd>
test   %rsi,%rsi
jne    111d <_xrealloc+0xd>
xor    %eax,%eax
ret
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @_xrealloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ aaa(char *);
void ok_to_suppress_double_free_from_this_fun(char *y) { aaa(y); }


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

x86 assembly (clang, -O2):
<ok_to_suppress_double_free_from_this_fun>:
jmp    1030 <aaa@plt>

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

LLVM IR (-O2):
define void @ok_to_suppress_double_free_from_this_fun(i8* %0) {
%2 = tail call i32 @aaa(i8* %0)
ret void
}
int HelpItem37(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem37() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem37() {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ rshell_loop();
int main(int argc, const char **argv) {
  rshell_loop();
  return EXIT_SUCCESS;
}


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 <rshell_loop@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @rshell_loop()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rshell_loop()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
int max(int *pa, int *pb) {
  if (*pa >= *pb)
    return *pa;
  else
    return *pb;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jl     112c <max+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <max+0x35>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = select i1 %5, i32 %4, i32 %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_sinhl();
scalar_t__ sinhl(long double);
void test_sinhl(long double ld) {
  if (sinhl(ld) != sinhl(ld))
    link_failure_sinhl();
}


x86 assembly (clang, -O0):
<test_sinhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinhl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinhl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_sinhl+0x43>
mov    $0x0,%al
call   1040 <link_failure_sinhl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sinhl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <sinhl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <sinhl@plt>
cmp    %rax,%rbx
jne    1151 <test_sinhl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_sinhl@plt>

LLVM IR (-O0):
define void @test_sinhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @sinhl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @sinhl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_sinhl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_sinhl(x86_fp80 %0) {
%2 = tail call i64 @sinhl(x86_fp80 %0)
%3 = tail call i64 @sinhl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_sinhl()
br label %7
7: ; preds = %5, %1
ret void
}
void RTFsQuerySerial(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFsQuerySerial() {
ret void
}
void __attribute__((weak)) nacl_pre_syscall_hook() {}


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

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

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

LLVM IR (-O2):
define weak void @nacl_pre_syscall_hook() {
ret void
}
int isglobstr(const char *string) {
  char chr;
  while ((chr = *string++)) {
    if (chr == '*' || chr == '?' || chr == '[')
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<isglobstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     115c <isglobstr+0x5c>
movsbl -0x11(%rbp),%eax
cmp    $0x2a,%eax
je     114b <isglobstr+0x4b>
movsbl -0x11(%rbp),%eax
cmp    $0x3f,%eax
je     114b <isglobstr+0x4b>
movsbl -0x11(%rbp),%eax
cmp    $0x5b,%eax
jne    1157 <isglobstr+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1163 <isglobstr+0x63>
jmp    1108 <isglobstr+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isglobstr>:
movabs $0x2000000200001,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
test   %cl,%cl
je     1132 <isglobstr+0x32>
add    $0x1,%rdi
add    $0xd6,%cl
cmp    $0x31,%cl
ja     1110 <isglobstr+0x10>
movzbl %cl,%ecx
bt     %rcx,%rax
jae    1110 <isglobstr+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isglobstr(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
switch i8 %4, label %2 [
i8 91, label %8
i8 63, label %8
i8 42, label %8
]
8: ; preds = %2, %6, %6, %6
%9 = phi i32 [ 1, %6 ], [ 1, %6 ], [ 1, %6 ], [ 0, %2 ]
ret i32 %9
}
void pcp_print_disk_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_disk_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_disk_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int time_out(time_t this, time_t that, double value) {
  if (difftime(this, that) > value)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<time_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <difftime@plt>
ucomisd -0x18(%rbp),%xmm0
jbe    1145 <time_out+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <time_out+0x3c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_out>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <difftime@plt>
xor    %eax,%eax
ucomisd (%rsp),%xmm0
setbe  %al
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @time_out(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call double @difftime(i32 %8, i32 %9)
%11 = load double, double* %7
%12 = fcmp ogt double %10, %11
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 0, i32* %4
br label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @time_out(i32 %0, i32 %1, double %2) {
%4 = tail call double @difftime(i32 %0, i32 %1)
%5 = fcmp ule double %4, %2
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ hz_abort(char *);
int /*<<< orphan*/ *hz_strncpy(char *, char const *, size_t);
void hz_assert_strncpy_err(char *dest, const char *src, size_t count) {
  if (hz_strncpy(dest, src, count) != NULL) {
    hz_abort("strncpy succeeded when it shouldn't have");
  }
}


x86 assembly (clang, -O0):
<hz_assert_strncpy_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <hz_strncpy@plt>
cmp    $0x0,%rax
je     115b <hz_assert_strncpy_err+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <hz_abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hz_assert_strncpy_err>:
push   %rax
call   1040 <hz_strncpy@plt>
test   %rax,%rax
je     1138 <hz_assert_strncpy_err+0x18>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <hz_abort@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [41 x i8] c"strncpy succeeded when it shouldn't have\00"
define void @hz_assert_strncpy_err(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32* @hz_strncpy(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @hz_abort(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"strncpy succeeded when it shouldn't have\00"
define void @hz_assert_strncpy_err(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32* @hz_strncpy(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @hz_abort(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fchmod(int, int);
int open(char *, int);
int fileCreateMode(char *name, int mode) {
  ;
  int fd = open(name, O_RDWR | O_CREAT);
  if (fd >= 0) {
    fchmod(fd, mode);
    close(fd);
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<fileCreateMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    0x2ea5(%rip),%rax
or     (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1186 <fileCreateMode+0x56>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <fchmod@plt>
mov    -0x18(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    118d <fileCreateMode+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileCreateMode>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    0x2ea4(%rip),%rax
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1050 <open@plt>
test   %eax,%eax
js     1169 <fileCreateMode+0x39>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <fchmod@plt>
mov    %ebp,%edi
call   1030 <close@plt>
mov    $0x1,%eax
jmp    116b <fileCreateMode+0x3b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @fileCreateMode(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* @O_RDWR
%9 = load i32, i32* @O_CREAT
%10 = or i32 %8, %9
%11 = call i32 @open(i8* %7, i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = call i32 @fchmod(i32 %15, i32 %16)
%18 = load i32, i32* %6
%19 = call i32 @close(i32 %18)
store i32 1, i32* %3
br label %21
20: ; preds = %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %14
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @fileCreateMode(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = tail call i32 @open(i8* %0, i32 %5)
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @fchmod(i32 %6, i32 %1)
%10 = tail call i32 @close(i32 %6)
br label %11
11: ; preds = %2, %8
%12 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %12
}
void AtomicPause() { __asm volatile("pause"); }


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

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

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

LLVM IR (-O2):
define void @AtomicPause() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int compare(const void *n1, const void *n2) {
  return (*((int *)n1) - *((int *)n2));
}


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

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

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void eglReleaseThread(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglReleaseThread() {
ret void
}
void CheckIO(void) {}


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

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

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

LLVM IR (-O2):
define void @CheckIO() {
ret void
}
/* Type definitions */
typedef int useconds_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int nanosleep(struct timespec *, int /*<<< orphan*/ *);
int usleep(useconds_t microseconds) {
  struct timespec ts;
  ts.tv_sec = microseconds / 1000000;
  ts.tv_nsec = microseconds % 1000000 * 1000;
  return nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rax
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000000
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @usleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000000
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret i32 %9
}
/* Variables and functions */
int write_value_to_fcd(int, unsigned char, int /*<<< orphan*/ *);
int fcdppSetMixerGain(unsigned char state) {
  return write_value_to_fcd(114, state, NULL);
}


x86 assembly (clang, -O0):
<fcdppSetMixerGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x72,%edi
xor    %eax,%eax
mov    %eax,%edx
movzbl -0x1(%rbp),%esi
call   1030 <write_value_to_fcd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcdppSetMixerGain>:
mov    %edi,%esi
mov    $0x72,%edi
xor    %edx,%edx
jmp    1030 <write_value_to_fcd@plt>

LLVM IR (-O0):
define i32 @fcdppSetMixerGain(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @write_value_to_fcd(i32 114, i8 zeroext %3, i32* null)
ret i32 %4
}

LLVM IR (-O2):
define i32 @fcdppSetMixerGain(i8 zeroext %0) {
%2 = tail call i32 @write_value_to_fcd(i32 114, i8 zeroext %0, i32* null)
ret i32 %2
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t SASR_W(int16_t x, int16_t by) {
  if (x >= 0)
    return x >> by;
  return ~((~x) >> by);
}


x86 assembly (clang, -O0):
<SASR_W>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1124 <SASR_W+0x24>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <SASR_W+0x35>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SASR_W>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @SASR_W(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uint32ToBuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ writeTagPart(int, char *, int /*<<< orphan*/,
                                int /*<<< orphan*/ *, int);
void writeCredits(int entId, uint32_t credits) {
  uint8_t buf[4];
  uint32ToBuf(credits, buf);
  writeTagPart(entId, "credits", 0, buf, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<writeCredits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <uint32ToBuf@plt>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rcx
lea    0xeb8(%rip),%rsi
xor    %edx,%edx
mov    $0x4,%r8d
call   1040 <writeTagPart@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeCredits>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <uint32ToBuf@plt>
lea    0xec3(%rip),%rsi
mov    %ebx,%edi
xor    %edx,%edx
mov    %r14,%rcx
mov    $0x4,%r8d
call   1040 <writeTagPart@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"credits\00"
define void @writeCredits(i32 %0, i32 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @uint32ToBuf(i32 %1, i32* %5)
%7 = call i32 @writeTagPart(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32* %5, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *, int);
int sci_get_chip_id();
int soc_id_is_sc9631v0(void) {
  pr_info("chip id is %x\n", sci_get_chip_id());
  return ((sci_get_chip_id() & (0xFFFF0000)) == ((0x96310000) & (0xFFFF0000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc9631v0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <pr_info@plt>
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
and    $0xffff0000,%eax
cmp    $0x96310000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc9631v0>:
push   %rax
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <pr_info@plt>
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x96310000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc9631v0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -65536
%5 = icmp eq i32 %4, -1775173632
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc9631v0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -65536
%5 = icmp eq i32 %4, -1775173632
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ func21();
void func2() {
  char var_2[2];
  var_2[1] = 0x2;
  func21();
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x2,-0x1(%rbp)
mov    $0x0,%al
call   1030 <func21@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func2() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 2, i8* %2
%3 = call i32 (...) @func21()
ret void
}

LLVM IR (-O2):
define void @func2() {
%1 = tail call i32 (...) @func21()
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
pid_t vfork(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<vfork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfork>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @vfork() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @vfork() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
gline(buf) char buf[];
{
  int c;
  while ((c = getchar()) != '\n') {
    if (c == '\0')
      return (1);
    *buf++ = c;
  }
  *buf = 0;
  return (0);
}


x86 assembly (clang, -O0):
<gline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xa,%eax
je     1160 <gline+0x50>
cmpl   $0x0,-0x14(%rbp)
jne    1145 <gline+0x35>
movl   $0x1,-0x4(%rbp)
jmp    116e <gline+0x5e>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    111c <gline+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gline>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
test   %eax,%eax
je     1138 <gline+0x28>
cmp    $0xa,%eax
je     113f <gline+0x2f>
mov    %al,(%rbx)
add    $0x1,%rbx
jmp    1120 <gline+0x10>
mov    $0x1,%eax
pop    %rbx
ret
movb   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @gline(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %7, %5 ]
%4 = tail call i32 (...) @getchar()
switch i32 %4, label %5 [
i32 10, label %8
i32 0, label %9
]
5: ; preds = %2
%6 = trunc i32 %4 to i8
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %6, i8* %3
br label %2
8: ; preds = %2
store i8 0, i8* %3
br label %9
9: ; preds = %2, %8
%10 = phi i32 [ 0, %8 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assume(int);
int /*<<< orphan*/ static_assert(int);
int main(int n) {
  int i, sum = 0;
  assume(n >= 0);
  for (i = 0; i < n; ++i)
    sum = sum + i;
  static_assert(sum >= 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1174 <main+0x54>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <main+0x31>
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <static_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
not    %edi
shr    $0x1f,%edi
call   1040 <assume@plt>
mov    $0x1,%edi
call   1030 <static_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assume(i32 %3)
%5 = tail call i32 @static_assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
scalar_t__ pthread_cond_destroy(int /*<<< orphan*/ *);
scalar_t__ pthread_cond_init(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int condvar_reinit(pthread_cond_t *condvar, const pthread_condattr_t *attr) {
  int result = 1;
  if (pthread_cond_destroy(condvar) == 0 &&
      pthread_cond_init(condvar, attr) == 0)
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<condvar_reinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_cond_destroy@plt>
cmp    $0x0,%rax
jne    1168 <condvar_reinit+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_cond_init@plt>
cmp    $0x0,%rax
jne    1168 <condvar_reinit+0x48>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<condvar_reinit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <pthread_cond_destroy@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1152 <condvar_reinit+0x32>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <pthread_cond_init@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @condvar_reinit(i32* %0, i32* %1) {
%3 = tail call i64 @pthread_cond_destroy(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @pthread_cond_init(i32* %0, i32* %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
void ff_hevc_put_hevc_uni_w_epel_hv16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_hv16_10_sse4() {
ret void
}
void simple(void) {
  int x;
  int y = x + 1;
}


x86 assembly (clang, -O0):
<simple>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @simple() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @simple() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int system(char *);
int main() {
  int value = system("raspistill -o hoge.jpg");
  printf("%d\n", value);
  if (value == 17920) {
    printf("カメラが接続されてません\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x4600,-0x8(%rbp)
jne    116a <main+0x4a>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <system@plt>
mov    %eax,%ebx
lea    0xed1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x4600,%ebx
jne    1163 <main+0x33>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"raspistill -o hoge.jpg\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [38 x i8] c"\E3\82\AB\E3\83\A1\E3\83\A9\E3\81\8C\E6\8E\A5\E7\B6\9A\E3\81\95\E3\82\8C\E3\81\A6\E3\81\BE\E3\81\9B\E3\82\93\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 17920
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"raspistill -o hoge.jpg\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [37 x i8] c"\E3\82\AB\E3\83\A1\E3\83\A9\E3\81\8C\E6\8E\A5\E7\B6\9A\E3\81\95\E3\82\8C\E3\81\A6\E3\81\BE\E3\81\9B\E3\82\93\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, 17920
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}
__attribute__((always_)) void account_user_vtime(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @account_user_vtime(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned char *ecdh_init_private_key(unsigned char *, size_t);
unsigned char *ke_ecdh_private(unsigned char *priv, size_t size) {
  return ecdh_init_private_key(priv, size);
}


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

x86 assembly (clang, -O2):
<ke_ecdh_private>:
jmp    1030 <ecdh_init_private_key@plt>

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

LLVM IR (-O2):
define i8* @ke_ecdh_private(i8* %0, i64 %1) {
%3 = tail call i8* @ecdh_init_private_key(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ textcolor(int, int, int /*<<< orphan*/);
void Color(int color) {
  if (color == 3)
    textcolor(1, color, 0);
  else
    textcolor(0, color, 0);
}


x86 assembly (clang, -O0):
<Color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1139 <Color+0x29>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
xor    %edx,%edx
call   1030 <textcolor@plt>
jmp    1145 <Color+0x35>
mov    -0x4(%rbp),%esi
xor    %edx,%edx
mov    %edx,%edi
call   1030 <textcolor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Color>:
cmp    $0x3,%edi
jne    1126 <Color+0x16>
mov    $0x1,%edi
mov    $0x3,%esi
xor    %edx,%edx
jmp    1030 <textcolor@plt>
mov    %edi,%esi
xor    %edi,%edi
xor    %edx,%edx
jmp    1030 <textcolor@plt>

LLVM IR (-O0):
define void @Color(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @textcolor(i32 1, i32 %6, i32 0)
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @textcolor(i32 0, i32 %9, i32 0)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @Color(i32 %0) {
%2 = icmp eq i32 %0, 3
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @textcolor(i32 1, i32 3, i32 0)
br label %7
5: ; preds = %1
%6 = tail call i32 @textcolor(i32 0, i32 %0, i32 0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t);
int main() {
  size_t temp = 90;
  int a = 90;
  if (temp == a)
    printf("%d\n", temp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x5a,-0x10(%rbp)
movl   $0x5a,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jne    114f <main+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 90, i64* %2
store i32 90, i32* %3
%4 = load i64, i64* %2
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = icmp eq i64 %4, %6
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 90)
ret i32 0
}
/* Variables and functions */
int FS_JKISS();
int I_JKISS(int l, int u) {
  int i;
  int delta;
  delta = (u - l) + 1;
  i = (int)(delta * FS_JKISS());
  i = i + l;
  return i;
}


x86 assembly (clang, -O0):
<I_JKISS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <FS_JKISS@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I_JKISS>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sub    %edi,%esi
lea    0x1(%rsi),%ebp
xor    %eax,%eax
call   1030 <FS_JKISS@plt>
imul   %ebp,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @I_JKISS(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 (...) @FS_JKISS()
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @I_JKISS(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i32 (...) @FS_JKISS()
%6 = mul nsw i32 %5, %4
%7 = add nsw i32 %6, %0
ret i32 %7
}