xunge/DecIR huggingface dataset:
int heap_parent(struct heap *ponteiro, int controle) {
  if (controle > 1) {
    return (controle / 2);
  } else
    return 0;
}


x86 assembly (clang, -O0):
<heap_parent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1128 <heap_parent+0x28>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    112f <heap_parent+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_parent>:
xor    %eax,%eax
cmp    $0x2,%esi
jl     1110 <heap_parent+0x10>
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
%struct.heap = type opaque
define i32 @heap_parent(%struct.heap* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
%4 = sdiv i32 %1, 2
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __isoc99_scanf();
float add1(int);
int /*<<< orphan*/ printf(char *, float);
int main(int argc, char *argv[], char *envp[]) {
  float f0;
  int local0;
  __isoc99_scanf();
  f0 = add1(local0);
  printf("Sum = %ld\n", f0);
  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    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <__isoc99_scanf@plt>
mov    -0x20(%rbp),%edi
call   1040 <add1@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <__isoc99_scanf@plt>
call   1040 <add1@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @__isoc99_scanf()
%5 = tail call float @add1(i32 undef)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %5)
ret i32 0
}
void TestAlgorithms(void) {}


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

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

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

LLVM IR (-O2):
define void @TestAlgorithms() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *fixup_null_alloc(size_t);
void *xcalloc(size_t n, size_t s) {
  void *p;
  p = calloc(n, s);
  if (p == NULL)
    p = fixup_null_alloc(n);
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <xcalloc+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <fixup_null_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <calloc@plt>
test   %rax,%rax
je     1130 <xcalloc+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fixup_null_alloc@plt>

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i64, i64* %3
%13 = call i8* @fixup_null_alloc(i64 %12)
store i8* %13, i8** %5
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @fixup_null_alloc(i64 %0)
br label %7
7: ; preds = %5, %2
%8 = phi i8* [ %6, %5 ], [ %3, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ n();
void main() {
  n();
  n();
  n();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @n()
%2 = call i32 (...) @n()
%3 = call i32 (...) @n()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @n()
%2 = tail call i32 (...) @n()
%3 = tail call i32 (...) @n()
ret void
}
unsigned int AT91F_MC_EFC_ComputeFMCN(int master_clock) {
  return (master_clock / 1000000 + 2);
}


x86 assembly (clang, -O0):
<AT91F_MC_EFC_ComputeFMCN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT91F_MC_EFC_ComputeFMCN>:
movslq %edi,%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
sar    $0x32,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @AT91F_MC_EFC_ComputeFMCN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1000000
%5 = add nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @AT91F_MC_EFC_ComputeFMCN(i32 %0) {
%2 = sdiv i32 %0, 1000000
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double const, double const, double const,
                          double const);
void glmPrintVector4d(const double v[4]) {
  printf("[%f,%f,%f,%f]", v[0], v[1], v[2], v[3]);
}


x86 assembly (clang, -O0):
<glmPrintVector4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm3
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmPrintVector4d>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
movsd  0x18(%rdi),%xmm3
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"[%f,%f,%f,%f]\00"
define void @glmPrintVector4d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 3
%8 = load double, double* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6, double %8)
ret void
}
/* Variables and functions */
int execvp(char const *, char *const *);
int execlp(const char *file, const char *arg1, ...) {
  return execvp(file, (char *const *)&arg1);
}


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

x86 assembly (clang, -O2):
<execlp>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <execvp@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @execlp(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 = call i32 @execvp(i8* %5, i8** %4)
ret i32 %6
}

LLVM IR (-O2):
define i32 @execlp(i8* %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @execvp(i8* %0, i8** %3)
ret i32 %4
}
int test6u(unsigned char x) { return x / 100 >= 3; }


