xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ccuConfigureSlice(int /*<<< orphan*/, int, int, int, int,
                                     int, int /*<<< orphan*/, int, int,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ ccuEnableSlices(int);
int ccuEvent0(int, int, int, int);
int ccuEvent1(int, int, int, int);
unsigned int ccuConfigureCaptureERUChannel0(void) {
  ccuConfigureSlice(0,
                    ccuEvent0(0x0009, 0x01, 0x00, (0x00)) |
                        ccuEvent1(0x0009, 0x02, 0x00, (0x01)),
                    (0x01 << 0) | (0x02 << 4),
                    (1 << 1) | (0x01 << 3) | (1 << 10) | 0x00, 0x0d, 4883, 0,
                    (1 << 8) | (1 << 9) | (1 << 0),
                    (0x00 << 8) | (0x00 << 10) | (0x00 << 0), 0);
  ccuEnableSlices((1 << 0));
  return 0;
}


x86 assembly (clang, -O0):
<ccuConfigureCaptureERUChannel0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x9,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1060 <ccuEvent0@plt>
mov    %eax,-0x4(%rbp)
mov    $0x9,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <ccuEvent1@plt>
mov    -0x4(%rbp),%esi
or     %eax,%esi
xor    %edi,%edi
mov    $0x21,%edx
mov    $0x40a,%ecx
mov    $0xd,%r8d
mov    $0x1313,%r9d
movl   $0x0,(%rsp)
movl   $0x301,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1050 <ccuConfigureSlice@plt>
mov    $0x1,%edi
call   1030 <ccuEnableSlices@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccuConfigureCaptureERUChannel0>:
push   %rbx
mov    $0x9,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <ccuEvent0@plt>
mov    %eax,%ebx
mov    $0x9,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <ccuEvent1@plt>
or     %eax,%ebx
xor    %edi,%edi
mov    %ebx,%esi
mov    $0x21,%edx
mov    $0x40a,%ecx
mov    $0xd,%r8d
mov    $0x1313,%r9d
push   $0x0
push   $0x0
push   $0x301
push   $0x0
call   1050 <ccuConfigureSlice@plt>
add    $0x20,%rsp
mov    $0x1,%edi
call   1030 <ccuEnableSlices@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ccuConfigureCaptureERUChannel0() {
%1 = call i32 @ccuEvent0(i32 9, i32 1, i32 0, i32 0)
%2 = call i32 @ccuEvent1(i32 9, i32 2, i32 0, i32 1)
%3 = or i32 %1, %2
%4 = call i32 @ccuConfigureSlice(i32 0, i32 %3, i32 33, i32 1034, i32 13, i32 4883, i32 0, i32 769, i32 0, i32 0)
%5 = call i32 @ccuEnableSlices(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @ccuConfigureCaptureERUChannel0() {
%1 = tail call i32 @ccuEvent0(i32 9, i32 1, i32 0, i32 0)
%2 = tail call i32 @ccuEvent1(i32 9, i32 2, i32 0, i32 1)
%3 = or i32 %2, %1
%4 = tail call i32 @ccuConfigureSlice(i32 0, i32 %3, i32 33, i32 1034, i32 13, i32 4883, i32 0, i32 769, i32 0, i32 0)
%5 = tail call i32 @ccuEnableSlices(i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int UINT64_C(int);
int issignaling_d(double x) {
  union {
    double d;
    uint64_t u;
  } u = {.d = x};
  return (
      ((u.u & UINT64_C(0x7fffffffffffffff)) > UINT64_C(0x7ff0000000000000)) &&
      (u.u & UINT64_C(0x8000000000000)) == 0);
}


x86 assembly (clang, -O0):
<issignaling_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0xffffffff,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <UINT64_C@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jle    1177 <issignaling_d+0x67>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
xor    %edi,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issignaling_d>:
push   %rbp
push   %r14
push   %rbx
movq   %xmm0,%r14
mov    $0xffffffff,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ebp
and    %r14d,%ebp
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <UINT64_C@plt>
cmp    %eax,%ebp
jle    1144 <issignaling_d+0x34>
xor    %edi,%edi
call   1030 <UINT64_C@plt>
xor    %ebx,%ebx
test   %r14d,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @issignaling_d(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = bitcast %union.anon* %3 to double*
%5 = load double, double* %2
store double %5, double* %4
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = call i32 @UINT64_C(i32 -1)
%9 = and i32 %7, %8
%10 = call i32 @UINT64_C(i32 0)
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %1
%13 = bitcast %union.anon* %3 to i32*
%14 = load i32, i32* %13
%15 = call i32 @UINT64_C(i32 0)
%16 = and i32 %14, %15
%17 = icmp eq i32 %16, 0
br label %18
18: ; preds = %12, %1
%19 = phi i1 [ false, %1 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @issignaling_d(double %0) {
%2 = bitcast double %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @UINT64_C(i32 -1)
%5 = and i32 %4, %3
%6 = tail call i32 @UINT64_C(i32 0)
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call i32 @UINT64_C(i32 0)
%10 = and i32 %9, %3
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %1
%14 = phi i32 [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main();
void _start(void) {
  int retval = main();
  exit(retval);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <main@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @_start() {
%1 = alloca i32
%2 = call i32 (...) @main()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @main()
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int);
uint32_t platform_random(uint32_t max) {
  uint32_t seed = *((volatile uint32_t *)0xe000e018);
  srand(seed);
  return rand() % max;
}


x86 assembly (clang, -O0):
<platform_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xe000e018,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_random>:
push   %rbx
mov    %edi,%ebx
mov    $0xe000e018,%eax
mov    (%rax),%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @platform_random(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 3758153752 to i32*)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @rand()
%8 = load i32, i32* %2
%9 = srem i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @platform_random(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 3758153752 to i32*)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int8_t;

/* Variables and functions */
uint8_t nrf_802154_ccaedthres_from_dbm_calculate(int8_t dbm) {
  return dbm - (-94);
}


x86 assembly (clang, -O0):
<nrf_802154_ccaedthres_from_dbm_calculate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0xffffffffffffffa2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_802154_ccaedthres_from_dbm_calculate>:
lea    0x5e(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @nrf_802154_ccaedthres_from_dbm_calculate(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, -94
ret i64 %4
}

LLVM IR (-O2):
define i64 @nrf_802154_ccaedthres_from_dbm_calculate(i64 %0) {
%2 = add nsw i64 %0, 94
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void CountDown(int start) {
  printf("%d \n", start);
  if (start > 1)
    CountDown(start - 1);
}


x86 assembly (clang, -O0):
<CountDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jle    114f <CountDown+0x2f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <CountDown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountDown>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jg     1120 <CountDown+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define void @CountDown(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp sgt i32 %3, 1
%6 = add nsw i32 %3, -1
br i1 %5, label %2, label %7
7: ; preds = %2
ret void
}
/* Variables and functions */
double sin(double);
double futhark_sin64(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<futhark_sin64>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @futhark_sin64(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int get_mdterm();
void md_draw_line(int x1, int y1, int x2, int y2, int width) {
  switch (get_mdterm()) {}
}


x86 assembly (clang, -O0):
<md_draw_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
call   1030 <get_mdterm@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @md_draw_line(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 (...) @get_mdterm()
switch i32 %11, label %12 [
]
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @md_draw_line(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @get_mdterm()
ret void
}
int arith_div(int x, int y) {
  if (-13 / 5 == -2 && (x < 0) != (y < 0) && x % y != 0)
    return x / y - 1;
  else
    return x / y;
}


x86 assembly (clang, -O0):
<arith_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0xc(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     114d <arith_div+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     114d <arith_div+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <arith_div+0x57>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_div>:
mov    %esi,%eax
xor    %edi,%eax
js     110c <arith_div+0xc>
mov    %edi,%eax
cltd
idiv   %esi
ret
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1106 <arith_div+0x6>
mov    %edi,%eax
cltd
idiv   %esi
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @arith_div(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = srem i32 %0, %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = sdiv i32 %0, %1
%10 = add nsw i32 %9, -1
br label %13
11: ; preds = %5, %2
%12 = sdiv i32 %0, %1
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ cgau6(double *, int, double *, double *, int, int);
void cgau6_packet(double *x, int sigInLength, double *f, int sigOutLength,
                  double ys) {
  cgau6(x, sigInLength, f, f + sigInLength, sigOutLength, 1);
  return;
}


x86 assembly (clang, -O0):
<cgau6_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <cgau6@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgau6_packet>:
mov    %ecx,%r8d
movslq %esi,%rsi
lea    (%rdx,%rsi,8),%rcx
mov    $0x1,%r9d
jmp    1030 <cgau6@plt>

LLVM IR (-O0):
define void @cgau6_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load double*, double** %8
%14 = load double*, double** %8
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = load i32, i32* %9
%19 = call i32 @cgau6(double* %11, i32 %12, double* %13, double* %17, i32 %18, i32 1)
ret void
}

LLVM IR (-O2):
define void @cgau6_packet(double* %0, i32 %1, double* %2, i32 %3, double %4) {
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %2, i64 %6
%8 = tail call i32 @cgau6(double* %0, i32 %1, double* %2, double* %7, i32 %3, i32 1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t srl(int32_t reg1, uint8_t desloc) { return (reg1 >> desloc); }


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

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

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

LLVM IR (-O2):
define i32 @srl(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  {
    state[0UL] = (input[0UL] + 51238316UL) + 274866410U;
    if ((state[0UL] >> 4U) & 1U) {
      state[0UL] += state[0UL];
    }
    output[0UL] = (state[0UL] + 515147141UL) + 709125895U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x30dd5ac,%rax
add    $0x106220ea,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113c <RandomFunc+0x3c>
mov    -0x14(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1eb48585,%rax
add    $0x2a446707,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x136ff696,%eax
add    (%rdi),%eax
mov    %eax,%ecx
shr    $0x4,%cl
and    $0x1,%cl
shl    %cl,%eax
add    $0x48f8ec8c,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 326104726
%5 = lshr i32 %4, 4
%6 = and i32 %5, 1
%7 = shl i32 %4, %6
%8 = add i32 %7, 1224273036
store i32 %8, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exit_with_help() {
  printf("Usage: svm-predict [options] test_file model_file output_file\n"
         "options:\n"
         "-b probability_estimates: whether to predict probability estimates, "
         "0 or 1 (default 0); for one-class SVM only 0 is supported\n");
  exit(1);
}


x86 assembly (clang, -O0):
<exit_with_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [198 x i8] c"Usage: svm-predict [options] test_file model_file output_file\0Aoptions:\0A-b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); for one-class SVM only 0 is supported\0A\00"
define void @exit_with_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([198 x i8], [198 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [197 x i8] c"Usage: svm-predict [options] test_file model_file output_file\0Aoptions:\0A-b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); for one-class SVM only 0 is supported\00"
define void @exit_with_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([197 x i8], [197 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void vTaskDelay(uint32_t delay) { return; }


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

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

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

LLVM IR (-O2):
define void @vTaskDelay(i32 %0) {
ret void
}
int os_log_shim_with_va_list() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @os_log_shim_with_va_list() {
ret i32 0
}
/* Variables and functions */
unsigned long bb_strtoull(char const *, char **, int);
__attribute__((always_)) unsigned long bb_strtoul(const char *arg, char **endp,
                                                  int base) {
  return bb_strtoull(arg, endp, base);
}


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

x86 assembly (clang, -O2):
<bb_strtoul>:
jmp    1030 <bb_strtoull@plt>

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

LLVM IR (-O2):
define i64 @bb_strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @bb_strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Sigismund will be 75 years old in /n", 1952 + 75);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Sigismund will be 75 years old in /n\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 2027)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Sigismund will be 75 years old in /n\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 2027)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xc1() {
  Assert_real((iscntrl(193) == 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_iscntrl.c",
              970, ("iscntrl should be 0 for 0xc1"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xc1>:
push   %rax
mov    $0xc1,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ca,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xc1\00"
define void @t_iscntrl_0xc1() {
%1 = call i64 @iscntrl(i32 193)
%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 970, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xc1\00"
define void @t_iscntrl_0xc1() {
%1 = tail call i64 @iscntrl(i32 193)
%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 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ bdopen(char *, int);
int /*<<< orphan*/ exit(int);
int fd_open(char *name, int addflags) {
  if (bdopen(name, addflags) < 0)
    exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<fd_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <bdopen@plt>
cmp    $0x0,%rax
jge    114f <fd_open+0x2f>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_open>:
push   %rax
call   1030 <bdopen@plt>
test   %rax,%rax
js     112f <fd_open+0xf>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @fd_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @bdopen(i8* %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @fd_open(i8* %0, i32 %1) {
%3 = tail call i64 @bdopen(i8* %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret i32 0
}
int comp(const void *i, const void *j) { return *(int *)i - *(int *)j; }


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

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

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int i_dnnt(double *);
int intr_wrap_408(double p1) { return i_dnnt(&p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_408>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <i_dnnt@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_408(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @i_dnnt(double* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @intr_wrap_408(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @i_dnnt(double* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cursorhide(void) {
  printf("\x1b["
         "?25l");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
define void @cursorhide() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @cursorhide() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int symlink(char *, char *);
int create_symlink_for_commands() {
  int flag = symlink(
      "../CurrentJDK/Contents/Home/bin",
      "/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands");
  return flag;
}


x86 assembly (clang, -O0):
<create_symlink_for_commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xefa(%rip),%rsi
call   1030 <symlink@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_symlink_for_commands>:
lea    0xee9(%rip),%rdi
lea    0xf02(%rip),%rsi
jmp    1030 <symlink@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"../CurrentJDK/Contents/Home/bin\00"
@.str.1 = [70 x i8] c"/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands\00"
define i32 @create_symlink_for_commands() {
%1 = alloca i32
%2 = call i32 @symlink(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [32 x i8] c"../CurrentJDK/Contents/Home/bin\00"
@.str.1 = [70 x i8] c"/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands\00"
define i32 @create_symlink_for_commands() {
%1 = tail call i32 @symlink(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ wrtsac0(char const *, float, int, float, float,
                           float const *);
void wrtsac0_(const char *name, float dt, int ns, float b0, float dist,
              const float *ar) {
  wrtsac0(name, dt, ns, b0, dist, ar);
}


x86 assembly (clang, -O0):
<wrtsac0_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  %xmm2,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    -0x10(%rbp),%esi
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdx
call   1030 <wrtsac0@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrtsac0_>:
jmp    1030 <wrtsac0@plt>

LLVM IR (-O0):
define void @wrtsac0_(i8* %0, float %1, i32 %2, float %3, float %4, float* %5) {
%7 = alloca i8*
%8 = alloca float
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float*
store i8* %0, i8** %7
store float %1, float* %8
store i32 %2, i32* %9
store float %3, float* %10
store float %4, float* %11
store float* %5, float** %12
%13 = load i8*, i8** %7
%14 = load float, float* %8
%15 = load i32, i32* %9
%16 = load float, float* %10
%17 = load float, float* %11
%18 = load float*, float** %12
%19 = call i32 @wrtsac0(i8* %13, float %14, i32 %15, float %16, float %17, float* %18)
ret void
}

LLVM IR (-O2):
define void @wrtsac0_(i8* %0, float %1, i32 %2, float %3, float %4, float* %5) {
%7 = tail call i32 @wrtsac0(i8* %0, float %1, i32 %2, float %3, float %4, float* %5)
ret void
}
int process_header(struct httpparser *hp, const char *name, const char *value) {
  return 0;
}


x86 assembly (clang, -O0):
<process_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.httpparser = type opaque
define i32 @process_header(%struct.httpparser* %0, i8* %1, i8* %2) {
%4 = alloca %struct.httpparser*
%5 = alloca i8*
%6 = alloca i8*
store %struct.httpparser* %0, %struct.httpparser** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.httpparser = type opaque
define i32 @process_header(%struct.httpparser* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ unfixed_code();
int main() {
  printf("Before non-validating instruction\n");
  fflush(stdout);
  unfixed_code();
  printf("After non-validating instruction\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <unfixed_code@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <unfixed_code@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Before non-validating instruction\0A\00"
@stdout = global i32 0
@.str.1 = [34 x i8] c"After non-validating instruction\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i32 (...) @unfixed_code()
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [34 x i8] c"Before non-validating instruction\00"
@str.2 = [33 x i8] c"After non-validating instruction\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @unfixed_code()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
char *strncat(char *, char const *, int /*<<< orphan*/);
char *strcat(char *destination, const char *source) {
  return strncat(destination, source, strlen(source));
}


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,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @strncat(i8* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @strncat(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
int main(void) {
  char string[] = {"Teste da Minha String 10"};
  int valor = 0;
  valor = strToNum(string);
  printf("Há Esse numero na minha string: %d \n", valor);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <strToNum@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xede(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <strToNum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.string = [25 x i8] c"Teste da Minha String 10\00"
@.str = [38 x i8] c"H\C3\A1 Esse numero na minha string: %d \0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = alloca i32
%3 = bitcast [25 x i8]* %1 to i8*
store i32 0, i32* %2
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @strToNum to i32 (i8*, ...)*)(i8* %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [25 x i8] c"Teste da Minha String 10\00"
@.str = [38 x i8] c"H\C3\A1 Esse numero na minha string: %d \0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @strToNum to i32 (i8*, ...)*)(i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ui();
int main(void) {
  ui();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ui()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_rnd_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_set_str(int /*<<< orphan*/, char *, int, int);
void mpfrsetstr(mpfr_t r1, char *chr1, mpfr_rnd_t *irnd) {
  int n1;
  n1 = *irnd;
  mpfr_set_str(r1, chr1, 10, n1);
}


x86 assembly (clang, -O0):
<mpfrsetstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
mov    $0xa,%edx
call   1030 <mpfr_set_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfrsetstr>:
mov    (%rdx),%ecx
mov    $0xa,%edx
jmp    1030 <mpfr_set_str@plt>

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

LLVM IR (-O2):
define void @mpfrsetstr(i32 %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = tail call i32 @mpfr_set_str(i32 %0, i8* %1, i32 10, i32 %4)
ret void
}
void fun(void) {
  int decl1;
  int decl2;
  switch (decl2) {
  case 1:
  case 'a':
  default:
    decl1 = 12;
  }
  do {
    for (;;)
      if (0)
        if (0)
          if (0)
            if (0)
              if (0)
                if (0)
                  if (0)
                    if (0)
                      if (0)
                        if (0)
                          1;
  } while (0);
  if (0)
    if (0)
      if (0)
        if (0)
          if (0)
            if (0)
              if (0)
                if (0)
                  if (0)
                    if (0)
                      1;
  if (0)
    if (0)
      1;
    else
      while (1)
        2;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1129 <fun+0x29>
jmp    1118 <fun+0x18>
mov    -0xc(%rbp),%eax
sub    $0x61,%eax
jne    112e <fun+0x2e>
jmp    1129 <fun+0x29>
jmp    112e <fun+0x2e>
movl   $0xc,-0x4(%rbp)
jmp    113a <fun+0x3a>
jmp    113f <fun+0x3f>
jmp    113f <fun+0x3f>

x86 assembly (clang, -O2):
<fun>:
jmp    1100 <fun>

LLVM IR (-O0):
define void @fun() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 1, label %4
i32 97, label %4
]
4: ; preds = %0, %0
br label %5
5: ; preds = %0, %4
store i32 12, i32* %1
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
br label %8
8: ; preds = %8, %7
br label %8
9: ; No predecessors!
ret void
}

LLVM IR (-O2):
define void @fun() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_DAEMON;
int LOG_PID;
int /*<<< orphan*/ openlog(char const *, int, int /*<<< orphan*/);
void logging_init(const char *program_name) {
  openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON);
}


x86 assembly (clang, -O0):
<logging_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logging_init>:
mov    0x2ec1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_DAEMON = global i32 0
define void @logging_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_CONS
%6 = or i32 %4, %5
%7 = load i32, i32* @LOG_DAEMON
%8 = call i32 @openlog(i8* %3, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_DAEMON = global i32 0
define void @logging_init(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_CONS
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_DAEMON
%6 = tail call i32 @openlog(i8* %0, i32 %4, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ displayWritePixels(char *);
int setup();
int /*<<< orphan*/ setupDisplay();
int main(int argc, char *argv[]) {
  int fd;
  uint8_t buffer[2];
  fd = setup();
  setupDisplay();
  displayWritePixels(argv[1]);
  close(fd);
  return (0);
}


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   1060 <setup@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <setupDisplay@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <displayWritePixels@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %eax,%eax
call   1060 <setup@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <setupDisplay@plt>
mov    0x8(%rbx),%rdi
call   1030 <displayWritePixels@plt>
mov    %ebp,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @setup()
store i32 %8, i32* %6
%9 = call i32 (...) @setupDisplay()
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @displayWritePixels(i8* %12)
%14 = load i32, i32* %6
%15 = call i32 @close(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @setup()
%4 = tail call i32 (...) @setupDisplay()
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @displayWritePixels(i8* %6)
%8 = tail call i32 @close(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatorial(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Digite o numero que deseja saber o fatorial : ");
  scanf("%d", &n);
  fatorial(n);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fatorial@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Digite o numero que deseja saber o fatorial : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fatorial(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"Digite o numero que deseja saber o fatorial : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fatorial(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ system(char *);
void escape() {
  puts("Welcome. Escape to a shell...");
  system("/bin/sh");
}


x86 assembly (clang, -O0):
<escape>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1040 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Welcome. Escape to a shell...\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @escape() {
%1 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Welcome. Escape to a shell...\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @escape() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}