xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ iic_write_m(unsigned int);
int /*<<< orphan*/ start();
int /*<<< orphan*/ stop();
void ina_write(unsigned char addr, unsigned char reg, unsigned int dat) {
  start();
  iic_write_m(addr);
  iic_write_m(reg);
  iic_write_m(dat >> 8);
  iic_write_m(dat & 0xff);
  stop();
}


x86 assembly (clang, -O0):
<ina_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1050 <start@plt>
movzbl -0x1(%rbp),%edi
call   1030 <iic_write_m@plt>
movzbl -0x2(%rbp),%edi
call   1030 <iic_write_m@plt>
mov    -0x8(%rbp),%edi
shr    $0x8,%edi
call   1030 <iic_write_m@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <iic_write_m@plt>
mov    $0x0,%al
call   1040 <stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ina_write>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <start@plt>
mov    %ebp,%edi
call   1030 <iic_write_m@plt>
mov    %r14d,%edi
call   1030 <iic_write_m@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1030 <iic_write_m@plt>
movzbl %bl,%edi
call   1030 <iic_write_m@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <stop@plt>

LLVM IR (-O0):
define void @ina_write(i8 zeroext %0, i8 zeroext %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 = call i32 (...) @start()
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = call i32 @iic_write_m(i32 %9)
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = call i32 @iic_write_m(i32 %12)
%14 = load i32, i32* %6
%15 = lshr i32 %14, 8
%16 = call i32 @iic_write_m(i32 %15)
%17 = load i32, i32* %6
%18 = and i32 %17, 255
%19 = call i32 @iic_write_m(i32 %18)
%20 = call i32 (...) @stop()
ret void
}

