xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ TIOCMGET;
int TIOCM_DSR;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int scdsr(int fd) {
  int i;
  if (fd < 0 || ioctl(fd, TIOCMGET, &i) < 0)
    return 0;
  return ((i & TIOCM_DSR) ? 1 : 0);
}


x86 assembly (clang, -O0):
<scdsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1144 <scdsr+0x34>
mov    -0x8(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1150 <scdsr+0x40>
movl   $0x0,-0x4(%rbp)
jmp    116c <scdsr+0x5c>
mov    -0xc(%rbp),%edx
mov    0x2e8e(%rip),%rax
and    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scdsr>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
test   %edi,%edi
js     1145 <scdsr+0x35>
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
call   1030 <ioctl@plt>
test   %rax,%rax
js     1145 <scdsr+0x35>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
xor    %ebx,%ebx
test   %eax,0xc(%rsp)
setne  %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@TIOCMGET = global i32 0
@TIOCM_DSR = global i32 0
define i32 @scdsr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = load i32, i32* @TIOCMGET
%10 = call i64 @ioctl(i32 %8, i32 %9, i32* %4)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %20
13: ; preds = %7
%14 = load i32, i32* %4
%15 = load i32, i32* @TIOCM_DSR
%16 = and i32 %14, %15
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
store i32 %19, i32* %2
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@TIOCMGET = global i32 0
@TIOCM_DSR = global i32 0
define i32 @scdsr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp slt i32 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = load i32, i32* @TIOCMGET
%7 = call i64 @ioctl(i32 %0, i32 %6, i32* %2)
%8 = icmp slt i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* @TIOCM_DSR
%12 = and i32 %11, %10
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %1, %5, %9
%16 = phi i32 [ %14, %9 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_divexact(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_sub_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
void dlog_s(mpz_t n, mpz_t rop, mpz_t op) {
  mpz_sub_ui(rop, op, 1);
  mpz_divexact(rop, rop, n);
  mpz_mod(rop, rop, n);
}


x86 assembly (clang, -O0):
<dlog_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <mpz_sub_ui@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1040 <mpz_divexact@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1050 <mpz_mod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlog_s>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    %edx,%esi
mov    $0x1,%edx
call   1030 <mpz_sub_ui@plt>
mov    %ebx,%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <mpz_divexact@plt>
mov    %ebx,%edi
mov    %ebx,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <mpz_mod@plt>

LLVM IR (-O0):
define void @dlog_s(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* %5
%8 = load i32, i32* %6
%9 = call i32 @mpz_sub_ui(i32 %7, i32 %8, i32 1)
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = call i32 @mpz_divexact(i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = call i32 @mpz_mod(i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @dlog_s(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_sub_ui(i32 %1, i32 %2, i32 1)
%5 = tail call i32 @mpz_divexact(i32 %1, i32 %1, i32 %0)
%6 = tail call i32 @mpz_mod(i32 %1, i32 %1, i32 %0)
ret void
}
unsigned short int rev_s_m(const unsigned char *p) {
  unsigned short a, b;
  a = p[0];
  b = p[1];
  return (unsigned short int)((a << 8) | (b << 0));
}


x86 assembly (clang, -O0):
<rev_s_m>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %ax,-0xc(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x8,%eax
movzwl -0xc(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_s_m>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @rev_s_m(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i16
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
store i16 %8, i16* %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
store i16 %12, i16* %4
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = shl i32 %14, 8
%16 = load i16, i16* %4
%17 = zext i16 %16 to i32
%18 = shl i32 %17, 0
%19 = or i32 %15, %18
%20 = trunc i32 %19 to i16
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @rev_s_m(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = zext i8 %2 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %4 to i16
%8 = or i16 %6, %7
ret i16 %8
}
IR0AX1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*p0) <= (((unsigned short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1147 <IR0AX1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <IR0AX1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AX1>:
movzwl (%r8),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx,%rcx,1),%dx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @IR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = load i16, i16* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %8
%10 = load i16, i16* %9
%11 = icmp ule i16 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int main(int argc, const char *atgv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void out_of_bounds() {
  fprintf(stderr, "Trying to access list at illegal index.");
  abort();
}


x86 assembly (clang, -O0):
<out_of_bounds>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<out_of_bounds>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Trying to access list at illegal index.\00"
define void @out_of_bounds() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Trying to access list at illegal index.\00"
define void @out_of_bounds() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(int argc, const char *argv[]) {
  float num1 = 3.14;
  float num2 = 42;
  double sum = num1 + num2;
  printf("The sum of two floats is %f.\n", sum);
  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)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"The sum of two floats is %f.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x40091EB860000000, float* %6
store float 4.200000e+01, float* %7
%9 = load float, float* %6
%10 = load float, float* %7
%11 = fadd float %9, %10
%12 = fpext float %11 to double
store double %12, double* %8
%13 = load double, double* %8
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"The sum of two floats is %f.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double 0x404691EB80000000)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char *aa = malloc(8);
  aa[-1] = 17;
  if (aa[-1] == 17)
    printf("17\n");
  else
    printf("not 17\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x11,-0x1(%rax)
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x11,%eax
jne    1167 <main+0x47>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <main+0x53>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [3 x i8] c"17\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printfile(char *);
int main(int argc, char **argv) {
  while (--argc > 0) {
    printfile(*++argv);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1155 <main+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <printfile@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1144 <main+0x34>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
call   1030 <printfile@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1130 <main+0x20>
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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i8*, i8** %12
%14 = call i32 @printfile(i8* %13)
br label %6
15: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @printfile(i8* %9)
%11 = icmp ugt i32 %6, 2
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
double __ocml_sqrt_rte_f64(double);
double __dsqrt_rn(double x) { return __ocml_sqrt_rte_f64(x); }


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

x86 assembly (clang, -O2):
<__dsqrt_rn>:
jmp    1030 <__ocml_sqrt_rte_f64@plt>

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

LLVM IR (-O2):
define double @__dsqrt_rn(double %0) {
%2 = tail call double @__ocml_sqrt_rte_f64(double %0)
ret double %2
}
/* Variables and functions */
double pow(double, double);
double get_luminous_intensity(double magnitude) {
  double exp = magnitude / (-2.5);
  return pow(10.0, exp);
}


x86 assembly (clang, -O0):
<get_luminous_intensity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xec0(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_luminous_intensity>:
movapd %xmm0,%xmm1
divsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @get_luminous_intensity(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, -2.500000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @pow(double 1.000000e+01, double %6)
ret double %7
}

LLVM IR (-O2):
define double @get_luminous_intensity(double %0) {
%2 = fdiv double %0, -2.500000e+00
%3 = tail call double @pow(double 1.000000e+01, double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fwrite(unsigned short *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void writeShort(unsigned short value) {
  if (fwrite(&value, sizeof(unsigned short), 1, stdout) != 1) {
    fprintf(stderr, "fwrite() failed -- exiting!\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<writeShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%ecx
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
je     1183 <writeShort+0x53>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeShort>:
push   %rax
mov    %di,0x6(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%ecx
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
jne    115a <writeShort+0x2a>
pop    %rax
ret
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [29 x i8] c"fwrite() failed -- exiting!\0A\00"
define void @writeShort(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fwrite(i16* %2, i32 2, i32 1, i32 %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [29 x i8] c"fwrite() failed -- exiting!\0A\00"
define void @writeShort(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fwrite(i16* %2, i32 2, i32 1, i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret void
}
char *strcpy(char *dest, char const *src) {
  char *x;
  return x;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @strcpy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
/* Variables and functions */
int atoi(char *);
long atol(char *);
int /*<<< orphan*/ printf(char *, long);
int main() {
  char ch[] = "12345.67";
  int i = atoi(ch);
  long l = atol(ch);
  printf("i is %d\n", i);
  printf("l is %d\n", l);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x10(%rbp)
lea    -0x9(%rbp),%rdi
call   1040 <atol@plt>
mov    %rax,-0x18(%rbp)
movslq -0x10(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <atol@plt>
mov    %rax,%rbx
movslq %ebp,%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.ch = [9 x i8] c"12345.67\00"
@.str = [9 x i8] c"i is %d\0A\00"
@.str.1 = [9 x i8] c"l is %d\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca i32
%3 = alloca i64
%4 = bitcast [9 x i8]* %1 to i8*
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %2
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%8 = call i64 @atol(i8* %7)
store i64 %8, i64* %3
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i64, i64* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ch = [9 x i8] c"12345.67\00"
@.str = [9 x i8] c"i is %d\0A\00"
@.str.1 = [9 x i8] c"l is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @atoi(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__const.main.ch, i64 0, i64 0))
%2 = tail call i64 @atol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__const.main.ch, i64 0, i64 0))
%3 = sext i32 %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x53() {
  Assert_real((isspace(83) == 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_isspace.c",
              420, ("isspace should be 0 for S"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x53>:
push   %rax
mov    $0x53,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1a4,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for S\00"
define void @t_isspace_0x53() {
%1 = call i64 @isspace(i32 83)
%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 420, i8* getelementptr inbounds ([26 x i8], [26 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for S\00"
define void @t_isspace_0x53() {
%1 = tail call i64 @isspace(i32 83)
%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 420, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t rtpx_get_header(const uint8_t *p_rtpx) {
  return (p_rtpx[0] << 8) | p_rtpx[1];
}


x86 assembly (clang, -O0):
<rtpx_get_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtpx_get_header>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtpx_get_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @rtpx_get_header(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Type definitions */
struct drand48_data {
  int /*<<< orphan*/ __x;
};

/* Variables and functions */
int nrand48_r(int /*<<< orphan*/, struct drand48_data *, long *);
int lrand48_r(struct drand48_data *buffer, long int *result) {
  if (buffer == NULL)
    return -1;
  return nrand48_r(buffer->__x, buffer, result);
}


x86 assembly (clang, -O0):
<lrand48_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <lrand48_r+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <lrand48_r+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <nrand48_r@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrand48_r>:
test   %rdi,%rdi
je     1122 <lrand48_r+0x12>
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    (%rdi),%edi
jmp    1030 <nrand48_r@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.drand48_data = type { i32 }
define i32 @lrand48_r(%struct.drand48_data* %0, i64* %1) {
%3 = alloca i32
%4 = alloca %struct.drand48_data*
%5 = alloca i64*
store %struct.drand48_data* %0, %struct.drand48_data** %4
store i64* %1, i64** %5
%6 = load %struct.drand48_data*, %struct.drand48_data** %4
%7 = icmp eq %struct.drand48_data* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %16
9: ; preds = %2
%10 = load %struct.drand48_data*, %struct.drand48_data** %4
%11 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.drand48_data*, %struct.drand48_data** %4
%14 = load i64*, i64** %5
%15 = call i32 @nrand48_r(i32 %12, %struct.drand48_data* %13, i64* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.drand48_data = type { i32 }
define i32 @lrand48_r(%struct.drand48_data* %0, i64* %1) {
%3 = icmp eq %struct.drand48_data* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds %struct.drand48_data, %struct.drand48_data* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @nrand48_r(i32 %6, %struct.drand48_data* %0, i64* %1)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -1, %2 ]
ret i32 %9
}
void exitMemory(void) {}


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

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

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

LLVM IR (-O2):
define void @exitMemory() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float);
int writing(FILE *f, float sredn) {
  fprintf(f, "%f", sredn);
  return 0;
}


x86 assembly (clang, -O0):
<writing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writing>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @writing(i32* %0, float %1) {
%3 = alloca i32*
%4 = alloca float
store i32* %0, i32** %3
store float %1, float* %4
%5 = load i32*, i32** %3
%6 = load float, float* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @writing(i32* nocapture %0, float %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 0
}
/* Variables and functions */
int sum(int, int);
int f(int x, int i, int gi2) { return sum((x - i) * (x - i), gi2); }


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

x86 assembly (clang, -O2):
<f>:
sub    %esi,%edi
imul   %edi,%edi
mov    %edx,%esi
jmp    1030 <sum@plt>

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = mul nsw i32 %9, %12
%14 = load i32, i32* %6
%15 = call i32 @sum(i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %1
%5 = mul nsw i32 %4, %4
%6 = tail call i32 @sum(i32 %5, i32 %2)
ret i32 %6
}
void up_init_gauge_byte(int size) {}


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

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

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

LLVM IR (-O2):
define void @up_init_gauge_byte(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ _debug(char *, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ close_icmp_socket();
int iptables_fw_destroy();
int fw_destroy(void) {
  close_icmp_socket();
  _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/GaomingPan/wifidog-gateway/refs/heads/"
         "master/src/firewall.c",
         248, LOG_INFO, "Removing Firewall rules");
  return iptables_fw_destroy();
}


x86 assembly (clang, -O0):
<fw_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <close_icmp_socket@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
lea    0xeb5(%rip),%rdi
mov    $0xf8,%esi
lea    0xf3f(%rip),%rcx
call   1030 <_debug@plt>
mov    $0x0,%al
call   1040 <iptables_fw_destroy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_destroy>:
push   %rax
xor    %eax,%eax
call   1050 <close_icmp_socket@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xeb8(%rip),%rdi
lea    0xf47(%rip),%rcx
mov    $0xf8,%esi
call   1030 <_debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <iptables_fw_destroy@plt>

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GaomingPan/wifidog-gateway/refs/heads/master/src/firewall.c\00"
@LOG_INFO = global i32 0
@.str.1 = [24 x i8] c"Removing Firewall rules\00"
define i32 @fw_destroy() {
%1 = call i32 (...) @close_icmp_socket()
%2 = load i32, i32* @LOG_INFO
%3 = call i32 @_debug(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 248, i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @iptables_fw_destroy()
ret i32 %4
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GaomingPan/wifidog-gateway/refs/heads/master/src/firewall.c\00"
@LOG_INFO = global i32 0
@.str.1 = [24 x i8] c"Removing Firewall rules\00"
define i32 @fw_destroy() {
%1 = tail call i32 (...) @close_icmp_socket()
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @_debug(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 248, i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @iptables_fw_destroy()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void error(const char *s) {
  printf("\n");
  printf("  Error: %s\n", s);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str.1 = [13 x i8] c" Error: %s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vmi_cpuid(unsigned int, unsigned int *, unsigned int *,
                             unsigned int *, unsigned int *);
unsigned int cpuid_eax(unsigned int op) {
  unsigned int eax, ebx, ecx, edx;
  vmi_cpuid(op, &eax, &ebx, &ecx, &edx);
  return eax;
}


x86 assembly (clang, -O0):
<cpuid_eax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <vmi_cpuid@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_eax>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1030 <vmi_cpuid@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @vmi_cpuid(i32 %7, i32* %3, i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @vmi_cpuid(i32 %0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %2
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sayi = 0;
  printf("Sayi giriniz: ");
  scanf("%d", &sayi);
  if (sayi % 2 == 0)
    printf("Sayi cifttir");
  else
    printf("Sayi tektir");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1177 <main+0x57>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <main+0x63>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xec0(%rip),%rax
lea    0xec6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Sayi giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Sayi cifttir\00"
@.str.3 = [12 x i8] c"Sayi tektir\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 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* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Sayi giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Sayi cifttir\00"
@.str.3 = [12 x i8] c"Sayi tektir\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 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 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
scalar_t__ memcmp_ci(char *, char *, int);
int string_ci_eq(char *s1, char *s2, int k) {
  return memcmp_ci(s1, s2, k) == 0;
}


x86 assembly (clang, -O0):
<string_ci_eq>:
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 <memcmp_ci@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_ci_eq>:
push   %rax
call   1030 <memcmp_ci@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_ci_eq(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 @memcmp_ci(i8* %7, i8* %8, i32 %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @string_ci_eq(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @memcmp_ci(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int sh_list_compare(void const *, void const *);
int sh_queue_compare(const void *q, const void *q2) {
  return sh_list_compare(q, q2);
}


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

x86 assembly (clang, -O2):
<sh_queue_compare>:
jmp    1030 <sh_list_compare@plt>

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

LLVM IR (-O2):
define i32 @sh_queue_compare(i8* %0, i8* %1) {
%3 = tail call i32 @sh_list_compare(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ core7_print(char *, char *, char *, char const *);
void U_EMRRESIZEPALETTE_print(const char *contents) {
  core7_print("U_EMRRESIZEPALETTE", "ihPal:", "cEntries", contents);
}


x86 assembly (clang, -O0):
<U_EMRRESIZEPALETTE_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1030 <core7_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRRESIZEPALETTE_print>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xef2(%rip),%rdx
jmp    1030 <core7_print@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"U_EMRRESIZEPALETTE\00"
@.str.1 = [7 x i8] c"ihPal:\00"
@.str.2 = [9 x i8] c"cEntries\00"
define void @U_EMRRESIZEPALETTE_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core7_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"U_EMRRESIZEPALETTE\00"
@.str.1 = [7 x i8] c"ihPal:\00"
@.str.2 = [9 x i8] c"cEntries\00"
define void @U_EMRRESIZEPALETTE_print(i8* %0) {
%2 = tail call i32 @core7_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
void txt_chanpressure(chan, press) {
  prtime();
  printf("Channel pressure, chan=%d pressure=%d\n", chan + 1, press);
}


x86 assembly (clang, -O0):
<txt_chanpressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_chanpressure>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebp
lea    0xec8(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [39 x i8] c"Channel pressure, chan=%d pressure=%d\0A\00"
define void @txt_chanpressure(i32 %0, i32 %1) {
%3 = tail call i32 (...) @prtime()
%4 = add nsw i32 %0, 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_char(unsigned char);
void print_warn_char(unsigned char byte) { console_tx_char(byte); }


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

x86 assembly (clang, -O2):
<print_warn_char>:
jmp    1030 <console_tx_char@plt>

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

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

/* Variables and functions */
int EOF;
int fread(void *, int, int, int /*<<< orphan*/ *);
int getw(FILE *stream) {
  int w;
  if (fread((void *)&w, sizeof(w), 1, stream) != 1)
    return EOF;
  return w;
}


x86 assembly (clang, -O0):
<getw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     114d <getw+0x3d>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <getw+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getw>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rcx
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     113b <getw+0x2b>
mov    0x2ead(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getw(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i8* %3, i32 4, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
%6 = load i32, i32* %2
%7 = load i32, i32* @EOF
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
int test_imm_D1int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xd1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D1int64_midword_mem>:
testb  $0xd1,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D1int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 209
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D1int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13697024
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}