xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _I8080_IN();
void do0xDB() { _I8080_IN(); }


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

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

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

LLVM IR (-O2):
define void @do0xDB() {
%1 = tail call i32 (...) @_I8080_IN()
ret void
}
long int atol(const char *string) {
  long int num = 0;
  while (*string) {
    num *= 10;
    num += *string++ - '0';
  }
  return num;
}


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <atol+0x4a>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <atol+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <atol+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%rax
movsbq %cl,%rcx
lea    (%rcx,%rax,2),%rax
add    $0xffffffffffffffd0,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atol+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nsw i64 %6, 10
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i64
%11 = add i64 %8, -48
%12 = add i64 %11, %10
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 0, %1 ], [ %12, %4 ]
ret i64 %16
}
/* Variables and functions */
unsigned int INADDR_NONE;
int inet_addr(char const *);
int zget_ipint(const char *ipstr) {
  int ip = inet_addr(ipstr);
  if ((unsigned int)ip == INADDR_NONE) {
    return 0;
  }
  return ip;
}


x86 assembly (clang, -O0):
<zget_ipint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%eax
jne    1146 <zget_ipint+0x36>
movl   $0x0,-0x4(%rbp)
jmp    114c <zget_ipint+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zget_ipint>:
push   %rax
call   1030 <inet_addr@plt>
mov    0x2ecb(%rip),%rcx
xor    %edx,%edx
cmp    (%rcx),%eax
cmove  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@INADDR_NONE = global i32 0
define i32 @zget_ipint(i8* %0) {
%2 = tail call i32 @inet_addr(i8* %0)
%3 = load i32, i32* @INADDR_NONE
%4 = icmp eq i32 %2, %3
%5 = select i1 %4, i32 0, i32 %2
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int height;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xconfigurerequest_height(void *_p, int _v) {
  ((XEvent *)_p)->xconfigurerequest.height = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xconfigurerequest_height>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xconfigurerequest_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ foo;

/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int foo[] = {1, 2, 3, 4};
  int *x = foo;
  int(*y)[4] = &foo;
  printf("size of foo: %lu\n", sizeof(foo));
  bar(foo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeda(%rip),%rdi
mov    $0x10,%esi
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.foo = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [18 x i8] c"size of foo: %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32*
%4 = alloca [4 x i32]*
store i32 0, i32* %1
%5 = bitcast [4 x i32]* %2 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %3
store [4 x i32]* %2, [4 x i32]** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 16)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = call i32 @bar(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.foo = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [18 x i8] c"size of foo: %lu\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 16)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%5 = call i32 @bar(i32* %4)
ret i32 0
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t get_sub_bucket_index(int64_t v, int32_t index, int32_t magnitude) {
  return (int32_t)(v >> (index + magnitude));
}


x86 assembly (clang, -O0):
<get_sub_bucket_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sub_bucket_index>:
mov    %edi,%eax
lea    (%rsi,%rdx,1),%ecx
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @get_sub_bucket_index(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = ashr i32 %0, %4
ret i32 %5
}
int main(void) {
  int x = 0;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double quape3_(double *, double *);
double cquape3(double *f, double *para) { return quape3_(f, para); }


x86 assembly (clang, -O0):
<cquape3>:
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 <quape3_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cquape3>:
jmp    1030 <quape3_@plt>

LLVM IR (-O0):
define double @cquape3(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call double @quape3_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @cquape3(double* %0, double* %1) {
%3 = tail call double @quape3_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x07() {
  Assert_real((isupper(7) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              40, ("isupper should be 0 for 0x07"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x07\00"
define void @t_isupper_0x07() {
%1 = tail call i64 @isupper(i32 7)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x02() {
  Assert_real((isbdigit(2) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              15, ("isbdigit should be 0 for 0x02"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x02>:
push   %rax
mov    $0x2,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xf,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x02\00"
define void @t_isbdigit_0x02() {
%1 = tail call i64 @isbdigit(i32 2)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  int i, j, sum;
  sum = 0;
  for (i = 0; i < 10; i++) {
    if (i & 1)
      continue;
    for (j = 0; j < 10; j++) {
      if (j & 1)
        continue;
      sum += i * j;
    }
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    118a <main+0x8a>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <main+0x37>
jmp    117c <main+0x7c>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1177 <main+0x77>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     115c <main+0x5c>
jmp    1169 <main+0x69>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <main+0x3e>
jmp    117c <main+0x7c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 400
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ getpid();
int pause();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("Before pause (pid=%ld)\n", (long)getpid());
  int res = pause();
  printf("After pause (returned value is %d)\n", res);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <pause@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <pause@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Before pause (pid=%ld)\0A\00"
@.str.1 = [36 x i8] c"After pause (returned value is %d)\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 (...) @getpid()
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @pause()
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"Before pause (pid=%ld)\0A\00"
@.str.1 = [36 x i8] c"After pause (returned value is %d)\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @getpid()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @pause()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ might_sleep();
void cond_synchronize_rcu(unsigned long oldstate) { might_sleep(); }


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

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

LLVM IR (-O0):
define void @cond_synchronize_rcu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @might_sleep()
ret void
}

LLVM IR (-O2):
define void @cond_synchronize_rcu(i64 %0) {
%2 = tail call i32 (...) @might_sleep()
ret void
}
long int cast_int_long_fast(int x) { return (long int)x; }


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

x86 assembly (clang, -O2):
<cast_int_long_fast>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @cast_int_long_fast(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_int_long_fast(i32 %0) {
%2 = sext i32 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Sys_Printf(char *);
void Cmd_Help_f(void) {
  Sys_Printf("Use cmdlist to get a list of commands or cvarlist to get a list "
             "of variables.\n");
}


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

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

LLVM IR (-O0):
@.str = [79 x i8] c"Use cmdlist to get a list of commands or cvarlist to get a list of variables.\0A\00"
define void @Cmd_Help_f() {
%1 = call i32 @Sys_Printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [79 x i8] c"Use cmdlist to get a list of commands or cvarlist to get a list of variables.\0A\00"
define void @Cmd_Help_f() {
%1 = tail call i32 @Sys_Printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret void
}
void INT_Excep_PERIB_INTB158(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB158() {
ret void
}
/* Variables and functions */
int cbmarch_reset(int);
int cbm_reset(int HandleDevice) {
  ;
  return cbmarch_reset(HandleDevice);
}


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

x86 assembly (clang, -O2):
<cbm_reset>:
jmp    1030 <cbmarch_reset@plt>

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

LLVM IR (-O2):
define i32 @cbm_reset(i32 %0) {
%2 = tail call i32 @cbmarch_reset(i32 %0)
ret i32 %2
}
int test_imm_0Dint8_reg(signed char val) {
  return ((val) & (-0x0D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Dint8_reg(i8 signext %0) {
%2 = and i8 %0, -13
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct Diagram_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ create_diagram(struct Diagram_t *);
int /*<<< orphan*/ sort_diagram(struct Diagram_t *);
void create_letter_distribution_diagram(struct Diagram_t *diagram) {
  create_diagram(diagram);
  sort_diagram(diagram);
}


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

x86 assembly (clang, -O2):
<create_letter_distribution_diagram>:
push   %rbx
mov    %rdi,%rbx
call   1040 <create_diagram@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <sort_diagram@plt>

LLVM IR (-O0):
%struct.Diagram_t = type { i32 }
define void @create_letter_distribution_diagram(%struct.Diagram_t* %0) {
%2 = alloca %struct.Diagram_t*
store %struct.Diagram_t* %0, %struct.Diagram_t** %2
%3 = load %struct.Diagram_t*, %struct.Diagram_t** %2
%4 = call i32 @create_diagram(%struct.Diagram_t* %3)
%5 = load %struct.Diagram_t*, %struct.Diagram_t** %2
%6 = call i32 @sort_diagram(%struct.Diagram_t* %5)
ret void
}

LLVM IR (-O2):
%struct.Diagram_t = type { i32 }
define void @create_letter_distribution_diagram(%struct.Diagram_t* %0) {
%2 = tail call i32 @create_diagram(%struct.Diagram_t* %0)
%3 = tail call i32 @sort_diagram(%struct.Diagram_t* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int sqlite_get_popd(int /*<<< orphan*/ *, char *);
int mode_list(sqlite3 *db, int argc, char *argv[]) {
  char *filter = "%";
  if (argc > 1) {
    filter = argv[1];
  }
  return sqlite_get_popd(db, filter);
}


x86 assembly (clang, -O0):
<mode_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1144 <mode_list+0x34>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <sqlite_get_popd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_list>:
cmp    $0x2,%esi
jl     111e <mode_list+0xe>
mov    0x8(%rdx),%rsi
jmp    1030 <sqlite_get_popd@plt>
lea    0xedb(%rip),%rsi
jmp    1030 <sqlite_get_popd@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"%\00"
define i32 @mode_list(i32* %0, i32 %1, i8** nocapture %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = getelementptr inbounds i8*, i8** %2, i64 1
%7 = load i8*, i8** %6
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ %7, %5 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %3 ]
%10 = tail call i32 @sqlite_get_popd(i32* %0, i8* %9)
ret i32 %10
}
/* Variables and functions */
char *rmlead(int /*<<< orphan*/);
int /*<<< orphan*/ rmtrail(char *);
char *remove_whitespace(char *str) { return rmlead(rmtrail(str)); }


x86 assembly (clang, -O0):
<remove_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rmtrail@plt>
mov    %eax,%edi
call   1030 <rmlead@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_whitespace>:
push   %rax
call   1040 <rmtrail@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <rmlead@plt>

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

LLVM IR (-O2):
define i8* @remove_whitespace(i8* %0) {
%2 = tail call i32 @rmtrail(i8* %0)
%3 = tail call i8* @rmlead(i32 %2)
ret i8* %3
}
/* Type definitions */
struct pollfd {
  int fd;
  int /*<<< orphan*/ events;
};

/* Variables and functions */
int /*<<< orphan*/ POLLIN;
int poll(struct pollfd *, int, int /*<<< orphan*/);
int socket_can_read(int fd) {
  struct pollfd set;
  set.fd = fd;
  set.events = POLLIN;
  return poll(&set, 1, 0);
}


x86 assembly (clang, -O0):
<socket_can_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <poll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_can_read>:
push   %rax
mov    %edi,(%rsp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <poll@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
define i32 @socket_can_read(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.pollfd
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @POLLIN
%7 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %3, i32 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @poll(%struct.pollfd* %3, i32 1, i32 0)
ret i32 %8
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
define i32 @socket_can_read(i32 %0) {
%2 = alloca %struct.pollfd
%3 = bitcast %struct.pollfd* %2 to i8*
%4 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = load i32, i32* @POLLIN
%6 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %2, i64 0, i32 1
store i32 %5, i32* %6
%7 = call i32 @poll(%struct.pollfd* %2, i32 1, i32 0)
ret i32 %7
}
void test15(const char *s) { __builtin_printf("string is %s\n", s); }


x86 assembly (clang, -O0):
<test15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test15>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"string is %s\0A\00"
define void @test15(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int setreuid(int /*<<< orphan*/, int /*<<< orphan*/);
int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
  int rc;
  rc = setreuid(suid, euid);
  if (rc)
    return (rc);
  return (setreuid(ruid, euid));
}


x86 assembly (clang, -O0):
<setresuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <setreuid@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1144 <setresuid+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <setresuid+0x42>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <setreuid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setresuid>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <setreuid@plt>
test   %eax,%eax
je     1129 <setresuid+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <setreuid@plt>

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

LLVM IR (-O2):
define i32 @setresuid(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @setreuid(i32 %2, i32 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @setreuid(i32 %0, i32 %1)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %4, %3 ]
ret i32 %9
}
void Regfree(void *re) {}


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

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

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

LLVM IR (-O2):
define void @Regfree(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void del_dvec(double *p) {
  free(p);
  p = NULL;
}


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

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

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

LLVM IR (-O2):
define void @del_dvec(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
double gennch(double, double);
void nchi_rndc(int n, double a, double b, double *array) {
  int i;
  for (i = 0; i < n; i++)
    *(array + i) = gennch(a, b);
}


x86 assembly (clang, -O0):
<nchi_rndc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <nchi_rndc+0x56>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <gennch@plt>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1130 <nchi_rndc+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nchi_rndc>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
jle    114f <nchi_rndc+0x3f>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <gennch@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <nchi_rndc+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @nchi_rndc(i32 %0, double %1, double %2, double* nocapture writeonly %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call double @gennch(double %1, double %2)
%11 = getelementptr inbounds double, double* %3, i64 %9
store double %10, double* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *destination, const char *source) {
  strcpy(destination + strlen(destination), source);
  return destination;
}


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

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
extern unsigned long ixp2000_reg_read(volatile void *reg) {
  return *((volatile unsigned long *)reg);
}


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

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

LLVM IR (-O0):
define i64 @ixp2000_reg_read(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @ixp2000_reg_read(i8* %0) {
%2 = bitcast i8* %0 to i64*
%3 = load volatile i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ cast_horz(double, double, int);
int main(int argc, char *argv[]) {
  cast_horz(10.5, 10.5, 280);
  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)
movsd  0xed2(%rip),%xmm1
mov    $0x118,%edi
movaps %xmm1,%xmm0
call   1030 <cast_horz@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x118,%edi
call   1030 <cast_horz@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @cast_horz(double 1.050000e+01, double 1.050000e+01, i32 280)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @cast_horz(double 1.050000e+01, double 1.050000e+01, i32 280)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_read_binary();
int /*<<< orphan*/ test_read_hex();
int /*<<< orphan*/ test_write_binary();
int /*<<< orphan*/ test_write_hex();
int /*<<< orphan*/ test_xor_bytes();
void suite_util(void) {
  printf("Start  suite_util\n");
  test_read_binary();
  test_write_binary();
  test_read_hex();
  test_write_hex();
  test_xor_bytes();
  printf("Finish suite_util\n");
}


x86 assembly (clang, -O0):
<suite_util>:
push   %rbp
mov    %rsp,%rbp
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test_read_binary@plt>
mov    $0x0,%al
call   1080 <test_write_binary@plt>
mov    $0x0,%al
call   1060 <test_read_hex@plt>
mov    $0x0,%al
call   1070 <test_write_hex@plt>
mov    $0x0,%al
call   1030 <test_xor_bytes@plt>
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<suite_util>:
push   %rax
lea    0xe98(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1040 <test_read_binary@plt>
xor    %eax,%eax
call   1080 <test_write_binary@plt>
xor    %eax,%eax
call   1060 <test_read_hex@plt>
xor    %eax,%eax
call   1070 <test_write_hex@plt>
xor    %eax,%eax
call   1030 <test_xor_bytes@plt>
lea    0xe7b(%rip),%rdi
pop    %rax
jmp    1050 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Start suite_util\0A\00"
@.str.1 = [19 x i8] c"Finish suite_util\0A\00"
define void @suite_util() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test_read_binary()
%3 = call i32 (...) @test_write_binary()
%4 = call i32 (...) @test_read_hex()
%5 = call i32 (...) @test_write_hex()
%6 = call i32 (...) @test_xor_bytes()
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Start suite_util\00"
@str.2 = [18 x i8] c"Finish suite_util\00"
define void @suite_util() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_read_binary()
%3 = tail call i32 (...) @test_write_binary()
%4 = tail call i32 (...) @test_read_hex()
%5 = tail call i32 (...) @test_write_hex()
%6 = tail call i32 (...) @test_xor_bytes()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tm {
  int tm_mday;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
int add_days_to_date(struct tm *date, int days) {
  date->tm_mday += days;
  mktime(date);
  return 0;
}


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

x86 assembly (clang, -O2):
<add_days_to_date>:
push   %rax
add    %esi,(%rdi)
call   1030 <mktime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @add_days_to_date(%struct.tm* %0, i32 %1) {
%3 = alloca %struct.tm*
%4 = alloca i32
store %struct.tm* %0, %struct.tm** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load %struct.tm*, %struct.tm** %3
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %5
store i32 %9, i32* %7
%10 = load %struct.tm*, %struct.tm** %3
%11 = call i32 @mktime(%struct.tm* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @add_days_to_date(%struct.tm* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %1
store i32 %5, i32* %3
%6 = tail call i32 @mktime(%struct.tm* %0)
ret i32 0
}
void snd_pcm_timer_init(struct snd_pcm_substream *substream) {}


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

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

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

LLVM IR (-O2):
%struct.snd_pcm_substream = type opaque
define void @snd_pcm_timer_init(%struct.snd_pcm_substream* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int gost_engine_init(ENGINE *e) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @gost_engine_init(i32* nocapture readnone %0) {
ret i32 1
}
int SSP_GetVersion() { return 23; }


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

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

LLVM IR (-O0):
define i32 @SSP_GetVersion() {
ret i32 23
}

LLVM IR (-O2):
define i32 @SSP_GetVersion() {
ret i32 23
}
void f_a(char *a) {}


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

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

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

LLVM IR (-O2):
define void @f_a(i8* nocapture %0) {
ret void
}
double Log(x)
double x;
{ return errcheck(log(x), "log"); }


x86 assembly (clang, -O0):
<Log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <errcheck@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log>:
push   %rax
call   1040 <log@plt>
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <errcheck@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"log\00"
define double @Log(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = call i32 (double, i8*, ...) bitcast (i32 (...)* @errcheck to i32 (double, i8*, ...)*)(double %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"log\00"
define double @Log(double %0) {
%2 = tail call double @log(double %0)
%3 = tail call i32 (double, i8*, ...) bitcast (i32 (...)* @errcheck to i32 (double, i8*, ...)*)(double %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = sitofp i32 %3 to double
ret double %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rol(uint32_t input, int count) {
  return ((input << count) & 0xffffffff) | (input & 0xffffffff) >> (32 - count);
}


x86 assembly (clang, -O0):
<rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
and    $0xffffffff,%eax
mov    -0x4(%rbp),%edx
and    $0xffffffff,%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rol(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = and i32 %7, -1
%9 = load i32, i32* %3
%10 = and i32 %9, -1
%11 = load i32, i32* %4
%12 = sub nsw i32 32, %11
%13 = lshr i32 %10, %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}