xunge/DecIR huggingface dataset:
/* Variables and functions */
float __nv_ceilf(float);
float ceilf(float __a) { return __nv_ceilf(__a); }


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

x86 assembly (clang, -O2):
<ceilf>:
jmp    1030 <__nv_ceilf@plt>

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

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = tail call float @__nv_ceilf(float %0)
ret float %2
}
void BIO_s_file(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_s_file() {
ret void
}
int test_imm_CDuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xCD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CDuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 880468295680
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int trap_CIN_PlayCinematic(char const *, float, float, float, float, int);
int UI_PlayCinematic(const char *name, float x, float y, float w, float h) {
  return trap_CIN_PlayCinematic(name, x, y, w, h, (2 | 8));
}


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

x86 assembly (clang, -O2):
<UI_PlayCinematic>:
mov    $0xa,%esi
jmp    1030 <trap_CIN_PlayCinematic@plt>

LLVM IR (-O0):
define i32 @UI_PlayCinematic(i8* %0, float %1, float %2, float %3, float %4) {
%6 = alloca i8*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i8* %0, i8** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load i8*, i8** %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = load float, float* %9
%15 = load float, float* %10
%16 = call i32 @trap_CIN_PlayCinematic(i8* %11, float %12, float %13, float %14, float %15, i32 10)
ret i32 %16
}

LLVM IR (-O2):
define i32 @UI_PlayCinematic(i8* %0, float %1, float %2, float %3, float %4) {
%6 = tail call i32 @trap_CIN_PlayCinematic(i8* %0, float %1, float %2, float %3, float %4, i32 10)
ret i32 %6
}
int main() { return 37; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 37
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int htonl(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  uint32_t a = 0x12345678;
  printf("0x%x\n", *(uint8_t *)&a);
  uint32_t b;
  b = htonl(a);
  printf("0x%x\n", *(uint8_t *)&b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x12345678,%esi
call   1030 <printf@plt>
mov    $0x12345678,%edi
call   1040 <htonl@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 305419896)
%2 = tail call i32 @htonl(i32 305419896)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_serial(int serfd) {
  if (serfd < 0)
    return;
  close(serfd);
}


x86 assembly (clang, -O0):
<close_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <close_serial+0x1a>
jmp    1132 <close_serial+0x22>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_serial>:
test   %edi,%edi
js     1119 <close_serial+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @close_serial(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @close_serial(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
unsigned int NullTextWidth(struct ADrawTag *ctx __attribute__((unused)),
                           const char *string __attribute__((unused))) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ADrawTag = type opaque
define i32 @NullTextWidth(%struct.ADrawTag* %0, i8* %1) {
%3 = alloca %struct.ADrawTag*
%4 = alloca i8*
store %struct.ADrawTag* %0, %struct.ADrawTag** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.ADrawTag = type opaque
define i32 @NullTextWidth(%struct.ADrawTag* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz8_set_int(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                                int, int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/, int);
void mpz8_set_sub(mpz_t z[8]) { mpz8_set_int(z, 0, 1, -1, 0, 0, 0, 0, 1); }


x86 assembly (clang, -O0):
<mpz8_set_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %r9d,%r9d
mov    $0x1,%edx
mov    $0xffffffff,%ecx
mov    %r9d,%esi
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x1,0x10(%rsp)
call   1030 <mpz8_set_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz8_set_sub>:
push   %rax
sub    $0x8,%rsp
xor    %esi,%esi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x1
push   $0x0
push   $0x0
call   1030 <mpz8_set_int@plt>
add    $0x20,%rsp
pop    %rax
ret

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

LLVM IR (-O2):
define void @mpz8_set_sub(i32* %0) {
%2 = tail call i32 @mpz8_set_int(i32* %0, i32 0, i32 1, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 1)
ret void
}
/* Type definitions */
struct vli_writer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct vli_writer *);
void delete_vli_writer(struct vli_writer *vli) { free(vli); }


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

x86 assembly (clang, -O2):
<delete_vli_writer>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.vli_writer = type { i32 }
define void @delete_vli_writer(%struct.vli_writer* %0) {
%2 = alloca %struct.vli_writer*
store %struct.vli_writer* %0, %struct.vli_writer** %2
%3 = load %struct.vli_writer*, %struct.vli_writer** %2
%4 = call i32 @free(%struct.vli_writer* %3)
ret void
}

LLVM IR (-O2):
%struct.vli_writer = type { i32 }
define void @delete_vli_writer(%struct.vli_writer* nocapture %0) {
%2 = tail call i32 @free(%struct.vli_writer* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *afio_get_EXTICR3() {
  return mem_get_reg32(0x40010000 + 0x10);
}


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

x86 assembly (clang, -O2):
<afio_get_EXTICR3>:
mov    $0x40010010,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @afio_get_EXTICR3() {
%1 = call i32* @mem_get_reg32(i32 1073807376)
ret i32* %1
}

LLVM IR (-O2):
define i32* @afio_get_EXTICR3() {
%1 = tail call i32* @mem_get_reg32(i32 1073807376)
ret i32* %1
}
void Prep_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @Prep_terminate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void FingerboardViolin(double boardLength) {
  printf("Dlugosc podstrunnicy skrzypiec wynosi: %lf\n\n",
         (boardLength * 3) / 4);
}


x86 assembly (clang, -O0):
<FingerboardViolin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"Dlugosc podstrunnicy skrzypiec wynosi: %lf\0A\0A\00"
define void @FingerboardViolin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.000000e+00
%5 = fdiv double %4, 4.000000e+00
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %5)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Dlugosc podstrunnicy skrzypiec wynosi: %lf\0A\0A\00"
define void @FingerboardViolin(double %0) {
%2 = fmul double %0, 3.000000e+00
%3 = fmul double %2, 2.500000e-01
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: dumpchk [-vxworks|-dryos|-fix] [-quiet] <dump>\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: dumpchk [-vxworks|-dryos|-fix] [-quiet] <dump>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: dumpchk [-vxworks|-dryos|-fix] [-quiet] <dump>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned test18(int cond) {
  int a[4], b[4];
  return __builtin_object_size(cond ? a : b, 0);
}


x86 assembly (clang, -O0):
<test18>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111e <test18+0x1e>
lea    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1126 <test18+0x26>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test18(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca [4 x i32]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
br label %11
9: ; preds = %1
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
br label %11
11: ; preds = %9, %7
%12 = phi i32* [ %8, %7 ], [ %10, %9 ]
%13 = bitcast i32* %12 to i8*
%14 = call i64 @llvm.objectsize.i64.p0i8(i8* %13, i1 false, i1 true, i1 false)
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @test18(i32 %0) {
ret i32 16
}
int test_imm_E7uint8_reg(unsigned char val) {
  return ((val) & (-0xE7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E7uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff19,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E7uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 25
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_time_str(char *buf, int size) {
  time_t time_buf;
  struct tm tm_buf;
  time(&time_buf);
  localtime_r(&time_buf, &tm_buf);
  strftime(buf, size, "%Y-%m-%d %H:%M:%S", &tm_buf);
}


x86 assembly (clang, -O0):
<get_time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <time@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_str>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %rsp,%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <localtime_r@plt>
lea    0xea2(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define void @get_time_str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.tm
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @time(i32* %5)
%8 = call i32 @localtime_r(i32* %5, %struct.tm* %6)
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @strftime(i8* %9, i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define void @get_time_str(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.tm
%5 = bitcast i32* %3 to i8*
%6 = bitcast %struct.tm* %4 to i8*
%7 = call i32 @time(i32* %3)
%8 = call i32 @localtime_r(i32* %3, %struct.tm* %4)
%9 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret void
}
void ff_hevc_put_hevc_uni_w_epel_v48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v48_10_sse4() {
ret void
}
const char *build_date() { return "Mar 17 2022"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Mar 17 2022\00"
define i8* @build_date() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"Mar 17 2022\00"
define i8* @build_date() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
unsigned xrop3_72_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk1 = S & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_72_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_72_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = and i32 %39, %40
%42 = or i32 %38, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_72_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
void f3(void) {
  f1();
  f2();
}


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

x86 assembly (clang, -O2):
<f3>:
push   %rax
xor    %eax,%eax
call   1040 <f1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <f2@plt>

LLVM IR (-O0):
define void @f3() {
%1 = call i32 (...) @f1()
%2 = call i32 (...) @f2()
ret void
}

LLVM IR (-O2):
define void @f3() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
ret void
}
int is_meas(char sig) {
  return sig == 'c' || sig == 'C' || sig == '1' || sig == '2' || sig == '3' ||
         sig == '5' || sig == 'l';
}


x86 assembly (clang, -O0):
<is_meas>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x63,%ecx
mov    %al,-0x2(%rbp)
je     1183 <is_meas+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x43,%ecx
mov    %al,-0x2(%rbp)
je     1183 <is_meas+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x31,%ecx
mov    %al,-0x2(%rbp)
je     1183 <is_meas+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x32,%ecx
mov    %al,-0x2(%rbp)
je     1183 <is_meas+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x33,%ecx
mov    %al,-0x2(%rbp)
je     1183 <is_meas+0x83>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x35,%ecx
mov    %al,-0x2(%rbp)
je     1183 <is_meas+0x83>
movsbl -0x1(%rbp),%eax
cmp    $0x6c,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_meas>:
lea    -0x31(%rdi),%ecx
cmp    $0x32,%cl
ja     1121 <is_meas+0x21>
mov    $0x1,%eax
movzbl %cl,%ecx
movabs $0x4000000040017,%rdx
bt     %rcx,%rdx
jae    1121 <is_meas+0x21>
ret
xor    %eax,%eax
cmp    $0x6c,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_meas(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, 99
br i1 %5, label %30, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 67
br i1 %9, label %30, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 49
br i1 %13, label %30, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 50
br i1 %17, label %30, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 51
br i1 %21, label %30, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 53
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 108
br label %30
30: ; preds = %26, %22, %18, %14, %10, %6, %1
%31 = phi i1 [ true, %22 ], [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @is_meas(i8 signext %0) {
switch i8 %0, label %2 [
i8 99, label %5
i8 67, label %5
i8 53, label %5
i8 51, label %5
i8 50, label %5
i8 49, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 108
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int io_seek(int index, int off) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @io_seek(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
int stringsEqual(char *, char *);
bool constStringsEqual(const char *constStr1, const char *constStr2) {
  char *str1 = strdup(constStr1);
  char *str2 = strdup(constStr2);
  return stringsEqual(str1, str2);
}


x86 assembly (clang, -O0):
<constStringsEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <stringsEqual@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constStringsEqual>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <stringsEqual@plt>

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

LLVM IR (-O2):
define i32 @constStringsEqual(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i8* @strdup(i8* %0)
%4 = tail call i8* @strdup(i8* %1)
%5 = tail call i32 @stringsEqual(i8* %3, i8* %4)
ret i32 %5
}
void g_arith_pow_f(void *s, void *d, void *o) {}


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

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

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

LLVM IR (-O2):
define void @g_arith_pow_f(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
signed int strlen_rom(const char *text) {
  signed int i;
  for (i = 0; text[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen_rom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strlen_rom+0x37>
jmp    1129 <strlen_rom+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen_rom+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_rom>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen_rom+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen_rom(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int proc_3(int /*<<< orphan*/, int, int);
int proc_2(jmp_buf env, int i, int j, int k) {
  return proc_3(env, i, k) + proc_3(env, j, k);
}


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

x86 assembly (clang, -O2):
<proc_2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %edi,%ebp
mov    %ecx,%edx
call   1030 <proc_3@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <proc_3@plt>
add    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @proc_2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @proc_3(i32 %0, i32 %1, i32 %3)
%6 = tail call i32 @proc_3(i32 %0, i32 %2, i32 %3)
%7 = add nsw i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int particion(int *, int);
void quicksort(int *l, int tam) {
  if (tam <= 1)
    return;
  int part = particion(l, tam);
  quicksort(l, part);
  quicksort(&l[part + 1], tam - (part + 1));
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <quicksort+0x1e>
jmp    117c <quicksort+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <particion@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
add    $0x1,%eax
sub    %eax,%esi
call   1030 <quicksort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     115f <quicksort+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <particion@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <quicksort@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %eax
add    %r14d,%eax
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1130 <quicksort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @particion(i32* %6, i32 %5)
tail call void @quicksort(i32* %6, i32 %7)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %6, i64 %9
%11 = sub nsw i32 %5, %8
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __UHSUB16(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = ((((x << 16) >> 16) - ((y << 16) >> 16)) >> 1) & 0x0000FFFF;
  s = ((((x) >> 16) - ((y) >> 16)) >> 1) & 0x0000FFFF;
  return ((s << 16) | (r));
}


x86 assembly (clang, -O0):
<__UHSUB16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
sar    $0x10,%ecx
sub    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
sub    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__UHSUB16>:
movswl %di,%eax
movswl %si,%ecx
sub    %ecx,%eax
shr    %eax
movzwl %ax,%eax
sar    $0x10,%edi
sar    $0x10,%esi
sub    %esi,%edi
and    $0xfffffffe,%edi
shl    $0xf,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__UHSUB16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = shl i32 %7, 16
%9 = ashr i32 %8, 16
%10 = load i32, i32* %4
%11 = shl i32 %10, 16
%12 = ashr i32 %11, 16
%13 = sub nsw i32 %9, %12
%14 = ashr i32 %13, 1
%15 = and i32 %14, 65535
store i32 %15, i32* %5
%16 = load i32, i32* %3
%17 = ashr i32 %16, 16
%18 = load i32, i32* %4
%19 = ashr i32 %18, 16
%20 = sub nsw i32 %17, %19
%21 = ashr i32 %20, 1
%22 = and i32 %21, 65535
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = shl i32 %23, 16
%25 = load i32, i32* %5
%26 = or i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @__UHSUB16(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = shl i32 %1, 16
%6 = ashr exact i32 %5, 16
%7 = sub nsw i32 %4, %6
%8 = lshr i32 %7, 1
%9 = and i32 %8, 65535
%10 = ashr i32 %0, 16
%11 = ashr i32 %1, 16
%12 = sub nsw i32 %10, %11
%13 = shl nsw i32 %12, 15
%14 = and i32 %13, -65536
%15 = or i32 %9, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, World!\n");
  return 0x1234;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 4660
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 4660
}
int min(int n, int v[]) {
  if (n == 1) {
    return v[0];
  } else {
    int x = min(n - 1, v);
    if (x > v[n - 1]) {
      return v[n - 1];
    } else {
      return x;
    }
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1137 <min+0x27>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <min+0x70>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <min@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    117a <min+0x6a>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <min+0x70>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x1,%edi
jne    1121 <min+0x11>
mov    (%r14),%eax
jmp    113b <min+0x2b>
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <min@plt>
movslq %ebx,%rcx
mov    -0x4(%r14,%rcx,4),%ecx
cmp    %ecx,%eax
cmovg  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @min(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
store i32 %12, i32* %3
br label %35
13: ; preds = %2
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = load i32*, i32** %5
%17 = call i32 @min(i32 %15, i32* %16)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = load i32*, i32** %5
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
%24 = load i32, i32* %23
%25 = icmp sgt i32 %18, %24
br i1 %25, label %26, label %33
26: ; preds = %13
%27 = load i32*, i32** %5
%28 = load i32, i32* %4
%29 = sub nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %27, i64 %30
%32 = load i32, i32* %31
store i32 %32, i32* %3
br label %35
33: ; preds = %13
%34 = load i32, i32* %6
store i32 %34, i32* %3
br label %35
35: ; preds = %33, %26, %9
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* %1
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %15, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = add nsw i32 %0, -1
%10 = tail call i32 @min(i32 %9, i32* %1)
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i32, i32* %1, i64 %11
%13 = load i32, i32* %12
%14 = icmp sgt i32 %10, %13
%15 = select i1 %14, i32 %13, i32 %10
br label %6
}
/* Variables and functions */
bool is_length(char c) { return (c == 'h' || c == 'l' || c == 'L'); }


x86 assembly (clang, -O0):
<is_length>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x68,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_length+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6c,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_length+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x4c,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_length>:
mov    %edi,%eax
and    $0xfb,%al
cmp    $0x68,%al
sete   %al
cmp    $0x4c,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_length(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, 104
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 108
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 76
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_length(i8 signext %0) {
%2 = and i8 %0, -5
%3 = icmp eq i8 %2, 104
%4 = icmp eq i8 %0, 76
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void quat_set_identity(float q[4]) {
  q[0] = 1;
  q[1] = 0;
  q[2] = 0;
  q[3] = 0;
}


x86 assembly (clang, -O0):
<quat_set_identity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_set_identity>:
movss  0xef8(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @quat_set_identity(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 1.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 0.000000e+00, float* %10
ret void
}

LLVM IR (-O2):
define void @quat_set_identity(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, <4 x float>* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x94() {
  Assert_real((isprint(148) == 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_isprint.c",
              745, ("isprint should be 0 for 0x94"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x94>:
push   %rax
mov    $0x94,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x94\00"
define void @t_isprint_0x94() {
%1 = tail call i64 @isprint(i32 148)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((no)) void test(char *dest, const char *src) {
  __builtin_stpcpy(dest, src);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @test(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret void
}
int nleaders(struct vars *v) { return 0; }


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

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

LLVM IR (-O0):
%struct.vars = type opaque
define i32 @nleaders(%struct.vars* %0) {
%2 = alloca %struct.vars*
store %struct.vars* %0, %struct.vars** %2
ret i32 0
}

LLVM IR (-O2):
%struct.vars = type opaque
define i32 @nleaders(%struct.vars* nocapture readnone %0) {
ret i32 0
}
void enable_xp_(void) {}


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

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

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

LLVM IR (-O2):
define void @enable_xp_() {
ret void
}
void inic(int inic[]) {
  int i;
  for (i = 0; i < 100; i++)
    inic[i] = 0;
}


x86 assembly (clang, -O0):
<inic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1136 <inic+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <inic+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inic>:
push   %rax
mov    $0x190,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @inic(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 0, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @inic(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
void SetNewParms() {}


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

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

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

LLVM IR (-O2):
define void @SetNewParms() {
ret void
}
int CalcHigherLogTwo(int n) {
  int log2 = 0;
  while ((1 << log2) < n)
    log2++;
  return log2;
}


x86 assembly (clang, -O0):
<CalcHigherLogTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jge    112f <CalcHigherLogTwo+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <CalcHigherLogTwo+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcHigherLogTwo>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %edi,%eax
jl     1110 <CalcHigherLogTwo+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @CalcHigherLogTwo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = shl i32 1, %5
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @CalcHigherLogTwo(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = shl nuw i32 1, %3
%5 = icmp slt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}