xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test(char *);
int /*<<< orphan*/ test1(char *);
int main01(void) {
  test("Hello World!\n");
  char s[] = "hello world";
  test1(s);
  printf("s = %s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <test@plt>
mov    0xec3(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <test1@plt>
lea    -0xc(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main01>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1050 <test@plt>
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,(%rsp)
movl   $0x646c72,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <test1@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@__const.main01.s = [12 x i8] c"hello world\00"
@.str.1 = [8 x i8] c"s = %s\0A\00"
define i32 @main01() {
%1 = alloca [12 x i8]
%2 = call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = bitcast [12 x i8]* %1 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = call i32 @test1(i8* %4)
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
@__const.main01.s = [12 x i8] c"hello world\00"
@.str.1 = [8 x i8] c"s = %s\0A\00"
define i32 @main01() {
%1 = alloca [12 x i8]
%2 = tail call i32 @test(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = call i32 @test1(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
ssize_t find_in_data(unsigned char *alphabet, size_t len, unsigned char c) {
  ssize_t i;
  for (i = 0; i < len; ++i)
    if (alphabet[i] == c)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<find_in_data>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <find_in_data+0x62>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <find_in_data+0x4c>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <find_in_data+0x6a>
jmp    1151 <find_in_data+0x51>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1119 <find_in_data+0x19>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_in_data>:
mov    $0xffffffffffffffff,%rax
test   %rsi,%rsi
je     111e <find_in_data+0x1e>
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %dl,(%rdi,%rcx,1)
je     111f <find_in_data+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <find_in_data+0x10>
ret
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @find_in_data(i8* %0, i64 %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8 %2, i8* %7
store i64 0, i64* %8
br label %9
9: ; preds = %25, %3
%10 = load i64, i64* %8
%11 = load i64, i64* %6
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i64, i64* %8
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %18, %20
br i1 %21, label %22, label %24
22: ; preds = %13
%23 = load i64, i64* %8
store i64 %23, i64* %4
br label %29
24: ; preds = %13
br label %25
25: ; preds = %24
%26 = load i64, i64* %8
%27 = add i64 %26, 1
store i64 %27, i64* %8
br label %9
28: ; preds = %9
store i64 -1, i64* %4
br label %29
29: ; preds = %28, %22
%30 = load i64, i64* %4
ret i64 %30
}

LLVM IR (-O2):
define i64 @find_in_data(i8* nocapture %0, i64 %1, i8 zeroext %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %10
%6 = phi i64 [ %11, %10 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %2
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %5, %10, %3
%14 = phi i64 [ -1, %3 ], [ -1, %10 ], [ %6, %5 ]
ret i64 %14
}
int leading_one_l(long val) {
  return sizeof(long) * 8 - 1 - __builtin_clzl(val);
}


x86 assembly (clang, -O0):
<leading_one_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
movslq %eax,%rcx
mov    $0x3f,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leading_one_l>:
bsr    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @leading_one_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctlz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
%7 = sub i64 63, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @leading_one_l(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
%4 = xor i32 %3, 63
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ parse_number(char const *, char const *);
int main() {
  const char p[] = "0x123";
  parse_number(p, p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0xa(%rbp),%rsi
call   1030 <parse_number@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x33,0x4(%rsp)
movl   $0x32317830,(%rsp)
mov    %rsp,%rdi
mov    %rdi,%rsi
call   1030 <parse_number@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.p = [6 x i8] c"0x123\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @parse_number(i8* %2, i8* %2)
ret i32 0
}
/* Variables and functions */
int iotapi_queue_command(char *);
int iotapi_handler_stop(void) {
  ;
  char command[3] = "st";
  int ret = iotapi_queue_command(command);
  if (ret < 0) {
    ;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iotapi_handler_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x7(%rbp),%rdi
call   1030 <iotapi_queue_command@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114e <iotapi_handler_stop+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <iotapi_handler_stop+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iotapi_handler_stop>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0x7473,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <iotapi_queue_command@plt>
sar    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.iotapi_handler_stop.command = [3 x i8] c"st\00"
define i32 @iotapi_handler_stop() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca i32
%4 = bitcast [3 x i8]* %2 to i8*
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = call i32 @iotapi_queue_command(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@__const.iotapi_handler_stop.command = [3 x i8] c"st\00"
define i32 @iotapi_handler_stop() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @iotapi_queue_command(i8* %2)
%4 = ashr i32 %3, 31
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ create_fs(char *, int);
int main(int argc, char **argv) {
  create_fs("test", 512);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
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 @create_fs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 512)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @create_fs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 512)
ret i32 0
}
int ft_isprint(int c) {
  if (c < 127 && c > 31)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jge    1127 <ft_isprint+0x27>
cmpl   $0x1f,-0x8(%rbp)
jle    1127 <ft_isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_CIPHER_CTX_reset(int /*<<< orphan*/ *);
int /*<<< orphan*/ OPENSSL_free(int /*<<< orphan*/ *);
void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) {
  EVP_CIPHER_CTX_reset(ctx);
  OPENSSL_free(ctx);
}


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

x86 assembly (clang, -O2):
<EVP_CIPHER_CTX_free>:
push   %rbx
mov    %rdi,%rbx
call   1030 <EVP_CIPHER_CTX_reset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <OPENSSL_free@plt>

LLVM IR (-O0):
define void @EVP_CIPHER_CTX_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @EVP_CIPHER_CTX_reset(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @OPENSSL_free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_free(i32* %0) {
%2 = tail call i32 @EVP_CIPHER_CTX_reset(i32* %0)
%3 = tail call i32 @OPENSSL_free(i32* %0)
ret void
}
/* Variables and functions */
float sxnoise_grad_2d(float, float, int, float *, float *);
float grad_noise(float x, float y, float *dx, float *dy) {
  return sxnoise_grad_2d(x * 0.8, y * 0.8, 17, dx, dy);
}


x86 assembly (clang, -O0):
<grad_noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeac(%rip),%xmm2
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x11,%edi
call   1030 <sxnoise_grad_2d@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grad_noise>:
mov    %rsi,%rdx
mov    %rdi,%rsi
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm2
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
mov    $0x11,%edi
jmp    1030 <sxnoise_grad_2d@plt>

LLVM IR (-O0):
define float @grad_noise(float %0, float %1, float* %2, float* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float*
%8 = alloca float*
store float %0, float* %5
store float %1, float* %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float, float* %5
%10 = fpext float %9 to double
%11 = fmul double %10, 8.000000e-01
%12 = fptrunc double %11 to float
%13 = load float, float* %6
%14 = fpext float %13 to double
%15 = fmul double %14, 8.000000e-01
%16 = fptrunc double %15 to float
%17 = load float*, float** %7
%18 = load float*, float** %8
%19 = call float @sxnoise_grad_2d(float %12, float %16, i32 17, float* %17, float* %18)
ret float %19
}

LLVM IR (-O2):
define float @grad_noise(float %0, float %1, float* %2, float* %3) {
%5 = fpext float %0 to double
%6 = fmul double %5, 8.000000e-01
%7 = fptrunc double %6 to float
%8 = fpext float %1 to double
%9 = fmul double %8, 8.000000e-01
%10 = fptrunc double %9 to float
%11 = tail call float @sxnoise_grad_2d(float %7, float %10, i32 17, float* %2, float* %3)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ read(int, unsigned char *, int);
void waitForConversion(int fd, unsigned char *buffer, int n) {
  for (;;) {
    read(fd, buffer, n);
    if ((buffer[n - 1] & 0x80) == 0)
      break;
    delay(1);
  }
}


x86 assembly (clang, -O0):
<waitForConversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1165 <waitForConversion+0x45>
jmp    1174 <waitForConversion+0x54>
mov    $0x1,%edi
call   1030 <delay@plt>
jmp    1132 <waitForConversion+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForConversion>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
call   1040 <read@plt>
movslq %ebp,%rbp
cmpb   $0x0,-0x1(%rbp,%rbx,1)
jns    115e <waitForConversion+0x3e>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <delay@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <read@plt>
cmpb   $0x0,-0x1(%rbx,%rbp,1)
js     1140 <waitForConversion+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @waitForConversion(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %22, %3
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, 128
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %7
br label %24
22: ; preds = %7
%23 = call i32 @delay(i32 1)
br label %7
24: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @waitForConversion(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = add nsw i32 %2, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = icmp sgt i8 %8, -1
br i1 %9, label %15, label %10
10: ; preds = %3, %10
%11 = tail call i32 @delay(i32 1)
%12 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%13 = load i8, i8* %7
%14 = icmp sgt i8 %13, -1
br i1 %14, label %15, label %10
15: ; preds = %10, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DownKey242(unsigned char);
void downkey(unsigned char k) { DownKey242(k); }


x86 assembly (clang, -O0):
<downkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <DownKey242@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downkey>:
jmp    1030 <DownKey242@plt>

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

LLVM IR (-O2):
define void @downkey(i8 zeroext %0) {
%2 = tail call i32 @DownKey242(i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_sha1;
int jksengine_digests_update(int /*<<< orphan*/ *, void const *, unsigned long,
                             int /*<<< orphan*/);
int jksengine_sha1_update(EVP_MD_CTX *ctx, const void *data,
                          unsigned long count) {
  ;
  return (jksengine_digests_update(ctx, data, count, NID_sha1));
}


x86 assembly (clang, -O0):
<jksengine_sha1_update>:
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
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
call   1030 <jksengine_digests_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_sha1_update>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <jksengine_digests_update@plt>

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

LLVM IR (-O2):
@NID_sha1 = global i32 0
define i32 @jksengine_sha1_update(i32* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @NID_sha1
%5 = tail call i32 @jksengine_digests_update(i32* %0, i8* %1, i64 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int errno;
int snprintf(char *, int, char *, int);
int write(int, char *, int);
int write_message(int fd) {
  char message_buf[32];
  int len;
  len = snprintf(message_buf, 32, "Hello from file descriptor %d!\n", fd);
  if (write(fd, message_buf, len) != len) {
    return errno;
  }
  return 0;
}


x86 assembly (clang, -O0):
<write_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x20,%esi
lea    0xec2(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   1030 <write@plt>
cmp    -0x34(%rbp),%eax
je     116f <write_message+0x4f>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <write_message+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_message>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
lea    0xecf(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
mov    %ebx,%ecx
call   1040 <snprintf@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
je     1162 <write_message+0x42>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Hello from file descriptor %d!\0A\00"
@errno = global i32 0
define i32 @write_message(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [32 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @snprintf(i8* %6, i32 32, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%11 = load i32, i32* %5
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
%13 = load i32, i32* %5
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = load i32, i32* @errno
store i32 %16, i32* %2
br label %18
17: ; preds = %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [32 x i8] c"Hello from file descriptor %d!\0A\00"
@errno = global i32 0
define i32 @write_message(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 32, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @write(i32 %0, i8* %3, i32 %4)
%6 = icmp eq i32 %5, %4
%7 = load i32, i32* @errno
%8 = select i1 %6, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ decref(char *);
int /*<<< orphan*/ free(void *);
void free_dbg(void *value, char *name) {
  decref(name);
  free(value);
}


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

x86 assembly (clang, -O2):
<free_dbg>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <decref@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_dbg(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @decref(i8* %1)
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int STC3115_ReadByte(int);
int STC3115_WriteByte(int, int);
int STC3115_AlarmSet(void) {
  int res;
  res = STC3115_ReadByte(0x00);
  res = STC3115_WriteByte(0x00, (res | 0x08));
  if (res != 0)
    return (res);
  return (0);
}


x86 assembly (clang, -O0):
<STC3115_AlarmSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <STC3115_ReadByte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
or     $0x8,%esi
xor    %edi,%edi
call   1030 <STC3115_WriteByte@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1157 <STC3115_AlarmSet+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <STC3115_AlarmSet+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_AlarmSet>:
push   %rax
xor    %edi,%edi
call   1040 <STC3115_ReadByte@plt>
or     $0x8,%eax
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <STC3115_WriteByte@plt>

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

LLVM IR (-O2):
define i32 @STC3115_AlarmSet() {
%1 = tail call i32 @STC3115_ReadByte(i32 0)
%2 = or i32 %1, 8
%3 = tail call i32 @STC3115_WriteByte(i32 0, i32 %2)
ret i32 %3
}
/* Variables and functions */
double sin(double);
double cos(double x) { return sin(3.1415926535898 / 2 - x); }


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 0x3FF921FB54442D28, %3
%5 = call double @sin(double %4)
ret double %5
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = fsub double 0x3FF921FB54442D28, %0
%3 = tail call double @sin(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *, char *, int /*<<< orphan*/);
void int_13(void) { panic("Gneral Protection Fault", "#GP", 0); }


x86 assembly (clang, -O0):
<int_13>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef6(%rip),%rsi
xor    %edx,%edx
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_13>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
xor    %edx,%edx
jmp    1030 <panic@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Gneral Protection Fault\00"
@.str.1 = [4 x i8] c"#GP\00"
define void @int_13() {
%1 = call i32 @panic(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Gneral Protection Fault\00"
@.str.1 = [4 x i8] c"#GP\00"
define void @int_13() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
char *tgoto(const char *cap, int col, int row) { return NULL; }


x86 assembly (clang, -O0):
<tgoto>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @tgoto(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @tgoto(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* null
}
int g() { return 33; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 33
}

LLVM IR (-O2):
define i32 @g() {
ret i32 33
}
/* Variables and functions */
int /*<<< orphan*/ write(int, unsigned char *, int);
void dontEcho(int f) {
  unsigned char e[3] = {255, 254, 1};
  write(f, e, 3);
}


x86 assembly (clang, -O0):
<dontEcho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dontEcho>:
push   %rax
movb   $0x1,0x6(%rsp)
movw   $0xfeff,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.dontEcho.e = [3 x i8] c"\FF\FE\01"
define void @dontEcho(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = bitcast [3 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @write(i32 %5, i8* %6, i32 3)
ret void
}

LLVM IR (-O2):
@__const.dontEcho.e = [3 x i8] c"\FF\FE\01"
define void @dontEcho(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @write(i32 %0, i8* %3, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\nThis is a disabled shell account.\n\n"
         "You can enable login for this account on the panel by selecting an\n"
         "appropriate shell in the user preferences section.\n\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [156 x i8] c"\0AThis is a disabled shell account.\0A\0AYou can enable login for this account on the panel by selecting an\0Aappropriate shell in the user preferences section.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [155 x i8] c"\0AThis is a disabled shell account.\0A\0AYou can enable login for this account on the panel by selecting an\0Aappropriate shell in the user preferences section.\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([155 x i8], [155 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fexist(char *filename) {
  FILE *fd;
  fd = fopen(filename, "rb");
  if (fd != NULL) {
    fclose(fd);
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<fexist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <fexist+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <fexist+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexist>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fexist+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @fexist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int g_daystotal(int, int, int);
int g_day_of_week(int y, int m, int d) {
  return (g_daystotal(y, m, d) % 7) + 1;
}


x86 assembly (clang, -O0):
<g_day_of_week>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <g_daystotal@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_day_of_week>:
push   %rax
call   1030 <g_daystotal@plt>
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g_day_of_week(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 @g_daystotal(i32 %7, i32 %8, i32 %9)
%11 = srem i32 %10, 7
%12 = add nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
define i32 @g_day_of_week(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @g_daystotal(i32 %0, i32 %1, i32 %2)
%5 = srem i32 %4, 7
%6 = add nsw i32 %5, 1
ret i32 %6
}
int qsort_cmp__ALIST_ID(const void *x, const void *y) {
  if (*((int *)x) > *((int *)y))
    return (-1);
  else
    return (*((int *)x) < *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp__ALIST_ID>:
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
jle    112a <qsort_cmp__ALIST_ID+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp__ALIST_ID+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp__ALIST_ID>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp__ALIST_ID(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 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int, int, int, int, int,
                          int, int, int, int, int, int, int, int, int, int);
int main(void) {
  printf("%d %d %d %d  %d %d %d %d  %d %d %d %d  %d %d %d %d\n", 0, 1, 2, 3, 4,
         5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x4,%r9d
movl   $0x5,(%rsp)
movl   $0x6,0x8(%rsp)
movl   $0x7,0x10(%rsp)
movl   $0x8,0x18(%rsp)
movl   $0x9,0x20(%rsp)
movl   $0xa,0x28(%rsp)
movl   $0xb,0x30(%rsp)
movl   $0xc,0x38(%rsp)
movl   $0xd,0x40(%rsp)
movl   $0xe,0x48(%rsp)
movl   $0xf,0x50(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
lea    0xee4(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x4,%r9d
push   $0xf
push   $0xe
push   $0xd
push   $0xc
push   $0xb
push   $0xa
push   $0x9
push   $0x8
push   $0x7
push   $0x6
push   $0x5
call   1030 <printf@plt>
add    $0x60,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [52 x i8] c"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15)
ret i32 0
}
void kore_mem_init(void) {}


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

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

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

LLVM IR (-O2):
define void @kore_mem_init() {
ret void
}
/* Variables and functions */
int sum(int, int, int, int, int);
int main() { return sum(1, 2, 4, 8, 16); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
mov    $0x10,%r8d
call   1030 <sum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
mov    $0x10,%r8d
jmp    1030 <sum@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 2, i32 4, i32 8, i32 16)
ret i32 %1
}
/* Variables and functions */
scalar_t__ send(int, char const *, size_t, int /*<<< orphan*/);
size_t strlen(char const *);
void writeSocket(int fd, const char *msg) {
  size_t nbytes = 0;
  size_t len = strlen(msg);
  while (nbytes < len)
    nbytes += send(fd, msg, len, 0);
}


x86 assembly (clang, -O0):
<writeSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1171 <writeSocket+0x51>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1040 <send@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1144 <writeSocket+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeSocket>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%r14d
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
je     1158 <writeSocket+0x38>
mov    %rax,%rbp
xor    %ebx,%ebx
nop
mov    %r14d,%edi
mov    %r15,%rsi
mov    %rbp,%rdx
xor    %ecx,%ecx
call   1040 <send@plt>
add    %rax,%rbx
cmp    %rbp,%rbx
jb     1140 <writeSocket+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @writeSocket(i32 %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i64 @send(i32 %0, i8* %1, i64 %3, i32 0)
%8 = add i64 %7, %6
%9 = icmp ult i64 %8, %3
br i1 %9, label %5, label %10
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ slist_element_destory_double(void *, int /*<<< orphan*/ *);
void slist_element_destory(void *x) { slist_element_destory_double(x, NULL); }


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

x86 assembly (clang, -O2):
<slist_element_destory>:
xor    %esi,%esi
jmp    1030 <slist_element_destory_double@plt>

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

LLVM IR (-O2):
define void @slist_element_destory(i8* %0) {
%2 = tail call i32 @slist_element_destory_double(i8* %0, i32* null)
ret void
}
/* Type definitions */
struct _cgatsAlloc {
  int dummy;
};

/* Variables and functions */
void *realloc(void *, size_t);
void *cgatsAllocStd_realloc(struct _cgatsAlloc *pp, void *ptr, size_t size) {
  void *rv = realloc(ptr, size);
  return rv;
}


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

x86 assembly (clang, -O2):
<cgatsAllocStd_realloc>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
%struct._cgatsAlloc = type { i32 }
define i8* @cgatsAllocStd_realloc(%struct._cgatsAlloc* %0, i8* %1, i64 %2) {
%4 = alloca %struct._cgatsAlloc*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct._cgatsAlloc* %0, %struct._cgatsAlloc** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @realloc(i8* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
ret i8* %11
}

LLVM IR (-O2):
%struct._cgatsAlloc = type { i32 }
define noalias i8* @cgatsAllocStd_realloc(%struct._cgatsAlloc* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %1, i64 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int crn_dir_accessible(char *path) {
  DIR *dir = opendir(path);
  if (dir) {
    closedir(dir);
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<crn_dir_accessible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <crn_dir_accessible+0x39>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x0,-0x4(%rbp)
jmp    1160 <crn_dir_accessible+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crn_dir_accessible>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     1137 <crn_dir_accessible+0x17>
mov    %rax,%rdi
call   1040 <closedir@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @crn_dir_accessible(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
void strength_result6(int *data) {
  int j = data[0] * 21;
  int i = data[1] * 21;
  do {
    data[data[2]] = 2;
    i = i + j;
  } while (i < data[3]);
}


x86 assembly (clang, -O0):
<strength_result6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x15,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x15,0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     111d <strength_result6+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_result6>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
lea    (%rax,%rax,4),%edx
lea    (%rax,%rdx,4),%eax
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %eax,%ecx
movslq 0x8(%rdi),%rdx
movl   $0x2,(%rdi,%rdx,4)
cmp    0xc(%rdi),%ecx
jl     1120 <strength_result6+0x20>
ret

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

LLVM IR (-O2):
define void @strength_result6(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 21
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 21
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = getelementptr inbounds i32, i32* %0, i64 3
br label %9
9: ; preds = %9, %1
%10 = phi i32 [ %6, %1 ], [ %14, %9 ]
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 2, i32* %13
%14 = add nsw i32 %10, %3
%15 = load i32, i32* %8
%16 = icmp slt i32 %14, %15
br i1 %16, label %9, label %17
17: ; preds = %9
ret void
}
void _Mutex_recursive_Destroy(struct _Mutex_recursive_Control *_mutex) {
  (void)_mutex;
}


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

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

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

LLVM IR (-O2):
%struct._Mutex_recursive_Control = type opaque
define void @_Mutex_recursive_Destroy(%struct._Mutex_recursive_Control* nocapture %0) {
ret void
}
void rt_process_info_set_req(char *buf) { return; }


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

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

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

LLVM IR (-O2):
define void @rt_process_info_set_req(i8* nocapture %0) {
ret void
}
unsigned long get_hz() {
  unsigned long Hertz = 0;
  Hertz = 100;
  return Hertz;
}


x86 assembly (clang, -O0):
<get_hz>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @get_hz() {
ret i64 100
}