LLVM IR (-O2):
define void @ina_write(i8 zeroext %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 (...) @start()
%5 = zext i8 %0 to i32
%6 = tail call i32 @iic_write_m(i32 %5)
%7 = zext i8 %1 to i32
%8 = tail call i32 @iic_write_m(i32 %7)
%9 = lshr i32 %2, 8
%10 = tail call i32 @iic_write_m(i32 %9)
%11 = and i32 %2, 255
%12 = tail call i32 @iic_write_m(i32 %11)
%13 = tail call i32 (...) @stop()
ret void
}
/* Variables and functions */
int my_strlen(char *str) {
  int i;
  if (str == NULL)
    return (0);
  i = 0;
  while (str[i] != '\0')
    i += 1;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <my_strlen+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114f <my_strlen+0x4f>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1149 <my_strlen+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <my_strlen+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
test   %rdi,%rdi
je     111d <my_strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  double tv_usec;
  scalar_t__ tv_sec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
double timer() {
  struct rusage r;
  getrusage(0, &r);
  return (double)(r.ru_utime.tv_sec + r.ru_utime.tv_usec / (double)1000000);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x10(%rbp),%rsi
call   1030 <getrusage@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeca(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   1030 <getrusage@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, i64 }
define double @timer() {
%1 = alloca %struct.rusage
%2 = call i32 @getrusage(i32 0, %struct.rusage* %1)
%3 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%4 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %6, %10
ret double %11
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, i64 }
define double @timer() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = call i32 @getrusage(i32 0, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %9, %6
ret double %10
}
/* Type definitions */
struct archive_size {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ get_size(struct archive_size *, int, char const *);
int open_and_stat(char const *);
void gzip_size(struct archive_size *size, const char *name) {
  int fd = open_and_stat(name);
  if (fd < 0) {
    exit(127);
  }
  get_size(size, fd, name);
  close(fd);
}


x86 assembly (clang, -O0):
<gzip_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <open_and_stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1170 <gzip_size+0x30>
mov    $0x7f,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <get_size@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gzip_size>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <open_and_stat@plt>
test   %eax,%eax
js     1170 <gzip_size+0x30>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <get_size@plt>
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <close@plt>
mov    $0x7f,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.archive_size = type { i32 }
define void @gzip_size(%struct.archive_size* %0, i8* %1) {
%3 = alloca %struct.archive_size*
%4 = alloca i8*
%5 = alloca i32
store %struct.archive_size* %0, %struct.archive_size** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @open_and_stat(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exit(i32 127)
unreachable
12: ; preds = %2
%13 = load %struct.archive_size*, %struct.archive_size** %3
%14 = load i32, i32* %5
%15 = load i8*, i8** %4
%16 = call i32 @get_size(%struct.archive_size* %13, i32 %14, i8* %15)
%17 = load i32, i32* %5
%18 = call i32 @close(i32 %17)
ret void
}

LLVM IR (-O2):
%struct.archive_size = type { i32 }
define void @gzip_size(%struct.archive_size* %0, i8* %1) {
%3 = tail call i32 @open_and_stat(i8* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @exit(i32 127)
unreachable
7: ; preds = %2
%8 = tail call i32 @get_size(%struct.archive_size* %0, i32 %3, i8* %1)
%9 = tail call i32 @close(i32 %3)
ret void
}
int test_imm_12int8_mem(signed char *val) {
  return ((*val) & (0x12 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_12int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x12,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_12int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 18
%7 = icmp ne i32 %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_12int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 18
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ add_option(int, char *, char *);
void add_lrs_options() {
  add_option('p', "Pay Taxes", "");
  add_option(-1, "Leave", "");
}


x86 assembly (clang, -O0):
<add_lrs_options>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
lea    0xee0(%rip),%rsi
lea    0xee8(%rip),%rdx
call   1030 <add_option@plt>
mov    $0xffffffff,%edi
lea    0xed2(%rip),%rsi
lea    0xed0(%rip),%rdx
call   1030 <add_option@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_lrs_options>:
push   %rbx
lea    0xee8(%rip),%rsi
lea    0xef0(%rip),%rbx
mov    $0x70,%edi
mov    %rbx,%rdx
call   1030 <add_option@plt>
lea    0xed7(%rip),%rsi
mov    $0xffffffff,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <add_option@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Pay Taxes\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"Leave\00"
define void @add_lrs_options() {
%1 = call i32 @add_option(i32 112, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @add_option(i32 -1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Pay Taxes\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"Leave\00"
define void @add_lrs_options() {
%1 = tail call i32 @add_option(i32 112, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @add_option(i32 -1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void challenge_auth() {}


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

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

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

LLVM IR (-O2):
define void @challenge_auth() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SO_RCVBUF;
int get_sockbuf_size(int, int /*<<< orphan*/, size_t *const, char *);
int get_rcvbuf(int sockfd, size_t *const len) {
  return get_sockbuf_size(sockfd, SO_RCVBUF, len, "receive");
}


x86 assembly (clang, -O0):
<get_rcvbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rcx
call   1030 <get_sockbuf_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rcvbuf>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
lea    0xedd(%rip),%rcx
jmp    1030 <get_sockbuf_size@plt>

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

LLVM IR (-O2):
@SO_RCVBUF = global i32 0
@.str = [8 x i8] c"receive\00"
define i32 @get_rcvbuf(i32 %0, i64* %1) {
%3 = load i32, i32* @SO_RCVBUF
%4 = tail call i32 @get_sockbuf_size(i32 %0, i32 %3, i64* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ omp_set_num_threads(int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  omp_set_num_threads(4);
#pragma omp parallel
  fprintf(stderr, "Hello from thread %d, nthreads %d\n", omp_get_thread_num(),
          omp_get_num_threads());
  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    $0x4,%edi
call   1060 <omp_set_num_threads@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <omp_get_num_threads@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xe74(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x4,%edi
call   1060 <omp_set_num_threads@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <omp_get_num_threads@plt>
lea    0xe93(%rip),%rsi
mov    %ebx,%edi
mov    %ebp,%edx
mov    %eax,%ecx
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Hello from thread %d, nthreads %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @omp_set_num_threads(i32 4)
%9 = load i32, i32* @stderr
%10 = call i32 (...) @omp_get_thread_num()
%11 = call i32 (...) @omp_get_num_threads()
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Hello from thread %d, nthreads %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @omp_set_num_threads(i32 4)
%4 = load i32, i32* @stderr
%5 = tail call i32 (...) @omp_get_thread_num()
%6 = tail call i32 (...) @omp_get_num_threads()
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void simple_error(char *errmsg) {
  fprintf(stderr, "*** in hash.c: %s\n", errmsg);
  fflush(stderr);
  kill(0, SIGSEGV);
}


x86 assembly (clang, -O0):
<simple_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_error>:
push   %rbx
mov    %rdi,%rdx
mov    0x2e9d(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"*** in hash.c: %s\0A\00"
@SIGSEGV = global i32 0
define void @simple_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = load i32, i32* @SIGSEGV
%9 = call i32 @kill(i32 0, i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"*** in hash.c: %s\0A\00"
@SIGSEGV = global i32 0
define void @simple_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @SIGSEGV
%7 = tail call i32 @kill(i32 0, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void terminateConnection(int acceptedFileDescriptor) {
  close(acceptedFileDescriptor);
}


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

x86 assembly (clang, -O2):
<terminateConnection>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @terminateConnection(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void __attribute__((weak)) exti15_10_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<exti15_10_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exti15_10_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.exti15_10_isr = [14 x i8] c"exti15_10_isr\00"
define weak void @exti15_10_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.exti15_10_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.exti15_10_isr = [14 x i8] c"exti15_10_isr\00"
define weak void @exti15_10_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.exti15_10_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setvalue(int, int);
void j_setvalue(int arg0, int arg1) { japi_setvalue(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setvalue>:
jmp    1030 <japi_setvalue@plt>

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

LLVM IR (-O2):
define void @j_setvalue(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setvalue(i32 %0, i32 %1)
ret void
}
int dereferenzierung_funktion(int a, int b) {
  int *zeiger;
  zeiger = &a;
  *zeiger = b;
  return a;
}


x86 assembly (clang, -O0):
<dereferenzierung_funktion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dereferenzierung_funktion(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
double sqrt(double);
double double_sqrt(double val) { return sqrt(val); }


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

x86 assembly (clang, -O2):
<double_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <double_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @double_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
int getFileLen2() {
  int a = 100;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @getFileLen2() {
ret i32 100
}
/* Variables and functions */
int UCHAR_MAX;
void maxise(unsigned char *aw, int w) {
  if (w > *aw) {
    if (w > UCHAR_MAX)
      w = UCHAR_MAX;
    *aw = w;
  }
}


x86 assembly (clang, -O0):
<maxise>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jle    1146 <maxise+0x46>
mov    -0xc(%rbp),%eax
mov    0x2ec9(%rip),%rcx
cmp    (%rcx),%eax
jle    113b <maxise+0x3b>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxise>:
movzbl (%rdi),%eax
cmp    %esi,%eax
jge    1118 <maxise+0x18>
mov    0x2ee2(%rip),%rax
mov    (%rax),%eax
cmp    %esi,%eax
cmovl  %eax,%esi
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
@UCHAR_MAX = global i32 0
define void @maxise(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %5, %8
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* @UCHAR_MAX
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* @UCHAR_MAX
store i32 %15, i32* %4
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %4
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %3
store i8 %18, i8* %19
br label %20
20: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
@UCHAR_MAX = global i32 0
define void @maxise(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i32, i32* @UCHAR_MAX
%8 = icmp slt i32 %7, %1
%9 = select i1 %8, i32 %7, i32 %1
%10 = trunc i32 %9 to i8
store i8 %10, i8* %0
br label %11
11: ; preds = %6, %2
ret void
}
unsigned long long asm_rdtscp(void) {
  unsigned hi, lo;
  __asm__ __volatile__("rdtscp" : "=a"(lo), "=d"(hi)::"rcx");
  return ((unsigned long long)lo) | (((unsigned long long)hi) << 32);
}


x86 assembly (clang, -O0):
<asm_rdtscp>:
push   %rbp
mov    %rsp,%rbp
rdtscp
mov    %eax,-0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asm_rdtscp>:
rdtscp
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @asm_rdtscp() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtscp", "={ax},={dx},~{rcx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %1
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @asm_rdtscp() {
%1 = tail call { i32, i32 } asm sideeffect "rdtscp", "={ax},={dx},~{rcx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
int addMoreInts(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<addMoreInts>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @addMoreInts(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int cos(int);
int sin(double);
double fprime2(double x) {
  return 8 * sin(x) + 4 * x * cos(x) + 4 - 4 * cos(2 * x);
}


x86 assembly (clang, -O0):
<fprime2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
shl    $0x3,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebd(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1040 <cos@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe72(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movsd  -0x10(%rbp),%xmm0
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprime2>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
shl    $0x3,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  0xeb0(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  (%rsp),%xmm0
addsd  0xe87(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
shl    $0x2,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fprime2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sin(double %3)
%5 = mul nsw i32 8, %4
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = fmul double 4.000000e+00, %7
%9 = load double, double* %2
%10 = fptosi double %9 to i32
%11 = call i32 @cos(i32 %10)
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double %8, double %12, double %6)
%14 = fadd double %13, 4.000000e+00
%15 = load double, double* %2
%16 = fmul double 2.000000e+00, %15
%17 = fptosi double %16 to i32
%18 = call i32 @cos(i32 %17)
%19 = mul nsw i32 4, %18
%20 = sitofp i32 %19 to double
%21 = fsub double %14, %20
ret double %21
}

LLVM IR (-O2):
define double @fprime2(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = shl nsw i32 %2, 3
%4 = sitofp i32 %3 to double
%5 = fmul double %0, 4.000000e+00
%6 = fptosi double %0 to i32
%7 = tail call i32 @cos(i32 %6)
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %5, double %8, double %4)
%10 = fadd double %9, 4.000000e+00
%11 = fmul double %0, 2.000000e+00
%12 = fptosi double %11 to i32
%13 = tail call i32 @cos(i32 %12)
%14 = shl nsw i32 %13, 2
%15 = sitofp i32 %14 to double
%16 = fsub double %10, %15
ret double %16
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x5e() {
  Assert_real((isgraph(94)),
              "/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_isgraph.c",
              475, ("isgraph should be 1 for ^"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x5e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5e,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1db,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x5e>:
push   %rax
mov    $0x5e,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1db,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for ^\00"
define void @t_isgraph_0x5e() {
%1 = call i32 @isgraph(i32 94)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 475, 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for ^\00"
define void @t_isgraph_0x5e() {
%1 = tail call i32 @isgraph(i32 94)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int vn_check_file_exist(const char *filepath) {
  if (0 == access(filepath, F_OK)) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<vn_check_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1148 <vn_check_file_exist+0x38>
movl   $0x0,-0x4(%rbp)
jmp    114f <vn_check_file_exist+0x3f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vn_check_file_exist>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @vn_check_file_exist(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  FILE *f;
  if ((f = fopen("/dev/null", "r")))
    puts("file is open");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115c <main+0x3c>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1145 <main+0x25>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [13 x i8] c"file is open\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [13 x i8] c"file is open\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int get_byte();
long get_long(void) {
  long lword;
  lword =
      (get_byte() << 24) + (get_byte() << 16) + (get_byte() << 8) + get_byte();
  return lword;
}


x86 assembly (clang, -O0):
<get_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <get_byte@plt>
shl    $0x18,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <get_byte@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_byte@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <get_byte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_long>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <get_byte@plt>
mov    %eax,%ebx
shl    $0x18,%ebx
xor    %eax,%eax
call   1030 <get_byte@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <get_byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1030 <get_byte@plt>
add    %ebx,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @get_long() {
%1 = alloca i64
%2 = call i32 (...) @get_byte()
%3 = shl i32 %2, 24
%4 = call i32 (...) @get_byte()
%5 = shl i32 %4, 16
%6 = add nsw i32 %3, %5
%7 = call i32 (...) @get_byte()
%8 = shl i32 %7, 8
%9 = add nsw i32 %6, %8
%10 = call i32 (...) @get_byte()
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
store i64 %12, i64* %1
%13 = load i64, i64* %1
ret i64 %13
}

LLVM IR (-O2):
define i64 @get_long() {
%1 = tail call i32 (...) @get_byte()
%2 = shl i32 %1, 24
%3 = tail call i32 (...) @get_byte()
%4 = shl i32 %3, 16
%5 = add nsw i32 %4, %2
%6 = tail call i32 (...) @get_byte()
%7 = shl i32 %6, 8
%8 = add nsw i32 %5, %7
%9 = tail call i32 (...) @get_byte()
%10 = add nsw i32 %8, %9
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint16_t load16_le(const uint8_t src[2]) {
  uint16_t w;
  memcpy(&w, src, sizeof w);
  return w;
}


x86 assembly (clang, -O0):
<load16_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load16_le>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @load16_le(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void printResult(int64_t counter) { printf("BL: %ld\n", counter); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"BL: %ld\0A\00"
define void @printResult(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ const INT16_MAX;
scalar_t__ const INT16_MIN;
int32_t __stdfix_sat_hk(const int32_t x) {
  if (x > INT16_MAX)
    return (INT16_MAX);
  if (x < INT16_MIN)
    return (INT16_MIN);
  return (x);
}


x86 assembly (clang, -O0):
<__stdfix_sat_hk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
jle    112f <__stdfix_sat_hk+0x2f>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <__stdfix_sat_hk+0x5e>
mov    -0x10(%rbp),%rax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
jge    1156 <__stdfix_sat_hk+0x56>
mov    0x2e8e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <__stdfix_sat_hk+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@INT16_MAX = constant i64 0
@INT16_MIN = constant i64 0
define i64 @__stdfix_sat_hk(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = load i64, i64* @INT16_MAX
%6 = icmp sgt i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i64, i64* @INT16_MAX
store i64 %8, i64* %2
br label %17
9: ; preds = %1
%10 = load i64, i64* %3
%11 = load i64, i64* @INT16_MIN
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i64, i64* @INT16_MIN
store i64 %14, i64* %2
br label %17
15: ; preds = %9
%16 = load i64, i64* %3
store i64 %16, i64* %2
br label %17
17: ; preds = %15, %13, %7
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
@INT16_MAX = constant i64 0
@INT16_MIN = constant i64 0
define i64 @__stdfix_sat_hk(i64 %0) {
ret i64 0
}
const char *sigutils_pkgversion(void) {
  return "custom build on "
         "Mar 16 2022"
         " at "
         "22:02:41"
         " ("
         "9.4.0"
         ")";
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"custom build on Mar 16 2022 at 22:02:41 (9.4.0)\00"
define i8* @sigutils_pkgversion() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [48 x i8] c"custom build on Mar 16 2022 at 22:02:41 (9.4.0)\00"
define i8* @sigutils_pkgversion() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fsize(char *);
int main(int argc, char **argv) {
  if (argc == 1)
    fsize(".");
  else
    while (--argc > 0)
      fsize(*++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)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <fsize@plt>
jmp    117a <main+0x6a>
jmp    1146 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1175 <main+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <fsize@plt>
jmp    1146 <main+0x36>
jmp    117a <main+0x6a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    1126 <main+0x16>
lea    0xee1(%rip),%rdi
call   1030 <fsize@plt>
jmp    1154 <main+0x44>
jle    1154 <main+0x44>
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 <fsize@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %8, label %16
6: ; preds = %2
%7 = tail call i32 @fsize(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %4, %8
%9 = phi i8** [ %12, %8 ], [ %1, %4 ]
%10 = phi i32 [ %11, %8 ], [ %0, %4 ]
%11 = add nsw i32 %10, -1
%12 = getelementptr inbounds i8*, i8** %9, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @fsize(i8* %13)
%15 = icmp ugt i32 %10, 2
br i1 %15, label %8, label %16
16: ; preds = %8, %4, %6
ret i32 0
}
/* Variables and functions */
char const *config_get(char const *);
int /*<<< orphan*/ printf(char *, char const *);
const char *dummy_get_config(const char *s) {
  printf("skin inspects setting `%s'\n", s);
  return config_get(s);
}


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

x86 assembly (clang, -O2):
<dummy_get_config>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <config_get@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"skin inspects setting `%s'\0A\00"
define i8* @dummy_get_config(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i8* @config_get(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
@.str = [28 x i8] c"skin inspects setting `%s'\0A\00"
define i8* @dummy_get_config(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* @config_get(i8* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
__attribute__((unused)) int UTIL_prepareFileList(const char *dirName,
                                                 char **bufStart, size_t *pos,
                                                 char **bufEnd) {
  (void)bufStart;
  (void)bufEnd;
  (void)pos;
  fprintf(
      stderr,
      "Directory %s ignored (lz4 compiled without _WIN32 or _POSIX_C_SOURCE)\n",
      dirName);
  return 0;
}


x86 assembly (clang, -O0):
<UTIL_prepareFileList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_prepareFileList>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [71 x i8] c"Directory %s ignored (lz4 compiled without _WIN32 or _POSIX_C_SOURCE)\0A\00"
define i32 @UTIL_prepareFileList(i8* %0, i8** %1, i64* %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i64*
%8 = alloca i8**
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i64* %2, i64** %7
store i8** %3, i8*** %8
%9 = load i8**, i8*** %6
%10 = load i8**, i8*** %8
%11 = load i64*, i64** %7
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [71 x i8] c"Directory %s ignored (lz4 compiled without _WIN32 or _POSIX_C_SOURCE)\0A\00"
define i32 @UTIL_prepareFileList(i8* %0, i8** nocapture readnone %1, i64* nocapture readnone %2, i8** nocapture readnone %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
void IN_Notebook(void) {}


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

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

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

LLVM IR (-O2):
define void @IN_Notebook() {
ret void
}
int db_exec(const char *q) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @db_exec(i8* nocapture readnone %0) {
ret i32 0
}