x86 assembly (clang, -O0):
<test6u>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test6u(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp sge i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test6u(i8 zeroext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void end_display() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @end_display() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ as_abort(char *);
int creat(char *, int);
int my_creat(char *name, char *message) {
  int fd;
  if ((fd = creat(name, 0666)) < 0 || fd > 255)
    as_abort(message);
  return fd;
}


x86 assembly (clang, -O0):
<my_creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1b6,%esi
call   1040 <creat@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     1157 <my_creat+0x37>
cmpl   $0xff,-0x14(%rbp)
jle    1160 <my_creat+0x40>
mov    -0x10(%rbp),%rdi
call   1030 <as_abort@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_creat>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    $0x1b6,%esi
call   1040 <creat@plt>
mov    %eax,%ebp
cmp    $0x100,%eax
jb     1141 <my_creat+0x21>
mov    %rbx,%rdi
call   1030 <as_abort@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_creat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @creat(i8* %6, i32 438)
store i32 %7, i32* %5
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 255
br i1 %11, label %12, label %15
12: ; preds = %9, %2
%13 = load i8*, i8** %4
%14 = call i32 @as_abort(i8* %13)
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @my_creat(i8* %0, i8* %1) {
%3 = tail call i32 @creat(i8* %0, i32 438)
%4 = icmp ugt i32 %3, 255
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @as_abort(i8* %1)
br label %7
7: ; preds = %2, %5
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct smc_call {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ smc32_arg(struct smc_call const *, int);
uint32_t smc_hypervisor_id(const struct smc_call *smc) {
  return smc32_arg(smc, 7);
}


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

x86 assembly (clang, -O2):
<smc_hypervisor_id>:
mov    $0x7,%esi
jmp    1030 <smc32_arg@plt>

LLVM IR (-O0):
%struct.smc_call = type { i32 }
define i32 @smc_hypervisor_id(%struct.smc_call* %0) {
%2 = alloca %struct.smc_call*
store %struct.smc_call* %0, %struct.smc_call** %2
%3 = load %struct.smc_call*, %struct.smc_call** %2
%4 = call i32 @smc32_arg(%struct.smc_call* %3, i32 7)
ret i32 %4
}

LLVM IR (-O2):
%struct.smc_call = type { i32 }
define i32 @smc_hypervisor_id(%struct.smc_call* %0) {
%2 = tail call i32 @smc32_arg(%struct.smc_call* %0, i32 7)
ret i32 %2
}
/* Variables and functions */
char *U_EMR_CORE5_set(int);
char *U_EMRFLATTENPATH_set(void) { return (U_EMR_CORE5_set(65)); }


x86 assembly (clang, -O0):
<U_EMRFLATTENPATH_set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
call   1030 <U_EMR_CORE5_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRFLATTENPATH_set>:
mov    $0x41,%edi
jmp    1030 <U_EMR_CORE5_set@plt>

LLVM IR (-O0):
define i8* @U_EMRFLATTENPATH_set() {
%1 = call i8* @U_EMR_CORE5_set(i32 65)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRFLATTENPATH_set() {
%1 = tail call i8* @U_EMR_CORE5_set(i32 65)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void exitfunc9(int status, void *arg) {
  printf("Executing exitfunc9 (status=%d, arg=%d)\n", status, (int)arg);
  exit((int)arg);
}


x86 assembly (clang, -O0):
<exitfunc9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc9>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Executing exitfunc9 (status=%d, arg=%d)\0A\00"
define void @exitfunc9(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Executing exitfunc9 (status=%d, arg=%d)\0A\00"
define void @exitfunc9(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
%6 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("usage %s [options] [\"filter\"]\n"
         "-h\t\tthis text you see right here\n"
         "-l\t\tLast update of Ports DB\n"
         "-V\t\tPrint version and exit.\n"
         "-I\t\tInitialize Ports DB files.\n"
         "-d <db_dir>\tPorts DB directory.\n"
         "-r <input>\tread from file. default: stdin\n"
         "-p\t\tOnline output mode.\n"
         "-s\t\tCreate port statistics for timeslot -t\n"
         "-t <time>\tTimeslot for statistics\n"
         "-S\t\tCreate port statistics for last day\n"
         "-w <file>\twrite output to file\n"
         "-f <filter>\tfilter syntaxfile\n",
         name);
}


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

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

LLVM IR (-O0):
@.str = [427 x i8] c"usage %s [options] [\22filter\22]\0A-h\09\09this text you see right here\0A-l\09\09Last update of Ports DB\0A-V\09\09Print version and exit.\0A-I\09\09Initialize Ports DB files.\0A-d <db_dir>\09Ports DB directory.\0A-r <input>\09read from file. default: stdin\0A-p\09\09Online output mode.\0A-s\09\09Create port statistics for timeslot -t\0A-t <time>\09Timeslot for statistics\0A-S\09\09Create port statistics for last day\0A-w <file>\09write output to file\0A-f <filter>\09filter syntaxfile\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [427 x i8] c"usage %s [options] [\22filter\22]\0A-h\09\09this text you see right here\0A-l\09\09Last update of Ports DB\0A-V\09\09Print version and exit.\0A-I\09\09Initialize Ports DB files.\0A-d <db_dir>\09Ports DB directory.\0A-r <input>\09read from file. default: stdin\0A-p\09\09Online output mode.\0A-s\09\09Create port statistics for timeslot -t\0A-t <time>\09Timeslot for statistics\0A-S\09\09Create port statistics for last day\0A-w <file>\09write output to file\0A-f <filter>\09filter syntaxfile\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void *do_cpuid_return(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char qsim_in() {
  char out;
  int ready;
  ready = do_cpuid_return(0xc5b1fffe);
  if (!ready)
    exit(0);
  out = do_cpuid_return(0xc5b1ffff);
  return out;
}


x86 assembly (clang, -O0):
<qsim_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc5b1fffe,%edi
call   1040 <do_cpuid_return@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1146 <qsim_in+0x26>
xor    %edi,%edi
call   1030 <exit@plt>
mov    $0xc5b1ffff,%edi
call   1040 <do_cpuid_return@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsim_in>:
push   %rax
mov    $0xc5b1fffe,%edi
call   1040 <do_cpuid_return@plt>
test   %eax,%eax
je     113b <qsim_in+0x1b>
mov    $0xc5b1ffff,%edi
call   1040 <do_cpuid_return@plt>
pop    %rcx
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define signext i8 @qsim_in() {
%1 = alloca i8
%2 = alloca i32
%3 = call i8* @do_cpuid_return(i32 -978190338)
%4 = ptrtoint i8* %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = call i8* @do_cpuid_return(i32 -978190337)
%11 = ptrtoint i8* %10 to i8
store i8 %11, i8* %1
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @qsim_in() {
%1 = tail call i8* @do_cpuid_return(i32 -978190338)
%2 = ptrtoint i8* %1 to i64
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = tail call i8* @do_cpuid_return(i32 -978190337)
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i8
ret i8 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ ACS_BLOCK;
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/);
void drawblock(WINDOW **w, int x, int y) {
  mvwaddch(w[1], y, x * 2, ACS_BLOCK);
  mvwaddch(w[1], y, x * 2 + 1, ACS_BLOCK);
}


x86 assembly (clang, -O0):
<drawblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
mov    0x2ea6(%rip),%rax
mov    (%rax),%ecx
call   1030 <mvwaddch@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
add    $0x1,%edx
mov    0x2e84(%rip),%rax
mov    (%rax),%ecx
call   1030 <mvwaddch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawblock>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%rbp
mov    0x8(%rdi),%rdi
lea    (%rbx,%rbx,1),%edx
mov    0x2eb3(%rip),%r15
mov    (%r15),%ecx
mov    %r14d,%esi
call   1030 <mvwaddch@plt>
mov    0x8(%rbp),%rdi
lea    (%rbx,%rbx,1),%edx
add    $0x1,%edx
mov    (%r15),%ecx
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <mvwaddch@plt>

LLVM IR (-O0):
@ACS_BLOCK = global i32 0
define void @drawblock(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 = getelementptr inbounds i32*, i32** %7, i64 1
%9 = load i32*, i32** %8
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 2
%13 = load i32, i32* @ACS_BLOCK
%14 = call i32 @mvwaddch(i32* %9, i32 %10, i32 %12, i32 %13)
%15 = load i32**, i32*** %4
%16 = getelementptr inbounds i32*, i32** %15, i64 1
%17 = load i32*, i32** %16
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = mul nsw i32 %19, 2
%21 = add nsw i32 %20, 1
%22 = load i32, i32* @ACS_BLOCK
%23 = call i32 @mvwaddch(i32* %17, i32 %18, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
@ACS_BLOCK = global i32 0
define void @drawblock(i32** nocapture %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds i32*, i32** %0, i64 1
%5 = load i32*, i32** %4
%6 = shl nsw i32 %1, 1
%7 = load i32, i32* @ACS_BLOCK
%8 = tail call i32 @mvwaddch(i32* %5, i32 %2, i32 %6, i32 %7)
%9 = load i32*, i32** %4
%10 = or i32 %6, 1
%11 = load i32, i32* @ACS_BLOCK
%12 = tail call i32 @mvwaddch(i32* %9, i32 %2, i32 %10, i32 %11)
ret void
}
int ft_iscntrl(int c) { return ((c == 0 || c == 31 || c == 127) ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <ft_iscntrl+0x2f>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <ft_iscntrl+0x2f>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_iscntrl>:
mov    $0x1,%eax
test   %edi,%edi
je     110e <ft_iscntrl+0xe>
cmp    $0x1f,%edi
jne    110f <ft_iscntrl+0xf>
ret
xor    %eax,%eax
cmp    $0x7f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ft_iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
ret i32 %14
}

LLVM IR (-O2):
define i32 @ft_iscntrl(i32 %0) {
switch i32 %0, label %2 [
i32 31, label %5
i32 0, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 127
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ des_dec(void *, void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ des_enc(void *, void *, int /*<<< orphan*/ *);
void tdes_dec(void *out, void *in, const uint8_t *key) {
  des_dec(out, in, (uint8_t *)key + 16);
  des_enc(out, out, (uint8_t *)key + 8);
  des_dec(out, out, (uint8_t *)key + 0);
}


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

x86 assembly (clang, -O2):
<tdes_dec>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0x40,%rdx
call   1040 <des_dec@plt>
lea    0x20(%r14),%rdx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <des_enc@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <des_dec@plt>

LLVM IR (-O0):
define void @tdes_dec(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 = getelementptr inbounds i32, i32* %9, i64 16
%11 = call i32 @des_dec(i8* %7, i8* %8, i32* %10)
%12 = load i8*, i8** %4
%13 = load i8*, i8** %4
%14 = load i32*, i32** %6
%15 = getelementptr inbounds i32, i32* %14, i64 8
%16 = call i32 @des_enc(i8* %12, i8* %13, i32* %15)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %4
%19 = load i32*, i32** %6
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = call i32 @des_dec(i8* %17, i8* %18, i32* %20)
ret void
}

LLVM IR (-O2):
define void @tdes_dec(i8* %0, i8* %1, i32* %2) {
%4 = getelementptr inbounds i32, i32* %2, i64 16
%5 = tail call i32 @des_dec(i8* %0, i8* %1, i32* %4)
%6 = getelementptr inbounds i32, i32* %2, i64 8
%7 = tail call i32 @des_enc(i8* %0, i8* %0, i32* %6)
%8 = tail call i32 @des_dec(i8* %0, i8* %0, i32* %2)
ret void
}
void writeb(unsigned int addr, unsigned char v) {
  *((volatile unsigned char *)addr) = v;
}


x86 assembly (clang, -O0):
<writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%cl
mov    -0x4(%rbp),%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeb>:
mov    %edi,%eax
mov    %sil,(%rax)
ret

LLVM IR (-O0):
define void @writeb(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
store volatile i8 %5, i8* %8
ret void
}

LLVM IR (-O2):
define void @writeb(i32 %0, i8 zeroext %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
store volatile i8 %1, i8* %4
ret void
}
/* Variables and functions */
scalar_t__ setpgrp();
long SETPGRP() { return ((long)setpgrp()); }


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

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

LLVM IR (-O0):
define i64 @SETPGRP() {
%1 = call i64 (...) @setpgrp()
ret i64 %1
}

LLVM IR (-O2):
define i64 @SETPGRP() {
%1 = tail call i64 (...) @setpgrp()
ret i64 %1
}
int test_imm_A0int32_reg(int val) { return ((val) & (0xA0 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_A0int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xa0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A0int32_reg(i32 %0) {
%2 = and i32 %0, 160
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int xfread_value(int /*<<< orphan*/ *, char *, int);
int xfread_byte(FILE *fp, char *filename) {
  return xfread_value(fp, filename, 1) & 0xFF;
}


x86 assembly (clang, -O0):
<xfread_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <xfread_value@plt>
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfread_byte>:
push   %rax
mov    $0x1,%edx
call   1030 <xfread_value@plt>
movzbl %al,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xfread_byte(i32* %0, i8* %1) {
%3 = tail call i32 @xfread_value(i32* %0, i8* %1, i32 1)
%4 = and i32 %3, 255
ret i32 %4
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
scalar_t__ tm_islocalrepresentation(struct tm);
int tm_isutcrepresentation(struct tm date) {
  return (tm_islocalrepresentation(date) ? 0 : 1);
}


x86 assembly (clang, -O0):
<tm_isutcrepresentation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <tm_islocalrepresentation@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @tm_isutcrepresentation(i32 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i64 @tm_islocalrepresentation(i32 %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @tm_isutcrepresentation(i32 %0) {
%2 = tail call i64 @tm_islocalrepresentation(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct flock {
  scalar_t__ l_len;
  int /*<<< orphan*/ l_whence;
  scalar_t__ l_start;
  int /*<<< orphan*/ l_type;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_WRLCK;
int /*<<< orphan*/ SEEK_SET;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int wlock_file(int fd) {
  struct flock lck;
  lck.l_type = F_WRLCK;
  lck.l_start = 0;
  lck.l_whence = SEEK_SET;
  lck.l_len = 0;
  return fcntl(fd, F_SETLK, &lck);
}


x86 assembly (clang, -O0):
<wlock_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wlock_file>:
sub    $0x28,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
movq   $0x0,0x18(%rsp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <fcntl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i64, i32, i64, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define i32 @wlock_file(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.flock
store i32 %0, i32* %2
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* @SEEK_SET
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETLK
%12 = call i32 @fcntl(i32 %10, i32 %11, %struct.flock* %3)
ret i32 %12
}

LLVM IR (-O2):
%struct.flock = type { i64, i32, i64, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define i32 @wlock_file(i32 %0) {
%2 = alloca %struct.flock
%3 = bitcast %struct.flock* %2 to i8*
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 3
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* @SEEK_SET
%8 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* @F_SETLK
%11 = call i32 @fcntl(i32 %0, i32 %10, %struct.flock* %2)
ret i32 %11
}
/* Variables and functions */
float exp2f(unsigned char);
float t4(unsigned char x) { return exp2f(x); }


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

x86 assembly (clang, -O2):
<t4>:
jmp    1030 <exp2f@plt>

LLVM IR (-O0):
define float @t4(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call float @exp2f(i8 zeroext %3)
ret float %4
}

LLVM IR (-O2):
define float @t4(i8 zeroext %0) {
%2 = tail call float @exp2f(i8 zeroext %0)
ret float %2
}
int main() {
  enum {
    FIVE = 5,
    SIX,
    SEVEN,
    FOUR = FIVE - 1,
    EIGHT = sizeof(double)
  } x = FIVE;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
int fd_sub(int x, int y) {
  int c;
  c = x - y;
  return c;
}


x86 assembly (clang, -O0):
<fd_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_sub>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @fd_sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
int CutStr(char x[], int len) {
  x[len] = 0;
  return 1;
}


x86 assembly (clang, -O0):
<CutStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CutStr>:
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @CutStr(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @CutStr(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x1f() {
  Assert_real((ispunct(31) == 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_ispunct.c",
              160, ("ispunct should be 0 for 0x1f"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x1f>:
push   %rax
mov    $0x1f,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa0,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x1f\00"
define void @t_ispunct_0x1f() {
%1 = call i64 @ispunct(i32 31)
%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 160, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x1f\00"
define void @t_ispunct_0x1f() {
%1 = tail call i64 @ispunct(i32 31)
%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 160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int listen(int, int);
int /*<<< orphan*/ perror(char *);
int Listen(int sockfd, int backlog) {
  int ret = listen(sockfd, backlog);
  if (ret == -1) {
    perror("listen() error");
  }
  return ret;
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1152 <Listen+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rbx
call   1030 <listen@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1131 <Listen+0x11>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
jmp    112d <Listen+0xd>

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

LLVM IR (-O2):
@.str = [15 x i8] c"listen() error\00"
define i32 @Listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
void NumTests(void) {}


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

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

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

LLVM IR (-O2):
define void @NumTests() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove_pwm(unsigned int);
void pwm_stop(unsigned int gpio) { remove_pwm(gpio); }


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

x86 assembly (clang, -O2):
<pwm_stop>:
jmp    1030 <remove_pwm@plt>

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

LLVM IR (-O2):
define void @pwm_stop(i32 %0) {
%2 = tail call i32 @remove_pwm(i32 %0)
ret void
}
int f1(int *a) {
  long b = a - (int *)1;
  a -= (int *)1;
  return b == (long)a;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
sar    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
sar    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f1(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = ptrtoint i32* %4 to i64
%6 = sub i64 %5, 1
%7 = sdiv exact i64 %6, 4
store i64 %7, i64* %3
%8 = load i32*, i32** %2
%9 = ptrtoint i32* %8 to i64
%10 = sub i64 %9, 1
%11 = sdiv exact i64 %10, 4
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %2
%13 = load i64, i64* %3
%14 = load i32*, i32** %2
%15 = ptrtoint i32* %14 to i64
%16 = icmp eq i64 %13, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @f1(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int system(char const *);
int cmd_start(const char *cmd) {
  int rc = -1;
  rc = system(cmd);
  return rc;
}


x86 assembly (clang, -O0):
<cmd_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_start>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @cmd_start(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mempcpy(int *, int *, int);
void mempcpy6() {
  int a[4] = {0};
  mempcpy(a, a, 8);
}


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

x86 assembly (clang, -O2):
<mempcpy6>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    %rdi,%rsi
mov    $0x8,%edx
call   1030 <mempcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @mempcpy6() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%5 = call i32 @mempcpy(i32* %3, i32* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @mempcpy6() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @mempcpy(i32* %3, i32* %3, i32 8)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *clad_gar_new(size_t nmemb, size_t size) { return calloc(nmemb, size); }


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

x86 assembly (clang, -O2):
<clad_gar_new>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @clad_gar_new(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) { printf("%s", argv[0]); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}