xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ foo(char const *);
int /*<<< orphan*/ xx_vprintf(int /*<<< orphan*/, int /*<<< orphan*/);
void __attribute__((format(printf, 1, 0))) foo2(const char *fmt, va_list va) {
  xx_vprintf(foo(fmt), va);
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <foo@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <xx_vprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rbx
mov    %esi,%ebx
call   1030 <foo@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <xx_vprintf@plt>

LLVM IR (-O0):
define void @foo2(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 = call i32 @foo(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @xx_vprintf(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @foo2(i8* %0, i32 %1) {
%3 = tail call i32 @foo(i8* %0)
%4 = tail call i32 @xx_vprintf(i32 %3, i32 %1)
ret void
}
/* Variables and functions */
float __nv_expm1f(float);
float expm1f(float __a) { return __nv_expm1f(__a); }


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

x86 assembly (clang, -O2):
<expm1f>:
jmp    1030 <__nv_expm1f@plt>

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

LLVM IR (-O2):
define float @expm1f(float %0) {
%2 = tail call float @__nv_expm1f(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(int, char *);
void deltas_stop_thread(void) {
  msg(0x100, "deltas_stop_thread called\n");
  exit(1);
}


x86 assembly (clang, -O0):
<deltas_stop_thread>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100,%edi
lea    0xed0(%rip),%rsi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
@.str = [27 x i8] c"deltas_stop_thread called\0A\00"
define void @deltas_stop_thread() {
%1 = call i32 @msg(i32 256, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"deltas_stop_thread called\0A\00"
define void @deltas_stop_thread() {
%1 = tail call i32 @msg(i32 256, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int minitest_fail(char const *, char const *, int);
int minitest_pass(char const *);
int assert_null(void *actual, const char *msg, const char *caller, int line) {
  if ((actual) == NULL) {
    return minitest_pass(msg);
  } else {
    return minitest_fail(msg, caller, line);
  }
}


x86 assembly (clang, -O0):
<assert_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <assert_null+0x33>
mov    -0x18(%rbp),%rdi
call   1030 <minitest_pass@plt>
mov    %eax,-0x4(%rbp)
jmp    1166 <assert_null+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <minitest_fail@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_null>:
test   %rdi,%rdi
je     1132 <assert_null+0x12>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1040 <minitest_fail@plt>
mov    %rsi,%rdi
jmp    1030 <minitest_pass@plt>

LLVM IR (-O0):
define i32 @assert_null(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %7
%14 = call i32 @minitest_pass(i8* %13)
store i32 %14, i32* %5
br label %20
15: ; preds = %4
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = load i32, i32* %9
%19 = call i32 @minitest_fail(i8* %16, i8* %17, i32 %18)
store i32 %19, i32* %5
br label %20
20: ; preds = %15, %12
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @assert_null(i8* readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @minitest_pass(i8* %1)
br label %10
8: ; preds = %4
%9 = tail call i32 @minitest_fail(i8* %1, i8* %2, i32 %3)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
int fun1216() { return 1216; }


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

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

LLVM IR (-O0):
define i32 @fun1216() {
ret i32 1216
}

LLVM IR (-O2):
define i32 @fun1216() {
ret i32 1216
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int ispow2_64(uint64_t n) { return (n & (n - 1)) == 0; }


x86 assembly (clang, -O0):
<ispow2_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispow2_64>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ispow2_64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ispow2_64(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double *c_dwt_worker(int, double *, int, double *, int);
double *c_dwt(double *ls, int ln, double *xs, int xn) {
  int lm = 0;
  return c_dwt_worker(lm, ls, ln, xs, xn);
}


x86 assembly (clang, -O0):
<c_dwt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <c_dwt_worker@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dwt>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <c_dwt_worker@plt>

LLVM IR (-O0):
define double* @c_dwt(double* %0, i32 %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store double* %2, double** %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %9
%11 = load double*, double** %5
%12 = load i32, i32* %6
%13 = load double*, double** %7
%14 = load i32, i32* %8
%15 = call double* @c_dwt_worker(i32 %10, double* %11, i32 %12, double* %13, i32 %14)
ret double* %15
}

LLVM IR (-O2):
define double* @c_dwt(double* %0, i32 %1, double* %2, i32 %3) {
%5 = tail call double* @c_dwt_worker(i32 0, double* %0, i32 %1, double* %2, i32 %3)
ret double* %5
}
int is_space_char(char c) { return (c == ':'); }


x86 assembly (clang, -O0):
<is_space_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space_char>:
xor    %eax,%eax
cmp    $0x3a,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_space_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 58
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_space_char(i8 signext %0) {
%2 = icmp eq i8 %0, 58
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int SX1257Read(int);
int /*<<< orphan*/ SX1257Write(int, int);
void SX1257SetStby(void) { SX1257Write(0x00, (SX1257Read(0x00) | 0b00000001)); }


x86 assembly (clang, -O0):
<SX1257SetStby>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <SX1257Read@plt>
mov    %eax,%esi
or     $0x1,%esi
xor    %edi,%edi
call   1030 <SX1257Write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SX1257SetStby>:
push   %rax
xor    %edi,%edi
call   1040 <SX1257Read@plt>
or     $0x1,%eax
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <SX1257Write@plt>

LLVM IR (-O0):
define void @SX1257SetStby() {
%1 = call i32 @SX1257Read(i32 0)
%2 = or i32 %1, 1
%3 = call i32 @SX1257Write(i32 0, i32 %2)
ret void
}

LLVM IR (-O2):
define void @SX1257SetStby() {
%1 = tail call i32 @SX1257Read(i32 0)
%2 = or i32 %1, 1
%3 = tail call i32 @SX1257Write(i32 0, i32 %2)
ret void
}
unsigned int read_u32(unsigned char *src) {
  return (src[0] << 0) + (src[1] << 8) + (src[2] << 16) + (src[3] << 24);
}


x86 assembly (clang, -O0):
<read_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read_u32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 0
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 16
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 24
%25 = add nsw i32 %19, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @read_u32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, float);
int /*<<< orphan*/ stderr;
void usage(char *argv0, float threshold) {
  char *help =
      "Usage: %s [switches] -i filename -n num_clusters\n"
      "       -i filename    : file containing data to be clustered\n"
      "       -b             : input file is in binary format (default no)\n"
      "       -n num_clusters: number of clusters (K must > 1)\n"
      "       -t threshold   : threshold value (default %.4f)\n"
      "       -o             : output timing results (default no)\n"
      "       -d             : enable debug mode\n";
  fprintf(stderr, help, argv0, threshold);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
movss  -0xc(%rbp),%xmm0
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [391 x i8] c"Usage: %s [switches] -i filename -n num_clusters\0A -i filename : file containing data to be clustered\0A -b : input file is in binary format (default no)\0A -n num_clusters: number of clusters (K must > 1)\0A -t threshold : threshold value (default %.4f)\0A -o : output timing results (default no)\0A -d : enable debug mode\0A\00"
@stderr = global i32 0
define void @usage(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca i8*
store i8* %0, i8** %3
store float %1, float* %4
store i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = load float, float* %4
%10 = call i32 @fprintf(i32 %6, i8* %7, i8* %8, float %9)
%11 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [391 x i8] c"Usage: %s [switches] -i filename -n num_clusters\0A -i filename : file containing data to be clustered\0A -b : input file is in binary format (default no)\0A -n num_clusters: number of clusters (K must > 1)\0A -t threshold : threshold value (default %.4f)\0A -o : output timing results (default no)\0A -d : enable debug mode\0A\00"
@stderr = global i32 0
define void @usage(i8* %0, float %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([391 x i8], [391 x i8]* @.str, i64 0, i64 0), i8* %0, float %1)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
BOOST_AUTO_TEST_CASE(cot) {}


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

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

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

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void display_clear(uint32_t color) {
  *((volatile uint32_t *)((void *)((char *)(0x040000c0 << 2) +
                                   (0x00000000 << 2)))) = color;
}


x86 assembly (clang, -O0):
<display_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x10000300,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_clear>:
mov    %edi,0x10000300
ret

LLVM IR (-O0):
define void @display_clear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 268436224 to i32*)
ret void
}

LLVM IR (-O2):
define void @display_clear(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 268436224 to i32*)
ret void
}
void MirrorUVRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @MirrorUVRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Printf(char *, int);
void ycwi(int x) { Printf("You can't wield item %c!", x); }


x86 assembly (clang, -O0):
<ycwi>:
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):
<ycwi>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <Printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"You can't wield item %c!\00"
define void @ycwi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"You can't wield item %c!\00"
define void @ycwi(i32 %0) {
%2 = tail call i32 @Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cls();
int /*<<< orphan*/ pausar();
int /*<<< orphan*/ printf(char *);
void ayuda(void) {
  cls();
  printf("7-seg");
  printf("[Commands]\n z : exit\n h : displays help \n x : change current "
         "display\n t : show table (wincupl code)\n i : modify index\n k : "
         "toggle between common anode/cathode\n");
  pausar();
}


x86 assembly (clang, -O0):
<ayuda>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <cls@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pausar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ayuda>:
push   %rax
xor    %eax,%eax
call   1060 <cls@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <pausar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"7-seg\00"
@.str.1 = [160 x i8] c"[Commands]\0A z : exit\0A h : displays help \0A x : change current display\0A t : show table (wincupl code)\0A i : modify index\0A k : toggle between common anode/cathode\0A\00"
define void @ayuda() {
%1 = call i32 (...) @cls()
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @pausar()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"7-seg\00"
@str = [159 x i8] c"[Commands]\0A z : exit\0A h : displays help \0A x : change current display\0A t : show table (wincupl code)\0A i : modify index\0A k : toggle between common anode/cathode\00"
define void @ayuda() {
%1 = tail call i32 (...) @cls()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([159 x i8], [159 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @pausar()
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ hi();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", add(1, 2));
  hi();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <hi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <hi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @add(i32 1, i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @hi()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @hi()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xed() {
  Assert_real((isbdigit(237) == 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_isbdigit.c",
              1190, ("isbdigit should be 0 for 0xed"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xed>:
push   %rax
mov    $0xed,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4a6,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xed\00"
define void @t_isbdigit_0xed() {
%1 = call i64 @isbdigit(i32 237)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xed\00"
define void @t_isbdigit_0xed() {
%1 = tail call i64 @isbdigit(i32 237)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int _check_for(int, int, int, int /*<<< orphan*/, char *);
bool check_enosys(int msb, int nr) {
  return _check_for(msb, nr, nr, -ENOSYS, "-ENOSYS");
}


x86 assembly (clang, -O0):
<check_enosys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
mov    0x2eb8(%rip),%rax
sub    (%rax),%ecx
lea    0xec7(%rip),%r8
call   1030 <_check_for@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_enosys>:
mov    0x2ed1(%rip),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
lea    0xede(%rip),%r8
mov    %esi,%edx
jmp    1030 <_check_for@plt>

LLVM IR (-O0):
@ENOSYS = global i32 0
@.str = [8 x i8] c"-ENOSYS\00"
define i32 @check_enosys(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 = load i32, i32* %4
%8 = load i32, i32* @ENOSYS
%9 = sub nsw i32 0, %8
%10 = call i32 @_check_for(i32 %5, i32 %6, i32 %7, i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %10
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@.str = [8 x i8] c"-ENOSYS\00"
define i32 @check_enosys(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
%5 = tail call i32 @_check_for(i32 %0, i32 %1, i32 %1, i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %5
}
void init_lcm_registers(void) {}


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

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

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

LLVM IR (-O2):
define void @init_lcm_registers() {
ret void
}
extern int Max(int i1, int i2) { return i1 >= i2 ? i1 : i2; }


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <Max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <Max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @Max(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 = icmp sge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @Max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DebugLogEntryHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void DebugLogEntryUpdated() { UAVObjUpdated(DebugLogEntryHandle()); }


x86 assembly (clang, -O0):
<DebugLogEntryUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DebugLogEntryHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DebugLogEntryUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <DebugLogEntryHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @DebugLogEntryUpdated() {
%1 = call i32 (...) @DebugLogEntryHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DebugLogEntryUpdated() {
%1 = tail call i32 (...) @DebugLogEntryHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void gtk_about_dialog_set_comments() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_set_comments() {
ret void
}
/* Variables and functions */
int bbm_bulk_read(void *, unsigned short, unsigned char *, unsigned short);
int bbm_com_bulk_read(void *handle, unsigned short addr, unsigned char *data,
                      unsigned short size) {
  int res;
  res = bbm_bulk_read(handle, addr, data, size);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_bulk_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
movzwl -0x1a(%rbp),%ecx
call   1030 <bbm_bulk_read@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_bulk_read>:
jmp    1030 <bbm_bulk_read@plt>

LLVM IR (-O0):
define i32 @bbm_com_bulk_read(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i8*, i8** %7
%13 = load i16, i16* %8
%14 = call i32 @bbm_bulk_read(i8* %10, i16 zeroext %11, i8* %12, i16 zeroext %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_bulk_read(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3) {
%5 = tail call i32 @bbm_bulk_read(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3)
ret i32 %5
}
float test4f(float a) { return __builtin_copysignf(a, -1.0); }


x86 assembly (clang, -O0):
<test4f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4f>:
orps   0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @test4f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.copysign.f32(float %3, float -1.000000e+00)
ret float %4
}

LLVM IR (-O2):
define float @test4f(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
%3 = fneg float %2
ret float %3
}
/* Variables and functions */
scalar_t__ floor(int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(int);
int isSquare(int n) {
  int root = (int)floor(sqrt(n));
  if (root * root == n)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%edi
call   1040 <floor@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1159 <isSquare+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1160 <isSquare+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSquare>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %eax,%edi
call   1040 <floor@plt>
imul   %eax,%eax
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isSquare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @sqrt(i32 %5)
%7 = call i64 @floor(i32 %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 1, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @isSquare(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = tail call i64 @floor(i32 %2)
%4 = trunc i64 %3 to i32
%5 = mul nsw i32 %4, %4
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *create_string(size_t len) { return (char *)malloc(len + 1); }


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

x86 assembly (clang, -O2):
<create_string>:
add    $0x1,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @create_string(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @create_string(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int bishop_attacks(int, int);
int rook_attacks(int, int);
uint64_t queen_attacks(uint64_t occupied_squares, int square) {
  return bishop_attacks(occupied_squares, square) |
         rook_attacks(occupied_squares, square);
}


x86 assembly (clang, -O0):
<queen_attacks>:
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 <bishop_attacks@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <rook_attacks@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queen_attacks>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <bishop_attacks@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <rook_attacks@plt>
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @queen_attacks(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 @bishop_attacks(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @rook_attacks(i32 %8, i32 %9)
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @queen_attacks(i32 %0, i32 %1) {
%3 = tail call i32 @bishop_attacks(i32 %0, i32 %1)
%4 = tail call i32 @rook_attacks(i32 %0, i32 %1)
%5 = or i32 %4, %3
ret i32 %5
}
void ff_hevc_put_hevc_uni_w_qpel_hv4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv4_10_sse4() {
ret void
}
int get_sensor_data() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_sensor_data() {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *block_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<block_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @block_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @block_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int ft_isascii(int c) { return (c >= 0 && c <= 127); }


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isascii+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
void PDMR3ThreadDestroy(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ htobe64(int /*<<< orphan*/);
void knot_wire_write_u64(uint8_t *pos, uint64_t data) {
  *(uint64_t *)pos = htobe64(data);
}


x86 assembly (clang, -O0):
<knot_wire_write_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htobe64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_write_u64>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htobe64@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @knot_wire_write_u64(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htobe64(i32 %1)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]...\n\n     false does nothing, unsuccessfully \n  "
         "   command line arguments are ignored \n\n     -h, --help\t\tdisplay "
         "this help\n     -V, --version\tdisplay version information\n\n     "
         "Report bugs to <bulliver@gmail.com>\n",
         "false");
}


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

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

LLVM IR (-O0):
@.str = [231 x i8] c"Usage: %s [OPTION]...\0A\0A false does nothing, unsuccessfully \0A command line arguments are ignored \0A\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [6 x i8] c"false\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [231 x i8] c"Usage: %s [OPTION]...\0A\0A false does nothing, unsuccessfully \0A command line arguments are ignored \0A\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [6 x i8] c"false\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
void dummy_cb(evutil_socket_t fd, short what, void *ctx) {
  (void)fd;
  (void)what;
  (void)ctx;
}


x86 assembly (clang, -O0):
<dummy_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i16, i16* %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @dummy_cb(i32 %0, i16 signext %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct iovec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int readv(int, struct iovec const *, int);
void vread(int fd, const struct iovec *iov, int cnt) {
  int ret = 0;
  ret = readv(fd, iov, cnt);
  if (ret <= 0)
    printf("read none %d\n", ret);
}


x86 assembly (clang, -O0):
<vread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <readv@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1164 <vread+0x44>
mov    -0x18(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vread>:
push   %rax
call   1040 <readv@plt>
test   %eax,%eax
jle    112c <vread+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
@.str = [14 x i8] c"read none %d\0A\00"
define void @vread(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load %struct.iovec*, %struct.iovec** %5
%10 = load i32, i32* %6
%11 = call i32 @readv(i32 %8, %struct.iovec* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* %7
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@.str = [14 x i8] c"read none %d\0A\00"
define void @vread(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = tail call i32 @readv(i32 %0, %struct.iovec* %1, i32 %2)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const unsigned char *p = s;
  while (n-- != 0) {
    if ((unsigned char)c == *p++) {
      return (void *)(p - 1);
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1166 <memchr+0x66>
mov    -0x14(%rbp),%eax
movzbl %al,%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1161 <memchr+0x61>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    116e <memchr+0x6e>
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sub    $0x1,%rdx
jb     1124 <memchr+0x24>
lea    0x1(%rdi),%rax
cmp    %sil,0x1(%rdi)
mov    %rax,%rdi
jne    1110 <memchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
br label %5
5: ; preds = %9, %3
%6 = phi i64 [ %2, %3 ], [ %10, %9 ]
%7 = phi i8* [ %0, %3 ], [ %11, %9 ]
%8 = icmp eq i64 %6, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add i64 %6, -1
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %7
%13 = icmp eq i8 %12, %4
br i1 %13, label %14, label %5
14: ; preds = %5, %9
%15 = phi i8* [ %7, %9 ], [ null, %5 ]
ret i8* %15
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_add_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "ADD   A, "
          "0x%02X"
          "                   ",
          direct);
}


x86 assembly (clang, -O0):
<fprint_add_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_add_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ADD A, 0x%02X \00"
define void @fprint_add_direct(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 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ADD A, 0x%02X \00"
define void @fprint_add_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i, j;
  i = 1;
  j = 0;
  printf("Starting\n");
  printf("Before divide...");
  i = i / j;
  printf("After\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Before divide...\00"
@str = [9 x i8] c"Starting\00"
@str.3 = [6 x i8] c"After\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned short inw(int);
int /*<<< orphan*/ outl(int, int);
unsigned short pci_read_config16(unsigned addr) {
  outl(0x80000000 | (addr & ~3), 0xCF8);
  return inw(0xCFC + (addr & 2));
}


x86 assembly (clang, -O0):
<pci_read_config16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xfffffffc,%edi
or     $0x80000000,%edi
mov    $0xcf8,%esi
call   1040 <outl@plt>
mov    -0x4(%rbp),%edi
and    $0x2,%edi
add    $0xcfc,%edi
call   1030 <inw@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_read_config16>:
push   %rbx
mov    %edi,%ebx
and    $0x7ffffffc,%edi
or     $0x80000000,%edi
mov    $0xcf8,%esi
call   1040 <outl@plt>
and    $0x2,%ebx
or     $0xcfc,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <inw@plt>

LLVM IR (-O0):
define zeroext i16 @pci_read_config16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -4
%5 = or i32 -2147483648, %4
%6 = call i32 @outl(i32 %5, i32 3320)
%7 = load i32, i32* %2
%8 = and i32 %7, 2
%9 = add i32 3324, %8
%10 = call zeroext i16 @inw(i32 %9)
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @pci_read_config16(i32 %0) {
%2 = and i32 %0, 2147483644
%3 = or i32 %2, -2147483648
%4 = tail call i32 @outl(i32 %3, i32 3320)
%5 = and i32 %0, 2
%6 = or i32 %5, 3324
%7 = tail call zeroext i16 @inw(i32 %6)
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int (*f())[10] {
  static int buf[10];
  printf("Betelgeuse\n");
  return &buf;
}


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

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

LLVM IR (-O0):
@f.buf = internal global [10 x i32] zeroinitializer
@.str = [12 x i8] c"Betelgeuse\0A\00"
define [10 x i32]* @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret [10 x i32]* @f.buf
}

LLVM IR (-O2):
@f.buf = internal global [10 x i32] zeroinitializer
@str = [11 x i8] c"Betelgeuse\00"
define [10 x i32]* @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret [10 x i32]* @f.buf
}