xunge/DecIR huggingface dataset:
int kfd_iommu_resume(struct kfd_dev *kfd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kfd_dev = type opaque
define i32 @kfd_iommu_resume(%struct.kfd_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xe0() {
  Assert_real((isodigit(224) == 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_isodigit.c",
              1125, ("isodigit should be 0 for 0xe0"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xe0>:
push   %rax
mov    $0xe0,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x465,%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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xe0\00"
define void @t_isodigit_0xe0() {
%1 = call i64 @isodigit(i32 224)
%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 1125, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xe0\00"
define void @t_isodigit_0xe0() {
%1 = tail call i64 @isodigit(i32 224)
%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 1125, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void xmlCleanupThreads(void) {}


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

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

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

LLVM IR (-O2):
define void @xmlCleanupThreads() {
ret void
}
int test_imm_5Fint64_highword_reg(long long val) {
  return ((val >> 32) & (0x5F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Fint64_highword_reg>:
movabs $0x5f00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Fint64_highword_reg(i64 %0) {
%2 = and i64 %0, 408021893120
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mcfioC_CloseSequentialTape(int);
void mcfio_closesequentialtape_(int *stream) {
  mcfioC_CloseSequentialTape(*stream);
}


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

x86 assembly (clang, -O2):
<mcfio_closesequentialtape_>:
mov    (%rdi),%edi
jmp    1030 <mcfioC_CloseSequentialTape@plt>

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

LLVM IR (-O2):
define void @mcfio_closesequentialtape_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mcfioC_CloseSequentialTape(i32 %2)
ret void
}
/* Variables and functions */
int Partion(int *, int, int);
void Quick_Sort(int R[], int s, int t) {
  int i;
  if (s < t) {
    i = Partion(R, s, t);
    Quick_Sort(R, s, i - 1);
    Quick_Sort(R, i + 1, t);
  }
}


x86 assembly (clang, -O0):
<Quick_Sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <Quick_Sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <Partion@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <Quick_Sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <Quick_Sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Quick_Sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <Quick_Sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <Partion@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <Quick_Sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <Quick_Sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Quick_Sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Partion(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @Quick_Sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int get_nonwhite_c(FILE *stream) {
  int c;
  do
    c = getc(stream);
  while ((c == ' ' || c == '\n' || c == '\t'));
  return c;
}


x86 assembly (clang, -O0):
<get_nonwhite_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1150 <get_nonwhite_c+0x40>
mov    $0x1,%al
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1150 <get_nonwhite_c+0x40>
cmpl   $0x9,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111c <get_nonwhite_c+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nonwhite_c>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0x100000600,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0x20,%eax
ja     1145 <get_nonwhite_c+0x35>
mov    %eax,%ecx
bt     %rcx,%r14
jb     1130 <get_nonwhite_c+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @get_nonwhite_c(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %16, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 32
br i1 %9, label %16, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 10
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 9
br label %16
16: ; preds = %13, %10, %7
%17 = phi i1 [ true, %10 ], [ true, %7 ], [ %15, %13 ]
br i1 %17, label %4, label %18
18: ; preds = %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_nonwhite_c(i32* nocapture %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call i32 @getc(i32* %0)
switch i32 %3, label %5 [
i32 32, label %4
i32 10, label %4
i32 9, label %4
]
4: ; preds = %2, %2, %2
br label %2
5: ; preds = %2
ret i32 %3
}
int gadget_is_otg(struct usb_gadget *g) { return 0; }


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ tecc_ec_mult(int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ const *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ecc_ecdh(const uint32_t *px, const uint32_t *py, const uint32_t *secret,
              uint32_t *resultx, uint32_t *resulty) {
  tecc_ec_mult(px, py, secret, resultx, resulty);
}


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

x86 assembly (clang, -O2):
<ecc_ecdh>:
jmp    1030 <tecc_ec_mult@plt>

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

LLVM IR (-O2):
define void @ecc_ecdh(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @tecc_ec_mult(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret void
}
/* Variables and functions */
int strlen(char *);
char *strccat(char *dst, int c) {
  int len;
  if (!dst)
    return (dst);
  len = strlen(dst);
  dst[len] = c;
  dst[len + 1] = 0;
  return (dst);
}


x86 assembly (clang, -O0):
<strccat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <strccat+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <strccat+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strccat>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
je     1130 <strccat+0x20>
mov    %esi,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strccat(i8* returned %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
%6 = trunc i32 %1 to i8
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add nsw i32 %5, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %2, %4
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int main() {
  extern int e();
  a();
  b();
  c();
  b();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <a@plt>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1040 <c@plt>
mov    $0x0,%al
call   1030 <b@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <a@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1040 <c@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @a()
%3 = call i32 (...) @b()
%4 = call i32 (...) @c()
%5 = call i32 (...) @b()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @b()
%3 = tail call i32 (...) @c()
%4 = tail call i32 (...) @b()
ret i32 0
}
int intcmp(int v1, int v2) {
  if (v1 > v2) {
    return 1;
  } else if (v1 < v2) {
    return -1;
  } else {
    return 0;
  }
  return -2;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <intcmp+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1141 <intcmp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113a <intcmp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <intcmp+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
xor    %ecx,%ecx
cmp    %esi,%edi
setl   %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @intcmp(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ vrp_keep();
void f3(int s, int b) {
  if (s >> 3 == -2) {
    b = (b & 1) + 1;
    b = s << b;
    if (b == -64)
      vrp_keep();
    if (b == -18)
      vrp_keep();
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
cmp    $0xfffffffe,%eax
jne    116b <f3+0x5b>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffc0,-0x8(%rbp)
jne    1155 <f3+0x45>
mov    $0x0,%al
call   1030 <vrp_keep@plt>
cmpl   $0xffffffee,-0x8(%rbp)
jne    1166 <f3+0x56>
mov    $0x0,%al
call   1030 <vrp_keep@plt>
jmp    116b <f3+0x5b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %edi,%eax
and    $0xfffffff8,%eax
cmp    $0xfffffff0,%eax
jne    1137 <f3+0x27>
and    $0x1,%sil
add    $0x1,%sil
mov    %esi,%ecx
shl    %cl,%edi
cmp    $0xffffffee,%edi
je     1130 <f3+0x20>
cmp    $0xffffffc0,%edi
jne    1137 <f3+0x27>
xor    %eax,%eax
jmp    1030 <vrp_keep@plt>
ret

LLVM IR (-O0):
define void @f3(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 = ashr i32 %5, 3
%7 = icmp eq i32 %6, -2
br i1 %7, label %8, label %25
8: ; preds = %2
%9 = load i32, i32* %4
%10 = and i32 %9, 1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = shl i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, -64
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = call i32 (...) @vrp_keep()
br label %19
19: ; preds = %17, %8
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, -18
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 (...) @vrp_keep()
br label %24
24: ; preds = %22, %19
br label %25
25: ; preds = %24, %2
ret void
}

LLVM IR (-O2):
define void @f3(i32 %0, i32 %1) {
%3 = and i32 %0, -8
%4 = icmp eq i32 %3, -16
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = and i32 %1, 1
%7 = add nuw nsw i32 %6, 1
%8 = shl nsw i32 %0, %7
switch i32 %8, label %11 [
i32 -64, label %9
i32 -18, label %9
]
9: ; preds = %5, %5
%10 = tail call i32 (...) @vrp_keep()
br label %11
11: ; preds = %9, %5, %2
ret void
}
/* Variables and functions */
int run_command_shell();
int main(void) {
  int retval;
  retval = run_command_shell();
  if (retval != 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <run_command_shell@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113f <main+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <main+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run_command_shell@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_command_shell()
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t write(int fd, const void *buf, size_t count) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @write(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
int isupper(int c) { return ('A' <= c && c <= 'Z'); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isupper+0x24>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ poll(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int main() {
  poll(NULL, 0, 1100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
mov    $0x44c,%edx
call   1030 <poll@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x44c,%edx
call   1030 <poll@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @poll(i32* null, i32 0, i32 1100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @poll(i32* null, i32 0, i32 1100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f4(void) { printf("Hey, you pressed F4! \n"); }


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

x86 assembly (clang, -O2):
<f4>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Hey, you pressed F4! \0A\00"
define void @f4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Hey, you pressed F4! \00"
define void @f4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
int testSharedLibraryOpenError() { return 1; }


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

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

LLVM IR (-O0):
define i32 @testSharedLibraryOpenError() {
ret i32 1
}

LLVM IR (-O2):
define i32 @testSharedLibraryOpenError() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void location(char *loc) { printf("Location: %s\n\n", loc); }


x86 assembly (clang, -O0):
<location>:
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):
<location>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Location: %s\0A\0A\00"
define void @location(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
__attribute__((always_)) int strcmp_utf8(char *a, char *b) {
  return strcmp(a, b);
}


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

x86 assembly (clang, -O2):
<strcmp_utf8>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strcmp_utf8(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strcmp_utf8(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_vhdl_comments() {
  test_parser_verify_parse(test_parser_sourcefile("vhdl", " -- comment"),
                           "vhdl", "", "-- comment", 0);
}


x86 assembly (clang, -O0):
<test_vhdl_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vhdl_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec6(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"vhdl\00"
@.str.1 = [12 x i8] c" -- comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [11 x i8] c"-- comment\00"
define void @test_vhdl_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"vhdl\00"
@.str.1 = [12 x i8] c" -- comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [11 x i8] c"-- comment\00"
define void @test_vhdl_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_reducer();
int main() {
  run_reducer();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <run_reducer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_reducer()
ret i32 0
}
void ff_hevc_put_hevc_uni_epel_v4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v4_8_sse4() {
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;
typedef unsigned int uint64_t;
typedef unsigned int uint32_t;
typedef unsigned int uint16_t;

/* Variables and functions */
void *memzero(void *dest, size_t n) {
  switch (sizeof(unsigned long)) {
  case 2: {
    uint16_t z16 = 0U;
    do {
      uint16_t *p = (uint16_t *)dest;
      for (; n >= sizeof(uint16_t); n -= sizeof(uint16_t))
        *p++ = z16;
    } while (0);
  }
  case 4: {
    uint32_t z32 = 0U;
    do {
      uint32_t *p = (uint32_t *)dest;
      for (; n >= sizeof(uint32_t); n -= sizeof(uint32_t))
        *p++ = z32;
    } while (0);
    break;
  }
  case 8: {
    uint64_t z64 = 0U;
    do {
      uint64_t *p = (uint64_t *)dest;
      for (; n >= sizeof(uint64_t); n -= sizeof(uint64_t))
        *p++ = z64;
    } while (0);
    break;
  }
  default: {
    uint8_t z8 = 0U;
    do {
      uint8_t *p = (uint8_t *)dest;
      for (; n >= sizeof(uint8_t); n -= sizeof(uint8_t))
        *p++ = z8;
    } while (0);
    break;
  }
  }
  return (dest);
}


x86 assembly (clang, -O0):
<memzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x4,-0x10(%rbp)
jb     114b <memzero+0x4b>
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
sub    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    111b <memzero+0x1b>
jmp    1150 <memzero+0x50>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzero>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x4,%rsi
jb     112b <memzero+0x1b>
mov    %rsi,%rdx
and    $0xfffffffffffffffc,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @memzero(i8* returned writeonly %0, i64 %1) {
%3 = icmp ugt i64 %1, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = and i64 %1, -4
br label %6
6: ; preds = %4, %2
ret i8* %0
}
/* Variables and functions */
char *realloc(char *, scalar_t__);
scalar_t__ sizetoalloc(int);
int strsize(char *);
char *strexpand(char *str, int newsize) {
  if (newsize + 2 >= strsize(str) - 8)
    return realloc(str, sizetoalloc(newsize) + 5);
  else
    return str;
}


x86 assembly (clang, -O0):
<strexpand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strsize@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    $0x8,%ecx
cmp    %ecx,%eax
jl     118a <strexpand+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <sizetoalloc@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
add    $0x5,%rsi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1192 <strexpand+0x62>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strexpand>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x2(%r14),%ebp
call   1040 <strsize@plt>
add    $0xfffffff8,%eax
cmp    %eax,%ebp
jge    1152 <strexpand+0x22>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14d,%edi
call   1030 <sizetoalloc@plt>
lea    0x5(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <realloc@plt>

LLVM IR (-O0):
define i8* @strexpand(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 2
%8 = load i8*, i8** %4
%9 = call i32 @strsize(i8* %8)
%10 = sub nsw i32 %9, 8
%11 = icmp sge i32 %7, %10
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i64 @sizetoalloc(i32 %14)
%16 = add nsw i64 %15, 5
%17 = call i8* @realloc(i8* %13, i64 %16)
store i8* %17, i8** %3
br label %20
18: ; preds = %2
%19 = load i8*, i8** %4
store i8* %19, i8** %3
br label %20
20: ; preds = %18, %12
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @strexpand(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 2
%4 = tail call i32 @strsize(i8* %0)
%5 = add nsw i32 %4, -8
%6 = icmp slt i32 %3, %5
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i64 @sizetoalloc(i32 %1)
%9 = add nsw i64 %8, 5
%10 = tail call i8* @realloc(i8* %0, i64 %9)
br label %11
11: ; preds = %2, %7
%12 = phi i8* [ %10, %7 ], [ %0, %2 ]
ret i8* %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void platform_main_end(uint32_t crc, int flag) {
  printf("checksum = %X\n", crc);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"checksum = %X\0A\00"
define void @platform_main_end(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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"checksum = %X\0A\00"
define void @platform_main_end(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double nmea_degree2ndeg(int /*<<< orphan*/);
int /*<<< orphan*/ nmea_radian2degree(double);
double nmea_radian2ndeg(double val) {
  return nmea_degree2ndeg(nmea_radian2degree(val));
}


x86 assembly (clang, -O0):
<nmea_radian2ndeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <nmea_radian2degree@plt>
mov    %eax,%edi
call   1030 <nmea_degree2ndeg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmea_radian2ndeg>:
push   %rax
call   1040 <nmea_radian2degree@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <nmea_degree2ndeg@plt>

LLVM IR (-O0):
define double @nmea_radian2ndeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @nmea_radian2degree(double %3)
%5 = call double @nmea_degree2ndeg(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @nmea_radian2ndeg(double %0) {
%2 = tail call i32 @nmea_radian2degree(double %0)
%3 = tail call double @nmea_degree2ndeg(i32 %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Tool:    ga_nuc_region\n\nSummary: report the nucleotide "
         "composition(number of ATCG) and AT content.\n\nUsage:   "
         "ga_nuc_region -fa <fasta> -region <region file> -gt <genome "
         "table>\n\nOptions:\n         -v: output version information and "
         "exit.\n         -h, --help: display this help and exit.\n         "
         "--header: the header of region file is preserved (default:off).\n    "
         "     --col_chr: <int> column number for chromosome of region file "
         "(default:0).\n         --col_start: <int> column number for start "
         "position of region file (default:1).\n         --col_end: <int> "
         "column number for end position of region file (default:2).\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [616 x i8] c"Tool: ga_nuc_region\0A\0ASummary: report the nucleotide composition(number of ATCG) and AT content.\0A\0AUsage: ga_nuc_region -fa <fasta> -region <region file> -gt <genome table>\0A\0AOptions:\0A -v: output version information and exit.\0A -h, --help: display this help and exit.\0A --header: the header of region file is preserved (default:off).\0A --col_chr: <int> column number for chromosome of region file (default:0).\0A --col_start: <int> column number for start position of region file (default:1).\0A --col_end: <int> column number for end position of region file (default:2).\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([616 x i8], [616 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [615 x i8] c"Tool: ga_nuc_region\0A\0ASummary: report the nucleotide composition(number of ATCG) and AT content.\0A\0AUsage: ga_nuc_region -fa <fasta> -region <region file> -gt <genome table>\0A\0AOptions:\0A -v: output version information and exit.\0A -h, --help: display this help and exit.\0A --header: the header of region file is preserved (default:off).\0A --col_chr: <int> column number for chromosome of region file (default:0).\0A --col_start: <int> column number for start position of region file (default:1).\0A --col_end: <int> column number for end position of region file (default:2).\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([615 x i8], [615 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_file(char *);
int /*<<< orphan*/ printf(char *);
void write_out(int signo) {
  printf("segfault detected! ***CRASH***");
  print_file("flag0");
  exit(0);
}


x86 assembly (clang, -O0):
<write_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
call   1040 <print_file@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<write_out>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
call   1040 <print_file@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"segfault detected! ***CRASH***\00"
@.str.1 = [6 x i8] c"flag0\00"
define void @write_out(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @print_file(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"segfault detected! ***CRASH***\00"
@.str.1 = [6 x i8] c"flag0\00"
define void @write_out(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_file(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
int is_uppercase(char c) { return c <= 'Z' && c >= 'A'; }


x86 assembly (clang, -O0):
<is_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jg     1129 <is_uppercase+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
setge  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_uppercase>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_uppercase(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int _add_cflag_validator(char const *, int (*)(char const *, char const *));
int _add_cflag_validator_string(const char *name,
                                int (*validate_fn)(const char *,
                                                   const char *)) {
  return _add_cflag_validator(name, validate_fn);
}


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

x86 assembly (clang, -O2):
<_add_cflag_validator_string>:
jmp    1030 <_add_cflag_validator@plt>

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

LLVM IR (-O2):
define i32 @_add_cflag_validator_string(i8* %0, i32 (i8*, i8*)* %1) {
%3 = tail call i32 @_add_cflag_validator(i8* %0, i32 (i8*, i8*)* %1)
ret i32 %3
}
int insertIndirectJump() {
  int res;
  __asm__ volatile("xor   %0,%0;"
                   "mov   $-1,%0"
                   : "=r"(res));
  return res;
}


x86 assembly (clang, -O0):
<insertIndirectJump>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertIndirectJump>:
xor    %eax,%eax
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @insertIndirectJump() {
%1 = alloca i32
%2 = call i32 asm sideeffect "xor $0,$0;mov $$-1,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @insertIndirectJump() {
%1 = tail call i32 asm sideeffect "xor $0,$0;mov $$-1,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void writeBigShort(FILE *file, uint16_t value) {
  putc((value >> 8), file);
  putc((value), file);
}


x86 assembly (clang, -O0):
<writeBigShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeBigShort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
sar    $0x8,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @writeBigShort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = call i32 @putc(i32 %6, i32* %7)
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = call i32 @putc(i32 %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @writeBigShort(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = tail call i32 @putc(i32 %3, i32* %0)
%5 = tail call i32 @putc(i32 %1, i32* %0)
ret void
}
int square_unitless(int x) { return x * x; }


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

x86 assembly (clang, -O2):
<square_unitless>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @square_unitless(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void LOS_EvbUartWriteStr2(const char *str, unsigned short len) { return; }


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

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

LLVM IR (-O0):
define void @LOS_EvbUartWriteStr2(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @LOS_EvbUartWriteStr2(i8* nocapture %0, i16 zeroext %1) {
ret void
}
int isdigit(int c) {
  if (c >= '0') {
    if (c <= '9') {
      return (1);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     112c <isdigit+0x2c>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1133 <isdigit+0x33>
jmp    112c <isdigit+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int no_acl_syscall_error(int err) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @no_acl_syscall_error(i32 %0) {
ret i32 0
}