xunge/DecIR huggingface dataset:
unsigned int next_power_of_two2(unsigned int n) {
  if (n && !(n & (n - 1))) {
    return n;
  }
  unsigned int count = 0;
  while (n != 0) {
    n >>= 1;
    count++;
  }
  return 1 << count;
}


x86 assembly (clang, -O0):
<next_power_of_two2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <next_power_of_two2+0x30>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1130 <next_power_of_two2+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <next_power_of_two2+0x65>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1158 <next_power_of_two2+0x58>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <next_power_of_two2+0x37>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_two2>:
mov    %edi,%eax
lea    -0x1(%rax),%ecx
test   %ecx,%edi
sete   %cl
test   %edi,%edi
setne  %dl
test   %cl,%dl
jne    1133 <next_power_of_two2+0x33>
xor    %ecx,%ecx
test   %eax,%eax
je     112c <next_power_of_two2+0x2c>
mov    %eax,%edx
nopl   0x0(%rax,%rax,1)
shr    %edx
add    $0x1,%ecx
cmp    $0x1,%eax
mov    %edx,%eax
ja     1120 <next_power_of_two2+0x20>
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @next_power_of_two2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = icmp eq i32 %0, 0
br i1 %5, label %12, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %10, %6 ], [ 0, %4 ]
%8 = phi i32 [ %9, %6 ], [ %0, %4 ]
%9 = lshr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = icmp ult i32 %8, 2
br i1 %11, label %12, label %6
12: ; preds = %6, %4
%13 = phi i32 [ 0, %4 ], [ %10, %6 ]
%14 = shl nuw i32 1, %13
br label %15
15: ; preds = %1, %12
%16 = phi i32 [ %14, %12 ], [ %0, %1 ]
ret i32 %16
}
int mailbox(int x, int y, int z) {
  return (z + 2) * 144 + (y + 2) * 12 + (x + 2);
}


x86 assembly (clang, -O0):
<mailbox>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
imul   $0x90,%eax,%eax
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
imul   $0xc,%ecx,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mailbox>:
lea    (%rdx,%rdx,8),%eax
shl    $0x4,%eax
lea    (%rsi,%rsi,2),%ecx
lea    (%rdi,%rcx,4),%ecx
add    %ecx,%eax
add    $0x13a,%eax
ret

