xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void poe_exit(int rc) { exit(rc); }


x86 assembly (clang, -O0):
<poe_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<poe_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @poe_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
long RightChild(long a) { return (2 * a + 2); }


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

x86 assembly (clang, -O2):
<RightChild>:
lea    (%rdi,%rdi,1),%rax
add    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @RightChild(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 2, %3
%5 = add nsw i64 %4, 2
ret i64 %5
}

LLVM IR (-O2):
define i64 @RightChild(i64 %0) {
%2 = shl nsw i64 %0, 1
%3 = add nsw i64 %2, 2
ret i64 %3
}
float sqrtf(float x) { return __builtin_sqrtf(x); }


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

x86 assembly (clang, -O2):
<sqrtf>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1110 <sqrtf+0x10>
ret
nopl   0x0(%rax)
jmp    1110 <sqrtf+0x10>

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

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret float undef
}
unsigned short inw(unsigned short *b) {
  return (*(volatile unsigned short *const)b);
}


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

x86 assembly (clang, -O2):
<inw>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load volatile i16, i16* %3
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @inw(i16* %0) {
%2 = load volatile i16, i16* %0
ret i16 %2
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vmbuf_alloc_aligned(struct vmbuf *, size_t);
void *vmbuf_mem2(struct vmbuf *, int /*<<< orphan*/);
void *vmbuf_allocptr(struct vmbuf *vmbuf, size_t n) {
  return vmbuf_mem2(vmbuf, vmbuf_alloc_aligned(vmbuf, n));
}


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

x86 assembly (clang, -O2):
<vmbuf_allocptr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vmbuf_alloc_aligned@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <vmbuf_mem2@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_allocptr(%struct.vmbuf* %0, i64 %1) {
%3 = alloca %struct.vmbuf*
%4 = alloca i64
store %struct.vmbuf* %0, %struct.vmbuf** %3
store i64 %1, i64* %4
%5 = load %struct.vmbuf*, %struct.vmbuf** %3
%6 = load %struct.vmbuf*, %struct.vmbuf** %3
%7 = load i64, i64* %4
%8 = call i32 @vmbuf_alloc_aligned(%struct.vmbuf* %6, i64 %7)
%9 = call i8* @vmbuf_mem2(%struct.vmbuf* %5, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_allocptr(%struct.vmbuf* %0, i64 %1) {
%3 = tail call i32 @vmbuf_alloc_aligned(%struct.vmbuf* %0, i64 %1)
%4 = tail call i8* @vmbuf_mem2(%struct.vmbuf* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int comp_ext(char const *, char const *);
int icomp_ext(const char *a, const char *b) { return -comp_ext(a, b); }


x86 assembly (clang, -O0):
<icomp_ext>:
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 <comp_ext@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icomp_ext>:
push   %rax
call   1030 <comp_ext@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @icomp_ext(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 i32 @comp_ext(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @icomp_ext(i8* %0, i8* %1) {
%3 = tail call i32 @comp_ext(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
void RGBAToYJRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGBAToYJRow_NEON() {
ret void
}
/* Variables and functions */
#define EOF 128
int getchar();
int /*<<< orphan*/ puts(char *);
bool confirm_continue(void) {
  puts("Press 'q' to quit the test or enter to continue");
  int tmp = getchar();
  switch (tmp) {
  case EOF:
  case 'q':
    return false;
    break;
  }
  return true;
}


x86 assembly (clang, -O0):
<confirm_continue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x71,%eax
je     1165 <confirm_continue+0x45>
jmp    1152 <confirm_continue+0x32>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    1171 <confirm_continue+0x51>
jmp    1165 <confirm_continue+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1178 <confirm_continue+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confirm_continue>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x80,%eax
setne  %cl
cmp    $0x71,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Press 'q' to quit the test or enter to continue\00"
define i32 @confirm_continue() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %7 [
i32 128, label %6
i32 113, label %6
]
6: ; preds = %0, %0
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [48 x i8] c"Press 'q' to quit the test or enter to continue\00"
define i32 @confirm_continue() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 128
%4 = icmp ne i32 %2, 113
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("hello, world!");
  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 <puts@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 = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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 0
}
/* Variables and functions */
int /*<<< orphan*/ putc(char *);
void putstr(char *str) {
  while (str != 0) {
    putc(str);
    *str++;
  }
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <putstr+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
test   %rdi,%rdi
je     112e <putstr+0x1e>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <putc@plt>
add    $0x1,%rbx
jmp    1120 <putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @putc(i8* %4)
%6 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
7: ; preds = %1
ret void
}
__attribute__((no)) int test2(int a, int b) {
  while (a > 0) {
    b++;
    a--;
  }
  return b;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112b <test2+0x2b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110a <test2+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = select i1 %3, i32 %0, i32 0
%5 = add i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
int show_version(void) {
  const char *info = ""
                     "Big Integer Library Demo Program\n"
                     "Copyright (c) 2013-2015 Cheryl Natsu\n";
  puts(info);
  return 0;
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [71 x i8] c"Big Integer Library Demo Program\0ACopyright (c) 2013-2015 Cheryl Natsu\0A\00"
define i32 @show_version() {
%1 = alloca i8*
store i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @puts(i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [71 x i8] c"Big Integer Library Demo Program\0ACopyright (c) 2013-2015 Cheryl Natsu\0A\00"
define i32 @show_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void ff_hevc_put_hevc_bi_w_qpel_v4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v4_8_sse4() {
ret void
}
/* Variables and functions */
int assert(int);
int /*<<< orphan*/ strcmp(char const *, char const *);
scalar_t__ strlen(char const *);
int assert_equal_str(const char *a, const char *b) {
  return assert((strlen(a) == strlen(b)) && (!strcmp(a, b)));
}


x86 assembly (clang, -O0):
<assert_equal_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x11(%rbp)
jne    1183 <assert_equal_str+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_equal_str>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    %rax,%rbx
jne    1165 <assert_equal_str+0x35>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <assert@plt>

LLVM IR (-O0):
define i32 @assert_equal_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = icmp eq i64 %6, %8
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @assert_equal_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
%12 = tail call i32 @assert(i32 %11)
ret i32 %12
}
int test_imm_97uint8_mem(unsigned char *val) {
  return ((*val) & (0x97 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_97uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -105
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int nl_sendgetlink_do(int, int /*<<< orphan*/, int, int);
int nl_sendgetlink(int fd, uint32_t seq, int ifindex) {
  return nl_sendgetlink_do(fd, seq, ifindex, 1);
}


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

x86 assembly (clang, -O2):
<nl_sendgetlink>:
mov    $0x1,%ecx
jmp    1030 <nl_sendgetlink_do@plt>

LLVM IR (-O0):
define i32 @nl_sendgetlink(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @nl_sendgetlink_do(i32 %7, i32 %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @nl_sendgetlink(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @nl_sendgetlink_do(i32 %0, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned short);
int foo(unsigned short n) {
  bar(n);
  bar(n);
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <bar@plt>
movzwl -0x2(%rbp),%edi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
call   1030 <bar@plt>
mov    %ebx,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo(i16 zeroext %0) {
%2 = tail call i32 @bar(i16 zeroext %0)
%3 = tail call i32 @bar(i16 zeroext %0)
ret i32 0
}
int DRV_GET_DIAG_MODE_VALUE(unsigned char *pucDialmode,
                            unsigned char *pucCdcSpec) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_DIAG_MODE_VALUE(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void backtrace_init(void) {}


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

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

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

LLVM IR (-O2):
define void @backtrace_init() {
ret void
}
int sort(int L) {
  int end[2] =
      {
          10,
          10,
      },
      i = 0, R;
  while (i < 2) {
    R = end[i];
    if (L < R) {
      end[i + 1] = 1;
      end[i] = 10;
      ++i;
    } else
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    116e <sort+0x6e>
movslq -0x10(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1164 <sort+0x64>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
movl   $0x1,-0xc(%rbp,%rax,4)
movslq -0x10(%rbp),%rax
movl   $0xa,-0xc(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <sort+0x69>
jmp    116e <sort+0x6e>
jmp    1119 <sort+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
xor    %ecx,%ecx
test   %edi,%edi
setle  %cl
add    $0x1,%ecx
xor    %eax,%eax
cmp    $0xa,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
@__const.sort.end = [2 x i32] [i32 10, i32 10]
define i32 @sort(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = bitcast [2 x i32]* %3 to i8*
store i32 0, i32* %4
br label %7
7: ; preds = %29, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %30
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %5
%15 = load i32, i32* %2
%16 = load i32, i32* %5
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %10
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %21
store i32 1, i32* %22
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %24
store i32 10, i32* %25
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %29
28: ; preds = %10
br label %30
29: ; preds = %18
br label %7
30: ; preds = %28, %7
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @sort(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 2, i32 1
%5 = select i1 %2, i32 %4, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int width(int);
void print(char *line, int nesting) {
  int indent = width(nesting);
  int j;
  printf("%s\n", line);
  for (j = 0; j < indent; j++)
    printf(" ");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <width@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <print+0x5b>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <print+0x33>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %esi,%edi
call   1050 <width@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
jle    115f <print+0x2f>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @print(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @width(i32 %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @putchar(i32 32)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %3
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int /*<<< orphan*/);
int gnugetopt(int argc, char *const *argv, const char *optstring) {
  return _getopt_internal(argc, argv, optstring, (const struct option *)0,
                          (int *)0, 0);
}


x86 assembly (clang, -O0):
<gnugetopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnugetopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @gnugetopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 @_getopt_internal(i32 %7, i8** %8, i8* %9, %struct.option* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @gnugetopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* null, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
void *__check_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *__check_calloc(size_t s, size_t n) {
  void *p;
  size_t total;
  total = s * n;
  p = __check_malloc(total);
  if (p == NULL)
    return NULL;
  memset(p, 0, total);
  return p;
}


x86 assembly (clang, -O0):
<__check_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <__check_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1162 <__check_calloc+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1179 <__check_calloc+0x59>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__check_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <__check_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <__check_calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @__check_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @__check_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %2, %6
ret i8* %4
}
/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
double get_time(void) { return (double)clock() / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @get_time() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @get_time() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x1f() {
  Assert_real((isalpha(31) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              160, ("isalpha should be 0 for 0x1f"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x1f\00"
define void @t_isalpha_0x1f() {
%1 = tail call i64 @isalpha(i32 31)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef size_t uint64_t;

/* Variables and functions */
size_t UINT64_MAX;
void use_uint64_max_Bad() {
  char arr[10];
  uint64_t x = UINT64_MAX;
  uint64_t y = UINT64_MAX - 15;
  arr[x - y] = 0;
}


x86 assembly (clang, -O0):
<use_uint64_max_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%rax
sub    $0xf,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
@UINT64_MAX = global i64 0
define void @use_uint64_max_Bad() {
%1 = alloca [10 x i8]
%2 = alloca i64
%3 = alloca i64
%4 = load i64, i64* @UINT64_MAX
store i64 %4, i64* %2
%5 = load i64, i64* @UINT64_MAX
%6 = sub i64 %5, 15
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = sub i64 %7, %8
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
@UINT64_MAX = global i64 0
define void @use_uint64_max_Bad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Rotate16fv(float *, float, float const *);
int /*<<< orphan*/ Transpose16fv(float *);
float *invRotate16fv(float *M, float DegAng, const float Axis[3]) {
  Rotate16fv(M, DegAng, Axis);
  Transpose16fv(M);
  return (M);
}


x86 assembly (clang, -O0):
<invRotate16fv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
call   1030 <Rotate16fv@plt>
mov    -0x8(%rbp),%rdi
call   1040 <Transpose16fv@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invRotate16fv>:
push   %rbx
mov    %rdi,%rbx
call   1030 <Rotate16fv@plt>
mov    %rbx,%rdi
call   1040 <Transpose16fv@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define float* @invRotate16fv(float* %0, float %1, float* %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float*
store float* %0, float** %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %5
%9 = load float*, float** %6
%10 = call i32 @Rotate16fv(float* %7, float %8, float* %9)
%11 = load float*, float** %4
%12 = call i32 @Transpose16fv(float* %11)
%13 = load float*, float** %4
ret float* %13
}

LLVM IR (-O2):
define float* @invRotate16fv(float* returned %0, float %1, float* %2) {
%4 = tail call i32 @Rotate16fv(float* %0, float %1, float* %2)
%5 = tail call i32 @Transpose16fv(float* %0)
ret float* %0
}
void computeComputedConstants(double *variables) {
  variables[7] = variables[3] - 10.613;
  variables[9] = variables[3] - 115.0;
  variables[15] = variables[3] + 12.0;
}


x86 assembly (clang, -O0):
<computeComputedConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xef7(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xed1(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
mov    -0x8(%rbp),%rax
movsd  0xeb0(%rip),%xmm0
addsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x78(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeComputedConstants>:
movsd  0x18(%rdi),%xmm0
movsd  0xef3(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x38(%rdi)
movsd  0xeea(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x48(%rdi)
addsd  0xee1(%rip),%xmm0
movsd  %xmm0,0x78(%rdi)
ret

LLVM IR (-O0):
define void @computeComputedConstants(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 3
%5 = load double, double* %4
%6 = fsub double %5, 1.061300e+01
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 7
store double %6, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 3
%11 = load double, double* %10
%12 = fsub double %11, 1.150000e+02
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 9
store double %12, double* %14
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 3
%17 = load double, double* %16
%18 = fadd double %17, 1.200000e+01
%19 = load double*, double** %2
%20 = getelementptr inbounds double, double* %19, i64 15
store double %18, double* %20
ret void
}

LLVM IR (-O2):
define void @computeComputedConstants(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 3
%3 = load double, double* %2
%4 = fadd double %3, -1.061300e+01
%5 = getelementptr inbounds double, double* %0, i64 7
store double %4, double* %5
%6 = fadd double %3, -1.150000e+02
%7 = getelementptr inbounds double, double* %0, i64 9
store double %6, double* %7
%8 = fadd double %3, 1.200000e+01
%9 = getelementptr inbounds double, double* %0, i64 15
store double %8, double* %9
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
char *strrchr(char const *, char);
int has_tld(const char str[], const char ext[]) {
  const char *dot = strrchr(str, '.');
  return dot && (strcmp(dot + 1, ext) == 0);
}


x86 assembly (clang, -O0):
<has_tld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     116d <has_tld+0x4d>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_tld>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     114f <has_tld+0x2f>
add    $0x1,%rax
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @has_tld(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strrchr(i8* %6, i8 signext 46)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8*, i8** %4
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp eq i64 %14, 0
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @has_tld(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i64 @strcmp(i8* %6, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %11
}
int vrt_rdev_unlock_sectors(struct vrt_realdev *rdev, unsigned long start,
                            unsigned long end) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.vrt_realdev = type opaque
define i32 @vrt_rdev_unlock_sectors(%struct.vrt_realdev* %0, i64 %1, i64 %2) {
%4 = alloca %struct.vrt_realdev*
%5 = alloca i64
%6 = alloca i64
store %struct.vrt_realdev* %0, %struct.vrt_realdev** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.vrt_realdev = type opaque
define i32 @vrt_rdev_unlock_sectors(%struct.vrt_realdev* nocapture readnone %0, i64 %1, i64 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u64_t1ha64s_data64(double const *, size_t, uintptr_t);
uint64_t rgph_u64_t1ha64s_f64a(const double *key, size_t len, uintptr_t seed) {
  return rgph_u64_t1ha64s_data64(key, len, seed);
}


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

x86 assembly (clang, -O2):
<rgph_u64_t1ha64s_f64a>:
jmp    1030 <rgph_u64_t1ha64s_data64@plt>

LLVM IR (-O0):
define i32 @rgph_u64_t1ha64s_f64a(double* %0, i64 %1, i64 %2) {
%4 = alloca double*
%5 = alloca i64
%6 = alloca i64
store double* %0, double** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load double*, double** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 @rgph_u64_t1ha64s_data64(double* %7, i64 %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @rgph_u64_t1ha64s_f64a(double* %0, i64 %1, i64 %2) {
%4 = tail call i32 @rgph_u64_t1ha64s_data64(double* %0, i64 %1, i64 %2)
ret i32 %4
}
__attribute__((weak)) void SSC0_IrqHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<SSC0_IrqHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SSC0_IrqHandler+0x9>
jmp    1109 <SSC0_IrqHandler+0x9>

x86 assembly (clang, -O2):
<SSC0_IrqHandler>:
jmp    1100 <SSC0_IrqHandler>

LLVM IR (-O0):
define weak void @SSC0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @SSC0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void eap_otp_deinit(struct eap_sm *sm, void *priv) {}


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

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

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

LLVM IR (-O2):
%struct.eap_sm = type opaque
define void @eap_otp_deinit(%struct.eap_sm* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_logtalk_block_comment();
int /*<<< orphan*/ test_logtalk_comments();
int /*<<< orphan*/ test_logtalk_empty_comments();
void all_logtalk_tests() {
  test_logtalk_comments();
  test_logtalk_empty_comments();
  test_logtalk_block_comment();
}


x86 assembly (clang, -O0):
<all_logtalk_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_logtalk_comments@plt>
mov    $0x0,%al
call   1050 <test_logtalk_empty_comments@plt>
mov    $0x0,%al
call   1040 <test_logtalk_block_comment@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_logtalk_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_logtalk_comments@plt>
xor    %eax,%eax
call   1050 <test_logtalk_empty_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_logtalk_block_comment@plt>

LLVM IR (-O0):
define void @all_logtalk_tests() {
%1 = call i32 (...) @test_logtalk_comments()
%2 = call i32 (...) @test_logtalk_empty_comments()
%3 = call i32 (...) @test_logtalk_block_comment()
ret void
}

LLVM IR (-O2):
define void @all_logtalk_tests() {
%1 = tail call i32 (...) @test_logtalk_comments()
%2 = tail call i32 (...) @test_logtalk_empty_comments()
%3 = tail call i32 (...) @test_logtalk_block_comment()
ret void
}
int alert_server_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @alert_server_init() {
ret i32 0
}
unsigned int custom(const char *str) {
  unsigned int hash = 0;
  int c;
  while (c = *str++) {
    hash += c;
  }
  return hash + (hash << 1);
}


x86 assembly (clang, -O0):
<custom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113b <custom+0x3b>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <custom+0xf>
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom>:
mov    (%rdi),%al
test   %al,%al
je     1124 <custom+0x24>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <custom+0x10>
lea    (%rcx,%rcx,2),%eax
ret
xor    %eax,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ nosmime();
FILE *smime_sign(FILE *fp) {
  nosmime();
  return NULL;
}


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

x86 assembly (clang, -O2):
<smime_sign>:
push   %rax
xor    %eax,%eax
call   1030 <nosmime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32* @smime_sign(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @nosmime()
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @smime_sign(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @nosmime()
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) { printf("%d\n", 7 / 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_send_status_from_server() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_call_send_status_from_server>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_send_status_from_server() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_send_status_from_server() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}