xunge/DecIR huggingface dataset:
int celtofa(int celsius) {
  int fahr;
  fahr = celsius * (9.0 / 5.0) + 32;
  return fahr;
}


x86 assembly (clang, -O0):
<celtofa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<celtofa>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @celtofa(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call double @llvm.fmuladd.f64(double %5, double 1.800000e+00, double 3.200000e+01)
%7 = fptosi double %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @celtofa(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptosi double %3 to i32
ret i32 %4
}
int search(int *nums, int numsSize, int target) {
  for (int i = 0; i < numsSize; i++) {
    if (nums[i] == target) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <search+0x5a>
jmp    1145 <search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <search+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @search(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%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 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %28
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
store i32 -1, i32* %4
br label %28
28: ; preds = %27, %21
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
void __attribute__((preserve_all)) boo(void *ptr) {}


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

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

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

LLVM IR (-O2):
define preserve_allcc void @boo(i8* nocapture %0) {
ret void
}
long ndb_show_ptr(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @ndb_show_ptr() {
ret i64 0
}

LLVM IR (-O2):
define i64 @ndb_show_ptr() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void dump_as_hex(unsigned char *buf, int bytes_read) {
  for (int i = 0; i < bytes_read; i++) {
    printf("%02X ", buf[i]);
  }
}


x86 assembly (clang, -O0):
<dump_as_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <dump_as_hex+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_as_hex+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_as_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <dump_as_hex+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dump_as_hex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02X \00"
define void @dump_as_hex(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
void swap(int a[], const size_t i, const size_t j) {
  const int tmp = a[i];
  a[i] = a[j];
  a[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi,%rsi,4),%eax
mov    (%rdi,%rdx,4),%ecx
mov    %ecx,(%rdi,%rsi,4)
mov    %eax,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i32*, i32** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = load i64, i64* %6
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
%16 = load i32*, i32** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i32, i32* %16, i64 %17
store i32 %15, i32* %18
%19 = load i32, i32* %7
%20 = load i32*, i32** %4
%21 = load i64, i64* %6
%22 = getelementptr inbounds i32, i32* %20, i64 %21
store i32 %19, i32* %22
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 %2
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 %5, i32* %6
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void VIMSLineBufDisable(uint32_t ui32Base) {
  (*((volatile unsigned long *)(ui32Base + 0x00000004))) |=
      0x00000020 | 0x00000010;
}


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

x86 assembly (clang, -O2):
<VIMSLineBufDisable>:
orq    $0x30,0x4(%rdi)
ret

LLVM IR (-O0):
define void @VIMSLineBufDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 48
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @VIMSLineBufDisable(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 48
store volatile i64 %5, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ *ptls_encode_quicint(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
uint8_t *quicly_encode_retire_connection_id_frame(uint8_t *dst,
                                                  uint64_t sequence) {
  *dst++ = 25;
  dst = ptls_encode_quicint(dst, sequence);
  return dst;
}


x86 assembly (clang, -O0):
<quicly_encode_retire_connection_id_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x19,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ptls_encode_quicint@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicly_encode_retire_connection_id_frame>:
movl   $0x19,(%rdi)
add    $0x4,%rdi
jmp    1030 <ptls_encode_quicint@plt>

LLVM IR (-O0):
define i32* @quicly_encode_retire_connection_id_frame(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 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %3
store i32 25, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32* @ptls_encode_quicint(i32* %7, i32 %8)
store i32* %9, i32** %3
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @quicly_encode_retire_connection_id_frame(i32* %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 25, i32* %0
%4 = tail call i32* @ptls_encode_quicint(i32* %3, i32 %1)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] u1,v1 u2,v2 ...\n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeeb(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s [options] u1,v1 u2,v2 ...\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s [options] u1,v1 u2,v2 ...\0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf(char *, char const *);
int stress_chroot_supported(const char *name) {
  pr_inf("%s: stressor is not supported on this system\n", name);
  return -1;
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"%s: stressor is not supported on this system\0A\00"
define i32 @stress_chroot_supported(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_inf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [46 x i8] c"%s: stressor is not supported on this system\0A\00"
define i32 @stress_chroot_supported(i8* %0) {
%2 = tail call i32 @pr_inf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ write(int, char *, int);
int secu_malloc(char **str, size_t len) {
  if ((*str = (char *)malloc(sizeof(char) * len)) == NULL) {
    write(2, "42sh: malloc failed [entry.c]\n", 30);
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<secu_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1172 <secu_malloc+0x52>
mov    $0x2,%edi
lea    0xea4(%rip),%rsi
mov    $0x1e,%edx
call   1030 <write@plt>
movl   $0x0,-0x4(%rbp)
jmp    1179 <secu_malloc+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secu_malloc>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    %rax,(%rbx)
mov    $0x1,%eax
test   %rcx,%rcx
je     113d <secu_malloc+0x1d>
pop    %rbx
ret
lea    0xebc(%rip),%rsi
mov    $0x2,%edi
mov    $0x1e,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"42sh: malloc failed [entry.c]\0A\00"
define i32 @secu_malloc(i8** %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
%11 = load i8**, i8*** %4
store i8* %10, i8** %11
%12 = icmp eq i8* %10, null
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @write(i32 2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 30)
store i32 0, i32* %3
br label %16
15: ; preds = %2
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [31 x i8] c"42sh: malloc failed [entry.c]\0A\00"
define i32 @secu_malloc(i8** nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %0
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 30)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int quantidade;
  scanf("%d", &quantidade);
  printf("Preço: %lf", quantidade * (quantidade < 12 ? 1.3 : 1.0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
movsd  0xeb3(%rip),%xmm0
movsd  0xeb3(%rip),%xmm1
movsd  %xmm1,-0x18(%rbp)
cmp    $0xc,%eax
movsd  %xmm0,-0x10(%rbp)
jl     1172 <main+0x52>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %ecx,%ecx
cmp    $0xc,%eax
setl   %cl
cvtsi2sd %eax,%xmm0
lea    0xeb7(%rip),%rax
mulsd  (%rax,%rcx,8),%xmm0
cvttsd2si %xmm0,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"Pre\C3\A7o: %lf\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 12
%7 = zext i1 %6 to i64
%8 = select i1 %6, double 1.300000e+00, double 1.000000e+00
%9 = fmul double %4, %8
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"Pre\C3\A7o: %lf\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
%6 = icmp slt i32 %4, 12
%7 = select i1 %6, double 1.300000e+00, double 1.000000e+00
%8 = fmul double %7, %5
%9 = fptosi double %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
__attribute__((section(".flash.text.ReadW"))) uint16_t
FlashReadW(uint32_t addr) {
  return *((volatile uint16_t *)addr);
}


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

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

LLVM IR (-O0):
define i32 @FlashReadW(i64 %0) section ".flash.text.ReadW" {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @FlashReadW(i64 %0) section ".flash.text.ReadW" {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hugo_blockfree(void *block) { free(block); }


x86 assembly (clang, -O0):
<hugo_blockfree>:
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):
<hugo_blockfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @hugo_blockfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct section_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_destroy(struct genlist *);
void section_list_destroy(struct section_list *tthis) {
  genlist_destroy((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<section_list_destroy>:
jmp    1030 <genlist_destroy@plt>

LLVM IR (-O0):
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define void @section_list_destroy(%struct.section_list* %0) {
%2 = alloca %struct.section_list*
store %struct.section_list* %0, %struct.section_list** %2
%3 = load %struct.section_list*, %struct.section_list** %2
%4 = bitcast %struct.section_list* %3 to %struct.genlist*
%5 = call i32 @genlist_destroy(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define void @section_list_destroy(%struct.section_list* %0) {
%2 = bitcast %struct.section_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_destroy(%struct.genlist* %2)
ret void
}
/* Variables and functions */
size_t bnode_black_value(size_t index) { return (((index) << 1) | (0)); }


x86 assembly (clang, -O0):
<bnode_black_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
or     $0x0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnode_black_value>:
lea    (%rdi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @bnode_black_value(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 1
%5 = or i64 %4, 0
ret i64 %5
}

LLVM IR (-O2):
define i64 @bnode_black_value(i64 %0) {
%2 = shl i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int *malloc(int);
int robMax(int *, int, int, int *);
int rob(int *nums, int numsSize) {
  int *rec = malloc(numsSize * sizeof(int));
  for (int i = 0; i < numsSize; i++) {
    rec[i] = -1;
  }
  return robMax(nums, numsSize, -1, rec);
}


x86 assembly (clang, -O0):
<rob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1172 <rob+0x52>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <rob+0x29>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0xffffffff,%edx
call   1040 <robMax@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rob>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
test   %ebx,%ebx
jle    1160 <rob+0x30>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r15,%rdi
mov    $0xff,%esi
call   1030 <memset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xffffffff,%edx
mov    %r15,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <robMax@plt>

LLVM IR (-O0):
define i32 @rob(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* %4
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i32* @malloc(i32 %10)
store i32* %11, i32** %5
store i32 0, i32* %6
br label %12
12: ; preds = %21, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i32*, i32** %5
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 -1, i32* %20
br label %21
21: ; preds = %16
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %12
24: ; preds = %12
%25 = load i32*, i32** %3
%26 = load i32, i32* %4
%27 = load i32*, i32** %5
%28 = call i32 @robMax(i32* %25, i32 %26, i32 -1, i32* %27)
ret i32 %28
}

LLVM IR (-O2):
define i32 @rob(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @malloc(i32 %3)
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = bitcast i32* %4 to i8*
%8 = zext i32 %1 to i64
%9 = shl nuw nsw i64 %8, 2
br label %10
10: ; preds = %6, %2
%11 = tail call i32 @robMax(i32* %0, i32 %1, i32 -1, i32* %4)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ CompileArgument();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Border(void) {
  CompileArgument();
  WriteInstruction("call 8859");
}


x86 assembly (clang, -O0):
<CR_Border>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CompileArgument@plt>
lea    0xece(%rip),%rdi
call   1040 <WriteInstruction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Border>:
push   %rax
xor    %eax,%eax
call   1030 <CompileArgument@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"call 8859\00"
define void @CR_Border() {
%1 = call i32 (...) @CompileArgument()
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"call 8859\00"
define void @CR_Border() {
%1 = tail call i32 (...) @CompileArgument()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
int pt_entry_isvalid(unsigned long entry) { return (entry & 0x400) == 0x000; }


x86 assembly (clang, -O0):
<pt_entry_isvalid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x400,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_entry_isvalid>:
xor    %eax,%eax
test   $0x400,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @pt_entry_isvalid(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1024
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @pt_entry_isvalid(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 10
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_bad_constraint_exists();
int /*<<< orphan*/ test_bad_control_type_exists();
int /*<<< orphan*/ test_bad_zone_exists();
int /*<<< orphan*/ test_get_set_constraint_all_bad();
int /*<<< orphan*/ test_get_set_control_type_all_bad();
int /*<<< orphan*/ test_get_set_zone_all_bad();
int main(void) {
  test_bad_control_type_exists();
  test_bad_zone_exists();
  test_bad_constraint_exists();
  test_get_set_control_type_all_bad();
  test_get_set_zone_all_bad();
  test_get_set_constraint_all_bad();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <test_bad_control_type_exists@plt>
mov    $0x0,%al
call   1060 <test_bad_zone_exists@plt>
mov    $0x0,%al
call   1030 <test_bad_constraint_exists@plt>
mov    $0x0,%al
call   1040 <test_get_set_control_type_all_bad@plt>
mov    $0x0,%al
call   1070 <test_get_set_zone_all_bad@plt>
mov    $0x0,%al
call   1050 <test_get_set_constraint_all_bad@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_bad_control_type_exists@plt>
xor    %eax,%eax
call   1060 <test_bad_zone_exists@plt>
xor    %eax,%eax
call   1030 <test_bad_constraint_exists@plt>
xor    %eax,%eax
call   1040 <test_get_set_control_type_all_bad@plt>
xor    %eax,%eax
call   1070 <test_get_set_zone_all_bad@plt>
xor    %eax,%eax
call   1050 <test_get_set_constraint_all_bad@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_bad_control_type_exists()
%3 = call i32 (...) @test_bad_zone_exists()
%4 = call i32 (...) @test_bad_constraint_exists()
%5 = call i32 (...) @test_get_set_control_type_all_bad()
%6 = call i32 (...) @test_get_set_zone_all_bad()
%7 = call i32 (...) @test_get_set_constraint_all_bad()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_bad_control_type_exists()
%2 = tail call i32 (...) @test_bad_zone_exists()
%3 = tail call i32 (...) @test_bad_constraint_exists()
%4 = tail call i32 (...) @test_get_set_control_type_all_bad()
%5 = tail call i32 (...) @test_get_set_zone_all_bad()
%6 = tail call i32 (...) @test_get_set_constraint_all_bad()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
char opsColor(char color) { return color == 'p' ? 'b' : 'p'; }


x86 assembly (clang, -O0):
<opsColor>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
mov    $0x70,%eax
mov    $0x62,%ecx
cmp    $0x70,%edx
cmove  %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opsColor>:
cmp    $0x70,%dil
mov    $0x62,%ecx
mov    $0x70,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @opsColor(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, 112
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 98, i32 112
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @opsColor(i8 signext %0) {
%2 = icmp eq i8 %0, 112
%3 = select i1 %2, i8 98, i8 112
ret i8 %3
}
int x10_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x10_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
hashname(cp) register char *cp;
{
  register long h = 0;
  while (*cp)
    h = ((h)*243 + (*cp++) & (8192 - 1));
  return ((int)h);
}


x86 assembly (clang, -O0):
<hashname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <hashname+0x4a>
imul   $0xf3,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
and    $0x1fff,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashname+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashname>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hashname+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0xf3,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
and    $0x1fff,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashname+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hashname(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nuw nsw i64 %6, 243
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i64
%11 = add nsw i64 %8, %10
%12 = and i64 %11, 8191
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = trunc i64 %12 to i32
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ 0, %1 ], [ %16, %15 ]
ret i32 %18
}
int test_imm_01int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x01 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_01int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 1
%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_01int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4294967296
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ln(char str[]) { printf("%s\n", str); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ln(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((weak)) void one_more() { return; }


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

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

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

LLVM IR (-O2):
define weak void @one_more() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void *thread2(void *vargp) {
  int *ptr = (int *)vargp;
  *ptr = 0;
  pthread_exit((void *)31);
}


x86 assembly (clang, -O0):
<thread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x1f,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread2>:
movl   $0x0,(%rdi)
mov    $0x1f,%edi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @thread2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
store i32 0, i32* %7
%8 = call i32 @pthread_exit(i8* inttoptr (i64 31 to i8*))
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @thread2(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 0, i32* %2
%3 = tail call i32 @pthread_exit(i8* inttoptr (i64 31 to i8*))
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t lz_DecodedLength(uint8_t *in) { return *(uint32_t *)in; }


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

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

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

LLVM IR (-O2):
define i32 @lz_DecodedLength(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void fo_scheduler_disconnect(int retcode) {}


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

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

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

LLVM IR (-O2):
define void @fo_scheduler_disconnect(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
void *f1(void *arg) {
  foo();
  bar();
  return NULL;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @f1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @foo()
%4 = call i32 (...) @bar()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @f1(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @bar()
ret i8* null
}
char *strcopy(register char *s, register char *t) {
  while (*s++ = *t++)
    ;
  return (s - 1);
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strcopy+0x3b>
jmp    110c <strcopy+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcopy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcopy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char const *);
char *strrchr(char const *, char);
int basename(const char *filename, char *basename) {
  char *lastsep = strrchr(filename, '/');
  if (lastsep) {
    strcpy(basename, lastsep + 1);
    return strlen(basename);
  } else {
    return strlen(filename);
  }
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117f <basename+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    118b <basename+0x5b>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     115b <basename+0x2b>
add    $0x1,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strlen@plt>

LLVM IR (-O0):
define i32 @basename(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i8* @strrchr(i8* %7, i8 signext 47)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = call i32 @strcpy(i8* %12, i8* %14)
%16 = load i8*, i8** %5
%17 = call i32 @strlen(i8* %16)
store i32 %17, i32* %3
br label %21
18: ; preds = %2
%19 = load i8*, i8** %4
%20 = call i32 @strlen(i8* %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @basename(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i32 @strcpy(i8* %1, i8* %6)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %1, %5 ], [ %0, %2 ]
%10 = tail call i32 @strlen(i8* %9)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rotl64(int /*<<< orphan*/, int);
uint64_t bmw_large_r3(uint64_t x) {
  uint64_t r;
  r = rotl64(x, 27);
  return r;
}


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

x86 assembly (clang, -O2):
<bmw_large_r3>:
mov    $0x1b,%esi
jmp    1030 <rotl64@plt>

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

LLVM IR (-O2):
define i32 @bmw_large_r3(i32 %0) {
%2 = tail call i32 @rotl64(i32 %0, i32 27)
ret i32 %2
}
int test_imm_4Auint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x4A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Auint64_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, 74
%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_4Auint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 317827579904
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun1085() { return 1085; }


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

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

LLVM IR (-O0):
define i32 @fun1085() {
ret i32 1085
}

LLVM IR (-O2):
define i32 @fun1085() {
ret i32 1085
}
void MACROSunload(void) {}


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

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

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

LLVM IR (-O2):
define void @MACROSunload() {
ret void
}
void dbg_hcc_params(struct ehci_hcd *ehci, char *label) {}


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

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

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

LLVM IR (-O2):
%struct.ehci_hcd = type opaque
define void @dbg_hcc_params(%struct.ehci_hcd* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x3f() {
  Assert_real((isbdigit(63) == 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",
              320, ("isbdigit should be 0 for ?"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x3f>:
push   %rax
mov    $0x3f,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x140,%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 = [27 x i8] c"isbdigit should be 0 for ?\00"
define void @t_isbdigit_0x3f() {
%1 = call i64 @isbdigit(i32 63)
%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 320, i8* getelementptr inbounds ([27 x i8], [27 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 = [27 x i8] c"isbdigit should be 0 for ?\00"
define void @t_isbdigit_0x3f() {
%1 = tail call i64 @isbdigit(i32 63)
%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 320, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("I am test sub1.\n");
  return 0;
}


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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"I am test sub1.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"I am test sub1.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}