LLVM IR (-O0):
define i32 @mailbox(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* %6
%8 = add nsw i32 %7, 2
%9 = mul nsw i32 %8, 144
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 2
%12 = mul nsw i32 %11, 12
%13 = add nsw i32 %9, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 2
%16 = add nsw i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @mailbox(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %2, 144
%5 = mul i32 %1, 12
%6 = add i32 %0, 314
%7 = add i32 %6, %5
%8 = add i32 %7, %4
ret i32 %8
}
void bernstein2(double dest[3], double t) {
  double s = 1.0 - t;
  dest[0] = s * s;
  dest[1] = 2 * s * t;
  dest[2] = t * t;
}


x86 assembly (clang, -O0):
<bernstein2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  0xef3(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xec7(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bernstein2>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
unpcklpd %xmm2,%xmm3
unpcklpd %xmm0,%xmm1
mulpd  %xmm3,%xmm1
movupd %xmm1,(%rdi)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @bernstein2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
%5 = alloca double
store double* %0, double** %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fsub double 1.000000e+00, %6
store double %7, double* %5
%8 = load double, double* %5
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 0
store double %10, double* %12
%13 = load double, double* %5
%14 = fmul double 2.000000e+00, %13
%15 = load double, double* %4
%16 = fmul double %14, %15
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
%19 = load double, double* %4
%20 = load double, double* %4
%21 = fmul double %19, %20
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 2
store double %21, double* %23
ret void
}

LLVM IR (-O2):
define void @bernstein2(double* nocapture writeonly %0, double %1) {
%3 = fsub double 1.000000e+00, %1
%4 = fmul double %3, 2.000000e+00
%5 = insertelement <2 x double> poison, double %3, i64 0
%6 = insertelement <2 x double> %5, double %4, i64 1
%7 = insertelement <2 x double> poison, double %1, i64 1
%8 = insertelement <2 x double> %7, double %3, i64 0
%9 = fmul <2 x double> %6, %8
%10 = bitcast double* %0 to <2 x double>*
store <2 x double> %9, <2 x double>* %10
%11 = fmul double %1, %1
%12 = getelementptr inbounds double, double* %0, i64 2
store double %11, double* %12
ret void
}
int meaningOfLife(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @meaningOfLife() {
ret i32 42
}

LLVM IR (-O2):
define i32 @meaningOfLife() {
ret i32 42
}
const char *Start_Description(void) {
  return "The `Start` class can be implemented by types which provide an "
         "abstract "
         "notion of a started and stopped state. This can be real processes "
         "such "
         "as `Thread`, or something like `File` where the on/off correspond to "
         "if the file is open or not."
         "\n\n"
         "The main nicety of the `Start` class is that it allows use of the "
         "`with` "
         "macro which performs the `start` function at the opening of a scope "
         "block "
         "and the `stop` function at the end.";
}


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

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

LLVM IR (-O0):
@.str = [424 x i8] c"The `Start` class can be implemented by types which provide an abstract notion of a started and stopped state. This can be real processes such as `Thread`, or something like `File` where the on/off correspond to if the file is open or not.\0A\0AThe main nicety of the `Start` class is that it allows use of the `with` macro which performs the `start` function at the opening of a scope block and the `stop` function at the end.\00"
define i8* @Start_Description() {
ret i8* getelementptr inbounds ([424 x i8], [424 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [424 x i8] c"The `Start` class can be implemented by types which provide an abstract notion of a started and stopped state. This can be real processes such as `Thread`, or something like `File` where the on/off correspond to if the file is open or not.\0A\0AThe main nicety of the `Start` class is that it allows use of the `with` macro which performs the `start` function at the opening of a scope block and the `stop` function at the end.\00"
define i8* @Start_Description() {
ret i8* getelementptr inbounds ([424 x i8], [424 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int listen(int, int);
int xlisten(int sockfd, int backlog) {
  int ret = listen(sockfd, backlog);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xlisten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    113b <xlisten+0x2b>
jmp    113b <xlisten+0x2b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlisten>:
jmp    1030 <listen@plt>

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

LLVM IR (-O2):
define i32 @xlisten(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ bio_info_cb;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
long BIO_callback_ctrl(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_next(int /*<<< orphan*/ *);
long dwrap_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) {
  long ret;
  ret = BIO_callback_ctrl(BIO_next(b), cmd, fp);
  return ret;
}


x86 assembly (clang, -O0):
<dwrap_callback_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <BIO_next@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <BIO_callback_ctrl@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwrap_callback_ctrl>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <BIO_next@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <BIO_callback_ctrl@plt>

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

LLVM IR (-O2):
define i64 @dwrap_callback_ctrl(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @BIO_next(i32* %0)
%5 = tail call i64 @BIO_callback_ctrl(i32 %4, i32 %1, i32* %2)
ret i64 %5
}
/* Variables and functions */
int getpid();
int printpid(void) { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @printpid() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @printpid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
double sem_svf_shape_gain(double);
double sem_svf_shape(double clip_level, double x) {
  return x * sem_svf_shape_gain(x / clip_level);
}


x86 assembly (clang, -O0):
<sem_svf_shape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sem_svf_shape_gain@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_svf_shape>:
push   %rax
movapd %xmm1,%xmm2
movsd  %xmm1,(%rsp)
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
call   1030 <sem_svf_shape_gain@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sem_svf_shape(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = call double @sem_svf_shape_gain(double %8)
%10 = fmul double %5, %9
ret double %10
}

LLVM IR (-O2):
define double @sem_svf_shape(double %0, double %1) {
%3 = fdiv double %1, %0
%4 = tail call double @sem_svf_shape_gain(double %3)
%5 = fmul double %4, %1
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, char, int);
int posix_spawnattr_init(posix_spawnattr_t *attr) {
  memset(attr, '\0', sizeof(*attr));
  return 0;
}


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

x86 assembly (clang, -O2):
<posix_spawnattr_init>:
push   %rax
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @posix_spawnattr_init(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i8 signext 0, i32 4)
ret i32 0
}
OP(ed, cc) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void Sum(int a, int b) {
  int sum = a + b;
  printf("Sum = %d", sum);
}


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

x86 assembly (clang, -O2):
<Sum>:
add    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"Sum = %d\00"
define void @Sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int d(int e) {
  struct {
    int f;
  } g = {1};
  int h;
  g = (typeof(g)){2};
}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    0xef3(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32 }
@__const.d.g = %struct.anon { i32 1 }
define i32 @d(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.anon
%5 = alloca i32
%6 = alloca %struct.anon
store i32 %0, i32* %3
%7 = bitcast %struct.anon* %4 to i8*
%8 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
store i32 2, i32* %8
%9 = bitcast %struct.anon* %4 to i8*
%10 = bitcast %struct.anon* %6 to i8*
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @d(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigpipeHandler(int s) {
  (void)s;
  (void)printf("got a sigpipe\n");
  cleanup();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sigpipeHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigpipeHandler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"got a sigpipe\0A\00"
@EXIT_FAILURE = global i32 0
define void @sigpipeHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @cleanup()
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [14 x i8] c"got a sigpipe\00"
define void @sigpipeHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @cleanup()
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void d2i_NETSCAPE_SPKI(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_NETSCAPE_SPKI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GpioPinMuxSetup(int, int);
void eqep_2_pinmux_setup(void) {
  GpioPinMuxSetup((0x08b0), (0x00000040 | 0x00000020 | 0x00000008 | (3)));
  GpioPinMuxSetup((0x08b4), (0x00000040 | 0x00000020 | 0x00000008 | (3)));
  GpioPinMuxSetup((0x08b8), (0x00000040 | 0x00000020 | 0x00000008 | (3)));
  GpioPinMuxSetup((0x08bc), (0x00000040 | 0x00000020 | 0x00000008 | (3)));
}


x86 assembly (clang, -O0):
<eqep_2_pinmux_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8b0,%edi
mov    $0x6b,%esi
call   1030 <GpioPinMuxSetup@plt>
mov    $0x8b4,%edi
mov    $0x6b,%esi
call   1030 <GpioPinMuxSetup@plt>
mov    $0x8b8,%edi
mov    $0x6b,%esi
call   1030 <GpioPinMuxSetup@plt>
mov    $0x8bc,%edi
mov    $0x6b,%esi
call   1030 <GpioPinMuxSetup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eqep_2_pinmux_setup>:
push   %rax
mov    $0x8b0,%edi
mov    $0x6b,%esi
call   1030 <GpioPinMuxSetup@plt>
mov    $0x8b4,%edi
mov    $0x6b,%esi
call   1030 <GpioPinMuxSetup@plt>
mov    $0x8b8,%edi
mov    $0x6b,%esi
call   1030 <GpioPinMuxSetup@plt>
mov    $0x8bc,%edi
mov    $0x6b,%esi
pop    %rax
jmp    1030 <GpioPinMuxSetup@plt>

LLVM IR (-O0):
define void @eqep_2_pinmux_setup() {
%1 = call i32 @GpioPinMuxSetup(i32 2224, i32 107)
%2 = call i32 @GpioPinMuxSetup(i32 2228, i32 107)
%3 = call i32 @GpioPinMuxSetup(i32 2232, i32 107)
%4 = call i32 @GpioPinMuxSetup(i32 2236, i32 107)
ret void
}

LLVM IR (-O2):
define void @eqep_2_pinmux_setup() {
%1 = tail call i32 @GpioPinMuxSetup(i32 2224, i32 107)
%2 = tail call i32 @GpioPinMuxSetup(i32 2228, i32 107)
%3 = tail call i32 @GpioPinMuxSetup(i32 2232, i32 107)
%4 = tail call i32 @GpioPinMuxSetup(i32 2236, i32 107)
ret void
}
int abs_and_sign(int *x) {
  if (*x > 0)
    return 0;
  *x *= -1;
  return 1;
}


x86 assembly (clang, -O0):
<abs_and_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1121 <abs_and_sign+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1131 <abs_and_sign+0x31>
mov    -0x10(%rbp),%rax
imul   $0xffffffff,(%rax),%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_and_sign>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   %ecx,%ecx
jle    1109 <abs_and_sign+0x9>
ret
neg    %ecx
mov    %ecx,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @abs_and_sign(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = sub nsw i32 0, %2
store i32 %5, i32* %0
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x90() {
  Assert_real((isxdigit(144) == 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_isxdigit.c",
              725, ("isxdigit should be 0 for 0x90"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x90>:
push   %rax
mov    $0x90,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2d5,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x90\00"
define void @t_isxdigit_0x90() {
%1 = call i64 @isxdigit(i32 144)
%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 725, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x90\00"
define void @t_isxdigit_0x90() {
%1 = tail call i64 @isxdigit(i32 144)
%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 725, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sd_locker_state_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void sd_locker_lock_announce(const struct sd_locker_state_t *state,
                             const char *message) {
  assert(state != NULL);
  assert(message != NULL);
}


x86 assembly (clang, -O0):
<sd_locker_lock_announce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_locker_lock_announce>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.sd_locker_state_t = type { i32 }
define void @sd_locker_lock_announce(%struct.sd_locker_state_t* %0, i8* %1) {
%3 = alloca %struct.sd_locker_state_t*
%4 = alloca i8*
store %struct.sd_locker_state_t* %0, %struct.sd_locker_state_t** %3
store i8* %1, i8** %4
%5 = load %struct.sd_locker_state_t*, %struct.sd_locker_state_t** %3
%6 = icmp ne %struct.sd_locker_state_t* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
%struct.sd_locker_state_t = type { i32 }
define void @sd_locker_lock_announce(%struct.sd_locker_state_t* readnone %0, i8* readnone %1) {
%3 = icmp ne %struct.sd_locker_state_t* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int getRand() {
  srand(time(NULL));
  return rand() % 1000;
}


x86 assembly (clang, -O0):
<getRand>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRand>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getRand() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 1000
ret i32 %4
}

LLVM IR (-O2):
define i32 @getRand() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 1000
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_metafont_comment_entities();
int /*<<< orphan*/ test_metafont_comments();
void all_metafont_tests() {
  test_metafont_comments();
  test_metafont_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_metafont_tests() {
%1 = call i32 (...) @test_metafont_comments()
%2 = call i32 (...) @test_metafont_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_metafont_tests() {
%1 = tail call i32 (...) @test_metafont_comments()
%2 = tail call i32 (...) @test_metafont_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_addDiv() { CALC_appendString("/"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @CALC_addDiv() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ breakpoint3();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ printf(char *, int);
int /*<<< orphan*/ stdout;
int main(void) {
  int ret = 42;
  breakpoint3();
  while (1) {
    ret += printf("hello world: %d\n", ret);
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    $0x0,%al
call   1040 <breakpoint3@plt>
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <breakpoint3@plt>
mov    $0x2a,%ebp
lea    0xeb6(%rip),%r14
mov    0x2e8f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %rax,%rbx
add    %ebp,%ebx
mov    (%r15),%edi
call   1050 <fflush@plt>
mov    %ebx,%ebp
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [17 x i8] c"hello world: %d\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
%3 = call i32 (...) @breakpoint3()
br label %4
4: ; preds = %0, %4
%5 = load i32, i32* %2
%6 = call i64 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = add nsw i64 %8, %6
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
br label %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"hello world: %d\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @breakpoint3()
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 42, %0 ], [ %6, %2 ]
%4 = tail call i64 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %3, %5
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
br label %2
}
void gtk_rc_get_im_module_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_get_im_module_path() {
ret void
}
unsigned char bcd2bin(unsigned char x) {
  return (((x)&0x0f) + ((x) >> 4) * 10);
}


x86 assembly (clang, -O0):
<bcd2bin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x4,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd2bin>:
mov    %edi,%ecx
and    $0xf,%cl
shr    $0x4,%dil
movzbl %dil,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @bcd2bin(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = ashr i32 %7, 4
%9 = mul nsw i32 %8, 10
%10 = add nsw i32 %5, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @bcd2bin(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = lshr i8 %0, 4
%4 = mul nuw i8 %3, 10
%5 = add nuw i8 %4, %2
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *malloc(unsigned int);
void *allocateMemory(unsigned int size) {
  void *p;
  p = malloc(size);
  if (p == NULL) {
    error("out of memory");
  }
  return p;
}


x86 assembly (clang, -O0):
<allocateMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <allocateMemory+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateMemory>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <allocateMemory+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @allocateMemory(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @allocateMemory(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
unsigned int fib(unsigned int);
void setFib(unsigned result[], unsigned elements) {
  unsigned i = 0;
  for (i; i < elements; ++i)
    result[i] = fib(i);
}


x86 assembly (clang, -O0):
<setFib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1154 <setFib+0x44>
mov    -0x10(%rbp),%edi
call   1030 <fib@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <setFib+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setFib>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1144 <setFib+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <fib@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <setFib+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @setFib(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = trunc i64 %7 to i32
%9 = tail call i32 @fib(i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap) {
  int r = vsnprintf(buf, buflen, format, ap);
  buf[buflen - 1] = '\0';
  return r;
}


x86 assembly (clang, -O0):
<evutil_vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evutil_vsnprintf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <vsnprintf@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @evutil_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @vsnprintf(i8* %10, i64 %11, i8* %12, i32 %13)
store i32 %14, i32* %9
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = sub i64 %16, 1
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @evutil_vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = add i64 %1, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void writelines(char *lineptr[], int nlines) {
  int i;
  for (i = 0; i < nlines; i++)
    printf("%s\n", lineptr[i]);
}


x86 assembly (clang, -O0):
<writelines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <writelines+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <writelines+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelines>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <writelines+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <writelines+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ block128_f;
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
scalar_t__ AES_encrypt;
int /*<<< orphan*/ CRYPTO_cfb128_8_encrypt(unsigned char const *,
                                           unsigned char *, size_t,
                                           int /*<<< orphan*/ const *,
                                           unsigned char *, int *, int const,
                                           int /*<<< orphan*/);
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
                      size_t length, const AES_KEY *key, unsigned char *ivec,
                      int *num, const int enc) {
  CRYPTO_cfb128_8_encrypt(in, out, length, key, ivec, num, enc,
                          (block128_f)AES_encrypt);
}


x86 assembly (clang, -O0):
<AES_cfb8_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10d
mov    0x2e92(%rip),%rax
mov    (%rax),%rax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <CRYPTO_cfb128_8_encrypt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_cfb8_encrypt>:
push   %rax
mov    0x10(%rsp),%r10d
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
push   %rax
push   %r10
call   1030 <CRYPTO_cfb128_8_encrypt@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@AES_encrypt = global i64 0
define void @AES_cfb8_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32* %3, i32** %11
store i8* %4, i8** %12
store i32* %5, i32** %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = load i32*, i32** %11
%19 = load i8*, i8** %12
%20 = load i32*, i32** %13
%21 = load i32, i32* %14
%22 = load i64, i64* @AES_encrypt
%23 = trunc i64 %22 to i32
%24 = call i32 @CRYPTO_cfb128_8_encrypt(i8* %15, i8* %16, i64 %17, i32* %18, i8* %19, i32* %20, i32 %21, i32 %23)
ret void
}

LLVM IR (-O2):
@AES_encrypt = global i64 0
define void @AES_cfb8_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %6) {
%8 = load i64, i64* @AES_encrypt
%9 = trunc i64 %8 to i32
%10 = tail call i32 @CRYPTO_cfb128_8_encrypt(i8* %0, i8* %1, i64 %2, i32* %3, i8* %4, i32* %5, i32 %6, i32 %9)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void SHAMD5DMADisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000110))) &=
      ~(0x00000080 | 0x00000008);
}


x86 assembly (clang, -O0):
<SHAMD5DMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x110(%rax),%rcx
and    $0xffffffffffffff77,%rcx
mov    %rcx,0x110(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5DMADisable>:
andq   $0xffffffffffffff77,0x110(%rdi)
77 ff ff ff
ret

LLVM IR (-O0):
define void @SHAMD5DMADisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 272
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -137
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @SHAMD5DMADisable(i64 %0) {
%2 = add nsw i64 %0, 272
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -137
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void Toolbox_Delay(void) {
  puts("WARNING: Need to port Toolbox_Delay() to this OS!!!");
  return;
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"WARNING: Need to port Toolbox_Delay() to this OS!!!\00"
define void @Toolbox_Delay() {
%1 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"WARNING: Need to port Toolbox_Delay() to this OS!!!\00"
define void @Toolbox_Delay() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
int f3(void) {
  unsigned char a = 128;
  return (a & 0x80) ? 0x380 : 0;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movb   $0x80,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x80,%edx
xor    %eax,%eax
mov    $0x380,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f3() {
%1 = alloca i8
store i8 -128, i8* %1
%2 = load i8, i8* %1
%3 = zext i8 %2 to i32
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 896, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @f3() {
ret i32 896
}
/* Variables and functions */
int /*<<< orphan*/ errnoexit(char *);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int say(int socket, char *s) {
  int result = send(socket, s, strlen(s), 0);
  if (result == -1)
    errnoexit("Error talking to the client");
  return result;
}


x86 assembly (clang, -O0):
<say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    117f <say+0x4f>
lea    0xe86(%rip),%rdi
call   1050 <errnoexit@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1161 <say+0x31>
lea    0xea4(%rip),%rdi
call   1050 <errnoexit@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Error talking to the client\00"
define i32 @say(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @send(i32 %6, i8* %7, i32 %9, i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @errnoexit(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error talking to the client\00"
define i32 @say(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @errnoexit(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 %4
}