xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t read_le48(unsigned char *in) {
  uint64_t result = 0;
  result |= (uint64_t)in[0];
  result |= (uint64_t)in[1] << 8;
  result |= (uint64_t)in[2] << 16;
  result |= (uint64_t)in[3] << 24;
  result |= (uint64_t)in[4] << 32;
  result |= (uint64_t)in[5] << 40;
  return result;
}


x86 assembly (clang, -O0):
<read_le48>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
mov    $0x28,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_le48(i8* nocapture readnone %0) {
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void outw(uint16_t value, uint16_t port) {}


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

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

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

LLVM IR (-O2):
define void @outw(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int ttytest(void) {
  int fd;
  fd = open("/dev/tty", O_RDWR);
  close(fd);
  return fd >= 0;
}


x86 assembly (clang, -O0):
<ttytest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttytest>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <close@plt>
not    %ebx
shr    $0x1f,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/tty\00"
@O_RDWR = global i32 0
define i32 @ttytest() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @close(i32 %4)
%6 = load i32, i32* %1
%7 = icmp sge i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/tty\00"
@O_RDWR = global i32 0
define i32 @ttytest() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @close(i32 %2)
%4 = xor i32 %2, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int skip2thingamy(int /*<<< orphan*/ *, char *);
int skip2glyph(FILE *pcl) { return (skip2thingamy(pcl, "(s")); }


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

x86 assembly (clang, -O2):
<skip2glyph>:
lea    0xee9(%rip),%rsi
jmp    1030 <skip2thingamy@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"(s\00"
define i32 @skip2glyph(i32* %0) {
%2 = tail call i32 @skip2thingamy(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wattr_off(int /*<<< orphan*/ *, int /*<<< orphan*/, void *);
int __darwin_wattr_off(WINDOW *w, uint32_t a, void *p) {
  return wattr_off(w, a, p);
}


x86 assembly (clang, -O0):
<__darwin_wattr_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <wattr_off@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__darwin_wattr_off>:
jmp    1030 <wattr_off@plt>

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

LLVM IR (-O2):
define i32 @__darwin_wattr_off(i32* %0, i32 %1, i8* %2) {
%4 = tail call i32 @wattr_off(i32* %0, i32 %1, i8* %2)
ret i32 %4
}
unsigned umin1(unsigned a, unsigned b) { return a ^ ((a ^ b) & -(a > b)); }


x86 assembly (clang, -O0):
<umin1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
cmp    -0x8(%rbp),%edx
seta   %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
and    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @umin1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp ugt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = and i32 %8, %13
%15 = xor i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @umin1(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
void *fn2(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @fn2() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @fn2() {
ret i8* null
}
/* Variables and functions */
double exp(double);
double fabs(double);
int log(double);
double logi_b2(double x) {
  x = -fabs(x);
  return exp(x - 2 * log(1 + exp(x)));
}


x86 assembly (clang, -O0):
<logi_b2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xed7(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe88(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  -0x10(%rbp),%xmm0
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logi_b2>:
sub    $0x18,%rsp
orpd   0xed4(%rip),%xmm0
movapd %xmm0,(%rsp)
call   1030 <exp@plt>
addsd  0xed2(%rip),%xmm0
call   1040 <log@plt>
add    %eax,%eax
cvtsi2sd %eax,%xmm1
movapd (%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @logi_b2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = fneg double %4
store double %5, double* %2
%6 = load double, double* %2
%7 = load double, double* %2
%8 = call double @exp(double %7)
%9 = fadd double 1.000000e+00, %8
%10 = call i32 @log(double %9)
%11 = mul nsw i32 2, %10
%12 = sitofp i32 %11 to double
%13 = fsub double %6, %12
%14 = call double @exp(double %13)
ret double %14
}

LLVM IR (-O2):
define double @logi_b2(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fneg double %2
%4 = tail call double @exp(double %3)
%5 = fadd double %4, 1.000000e+00
%6 = tail call i32 @log(double %5)
%7 = shl nsw i32 %6, 1
%8 = sitofp i32 %7 to double
%9 = fsub double %3, %8
%10 = tail call double @exp(double %9)
ret double %10
}
void FinalizePar() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
alarmHandler() {
  extern jmp_buf TimeoutJmpBuf;
  longjmp(TimeoutJmpBuf, (int)1);
}


x86 assembly (clang, -O0):
<alarmHandler>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <longjmp@plt>

x86 assembly (clang, -O2):
<alarmHandler>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <longjmp@plt>

LLVM IR (-O0):
@TimeoutJmpBuf = external global i32
define i32 @alarmHandler() {
%1 = load i32, i32* @TimeoutJmpBuf
%2 = call i32 @longjmp(i32 %1, i32 1)
unreachable
}

LLVM IR (-O2):
@TimeoutJmpBuf = external global i32
define i32 @alarmHandler() {
%1 = load i32, i32* @TimeoutJmpBuf
%2 = tail call i32 @longjmp(i32 %1, i32 1)
unreachable
}
void RTLogCloneRC(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ nrf_802154_swi_notify_energy_detected(int /*<<< orphan*/);
void nrf_802154_notify_energy_detected(uint8_t result) {
  nrf_802154_swi_notify_energy_detected(result);
}


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

x86 assembly (clang, -O2):
<nrf_802154_notify_energy_detected>:
jmp    1030 <nrf_802154_swi_notify_energy_detected@plt>

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

LLVM IR (-O2):
define void @nrf_802154_notify_energy_detected(i32 %0) {
%2 = tail call i32 @nrf_802154_swi_notify_energy_detected(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int);
void ft_putnbr(int n) {
  if (n < 0) {
    ft_putchar('-');
    n = -n;
  }
  if (n / 10 > 0)
    ft_putnbr(n / 10);
  ft_putchar('0' + n % 10);
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1147 <ft_putnbr+0x27>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jle    116d <ft_putnbr+0x4d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jns    1136 <ft_putnbr+0x16>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
neg    %ebx
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     1150 <ft_putnbr+0x30>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <ft_putnbr@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @ft_putchar(i32 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = icmp ugt i32 %7, 9
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = udiv i32 %7, 10
tail call void @ft_putnbr(i32 %10)
br label %11
11: ; preds = %9, %6
%12 = urem i32 %7, 10
%13 = or i32 %12, 48
%14 = tail call i32 @ft_putchar(i32 %13)
ret void
}
void dummy(int num, int i) {}


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

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

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

LLVM IR (-O2):
define void @dummy(i32 %0, i32 %1) {
ret void
}
int test_imm_66uint16_reg(unsigned short val) {
  return ((val) & (-0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff9a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_66uint16_reg>:
test   $0xff9a,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_66uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -102
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct expression {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void show_store_gen(int bits, int value, struct expression *expr, int addr) {
  printf("\tst.%d\t\tv%d,[v%d]\n", bits, value, addr);
}


x86 assembly (clang, -O0):
<show_store_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.expression = type { i32 }
@.str = [19 x i8] c"\09st.%d\09\09v%d,[v%d]\0A\00"
define void @show_store_gen(i32 %0, i32 %1, %struct.expression* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.expression*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.expression* %2, %struct.expression** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.expression = type { i32 }
@.str = [19 x i8] c"\09st.%d\09\09v%d,[v%d]\0A\00"
define void @show_store_gen(i32 %0, i32 %1, %struct.expression* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
double sqrt(double);
double getlength(double x, double y) { return sqrt(x * x + y * y); }


x86 assembly (clang, -O0):
<getlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlength>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <getlength+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @getlength(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @getlength(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
/* Variables and functions */
void *sqlite3Malloc(int, int);
void *sqlite3MallocX(int n) { return sqlite3Malloc(n, 1); }


x86 assembly (clang, -O0):
<sqlite3MallocX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <sqlite3Malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3MallocX>:
mov    $0x1,%esi
jmp    1030 <sqlite3Malloc@plt>

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

LLVM IR (-O2):
define i8* @sqlite3MallocX(i32 %0) {
%2 = tail call i8* @sqlite3Malloc(i32 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("5단\n5 * 2 = 10");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"5\EB\8B\A8\0A5 * 2 = 10\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"5\EB\8B\A8\0A5 * 2 = 10\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ munmap(void *, size_t);
void ht_free(void *p, size_t n) { assert(munmap(p, n) == 0); }


x86 assembly (clang, -O0):
<ht_free>:
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   1040 <munmap@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_free>:
push   %rax
call   1040 <munmap@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @ht_free(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @munmap(i8* %5, i64 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
define void @ht_free(i8* %0, i64 %1) {
%3 = tail call i64 @munmap(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
int sockadap_msg() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sockadap_msg() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sphget_tb2gtod_factor();
void __attribute__((constructor)) __attribute__((visibility("hidden")))
__sphgtod_init(void) {
  sphget_tb2gtod_factor();
}


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

x86 assembly (clang, -O2):
<__sphgtod_init>:
xor    %eax,%eax
jmp    1030 <sphget_tb2gtod_factor@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__sphgtod_init, i8* null }]
define hidden void @__sphgtod_init() {
%1 = call i32 (...) @sphget_tb2gtod_factor()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__sphgtod_init, i8* null }]
define hidden void @__sphgtod_init() {
%1 = tail call i32 (...) @sphget_tb2gtod_factor()
ret void
}
int undef(void) {}


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

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

LLVM IR (-O0):
define i32 @undef() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @undef() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least16_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ endian_16hi8(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ endian_16lo8(int /*<<< orphan*/, int /*<<< orphan*/);
uint_least16_t endian_16(uint8_t hi, uint8_t lo) {
  uint_least16_t word = 0;
  endian_16lo8(word, lo);
  endian_16hi8(word, hi);
  return word;
}


x86 assembly (clang, -O0):
<endian_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <endian_16lo8@plt>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <endian_16hi8@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_16>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <endian_16lo8@plt>
xor    %edi,%edi
mov    %ebx,%esi
call   1040 <endian_16hi8@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @endian_16(i32 %0, i32 %1) {
%3 = tail call i32 @endian_16lo8(i32 0, i32 %1)
%4 = tail call i32 @endian_16hi8(i32 0, i32 %0)
ret i32 0
}
int satub(int x) {
  if (x < 0)
    return 0;
  else if (x > 255)
    return 255;
  else
    return x;
}


x86 assembly (clang, -O0):
<satub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <satub+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <satub+0x3c>
cmpl   $0xff,-0x8(%rbp)
jle    1136 <satub+0x36>
movl   $0xff,-0x4(%rbp)
jmp    113c <satub+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<satub>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @satub(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gms_styled_char(int /*<<< orphan*/, char);
void gms_normal_char(char c) { gms_styled_char((0), c); }


x86 assembly (clang, -O0):
<gms_normal_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movsbl -0x1(%rbp),%esi
call   1030 <gms_styled_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gms_normal_char>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <gms_styled_char@plt>

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

LLVM IR (-O2):
define void @gms_normal_char(i8 signext %0) {
%2 = tail call i32 @gms_styled_char(i32 0, i8 signext %0)
ret void
}
__attribute__((always_, no_instrument_function)) void __force_exit_function() {
  asm("retq");
}


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

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

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

LLVM IR (-O2):
define void @__force_exit_function() {
tail call void asm sideeffect "retq", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
unsigned int direct_hash(const void *k) {
  unsigned int h = (unsigned int)(uintptr_t)k;
  h ^= (h >> 20) ^ (h >> 12);
  return h ^ (h >> 7) ^ (h >> 4);
}


x86 assembly (clang, -O0):
<direct_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x14,%eax
mov    -0xc(%rbp),%ecx
shr    $0xc,%ecx
xor    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x7,%ecx
xor    %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x4,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_hash>:
mov    %edi,%eax
shr    $0xc,%eax
xor    %edi,%eax
mov    %edi,%ecx
shr    $0x14,%ecx
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x7,%ecx
xor    %eax,%ecx
shr    $0x4,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @direct_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = lshr i32 %7, 20
%9 = load i32, i32* %3
%10 = lshr i32 %9, 12
%11 = xor i32 %8, %10
%12 = load i32, i32* %3
%13 = xor i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = lshr i32 %15, 7
%17 = xor i32 %14, %16
%18 = load i32, i32* %3
%19 = lshr i32 %18, 4
%20 = xor i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @direct_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = lshr i32 %3, 20
%5 = lshr i32 %3, 12
%6 = xor i32 %5, %3
%7 = xor i32 %6, %4
%8 = lshr i32 %7, 7
%9 = xor i32 %8, %7
%10 = lshr i32 %7, 4
%11 = xor i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void uclose(int fid) { close(fid); }


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

x86 assembly (clang, -O2):
<uclose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @uclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *threadfunc(void *dummy) {
  while (1) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<threadfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    111c <threadfunc+0xc>

x86 assembly (clang, -O2):
<threadfunc>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <threadfunc+0x10>

LLVM IR (-O0):
define i8* @threadfunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @threadfunc(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *open_fastq(char *filename) {
  FILE *fd1 = fopen(filename, "r");
  if (fd1 == NULL) {
    fprintf(stderr, "[ERROR] Unable to open %s\n", filename);
    exit(1);
  }
  return (fd1);
}


x86 assembly (clang, -O0):
<open_fastq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117e <open_fastq+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_fastq>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <open_fastq+0x17>
pop    %rbx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"[ERROR] Unable to open %s\0A\00"
define i32* @open_fastq(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i32*, i32** %3
ret i32* %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"[ERROR] Unable to open %s\0A\00"
define noalias i32* @open_fastq(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i32* %2
}
void tdef(int n) {
  typedef int A[n];
  A a;
  A *p;
  p = &a;
}


x86 assembly (clang, -O0):
<tdef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tdef(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i32, i64 %7
store i64 %7, i64* %4
store i32* %9, i32** %5
%10 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @tdef(i32 %0) {
ret void
}
double normal_fma(double b, double c, double d) { return (b * c) + d; }


x86 assembly (clang, -O0):
<normal_fma>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal_fma>:
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @normal_fma(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @normal_fma(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
double sla_epb_(double *);
double slaEpb(double date) { return sla_epb_(&date); }


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

x86 assembly (clang, -O2):
<slaEpb>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_epb_@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @slaEpb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @sla_epb_(double* %2)
ret double %3
}

LLVM IR (-O2):
define double @slaEpb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @sla_epb_(double* %2)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank2Low(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank2();
void m22_setParamsCXX0(uint16_t addr, uint8_t val) {
  __setCHRBank2Low(addr, val);
  m22_SetChrROMBank2();
}


x86 assembly (clang, -O0):
<m22_setParamsCXX0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__setCHRBank2Low@plt>
mov    $0x0,%al
call   1040 <m22_SetChrROMBank2@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @m22_setParamsCXX0(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank2Low(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank2()
ret void
}
int test_imm_1Aint64_highword_reg(long long val) {
  return ((val >> 32) & (0x1A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Aint64_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, 26
%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_1Aint64_highword_reg(i64 %0) {
%2 = and i64 %0, 111669149696
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void je_near_rj(unsigned long saut) {
  put8(0x0F);
  put8(0x84);
  put32(saut);
}


x86 assembly (clang, -O0):
<je_near_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x84,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<je_near_rj>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x84,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @je_near_rj(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 15)
%4 = call i32 @put8(i32 132)
%5 = load i64, i64* %2
%6 = call i32 @put32(i64 %5)
ret void
}

LLVM IR (-O2):
define void @je_near_rj(i64 %0) {
%2 = tail call i32 @put8(i32 15)
%3 = tail call i32 @put8(i32 132)
%4 = tail call i32 @put32(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
void *doOpen(char const *, int /*<<< orphan*/);
void *__PHYSFS_platformOpenRead(const char *filename) {
  return doOpen(filename, O_RDONLY);
}


x86 assembly (clang, -O0):
<__PHYSFS_platformOpenRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <doOpen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__PHYSFS_platformOpenRead>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <doOpen@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i8* @__PHYSFS_platformOpenRead(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDONLY
%5 = call i8* @doOpen(i8* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i8* @__PHYSFS_platformOpenRead(i8* %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i8* @doOpen(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ iowait();
int /*<<< orphan*/ ps2_controller_read_ready();
int mouse_scan() {
  ps2_controller_read_ready();
  int data = inb(0x60);
  iowait();
  return data;
}


x86 assembly (clang, -O0):
<mouse_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ps2_controller_read_ready@plt>
mov    $0x60,%edi
call   1040 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <iowait@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouse_scan>:
push   %rbx
xor    %eax,%eax
call   1050 <ps2_controller_read_ready@plt>
mov    $0x60,%edi
call   1040 <inb@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <iowait@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mouse_scan() {
%1 = alloca i32
%2 = call i32 (...) @ps2_controller_read_ready()
%3 = call i32 @inb(i32 96)
store i32 %3, i32* %1
%4 = call i32 (...) @iowait()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @mouse_scan() {
%1 = tail call i32 (...) @ps2_controller_read_ready()
%2 = tail call i32 @inb(i32 96)
%3 = tail call i32 (...) @iowait()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ uputs(char *);
void main() { uputs("Hello, World! uputs is magic.\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Hello, World! uputs is magic.\0A\00"
define void @main() {
%1 = call i32 @uputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Hello, World! uputs is magic.\0A\00"
define void @main() {
%1 = tail call i32 @uputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
int /*<<< orphan*/ GLOB_TILDE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int glob(char *, int /*<<< orphan*/, int /*<<< orphan*/ *,
         int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
glob_t get_log_list(void) {
  glob_t globstruct;
  int rc;
  rc = glob("~/.logfind/*", GLOB_TILDE, NULL, &globstruct);
  if (rc != 0) {
    printf("There was an error with the glob function.");
    exit(0);
  }
  return globstruct;
}


x86 assembly (clang, -O0):
<get_log_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
lea    -0x4(%rbp),%rcx
call   1040 <glob@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1175 <get_log_list+0x45>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_log_list>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rcx
xor    %edx,%edx
call   1040 <glob@plt>
test   %eax,%eax
jne    1157 <get_log_list+0x27>
mov    0x4(%rsp),%eax
pop    %rcx
ret
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"~/.logfind/*\00"
@GLOB_TILDE = global i32 0
@.str.1 = [43 x i8] c"There was an error with the glob function.\00"
define i32 @get_log_list() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @GLOB_TILDE
%4 = call i32 @glob(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, i32* null, i32* %1)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"~/.logfind/*\00"
@GLOB_TILDE = global i32 0
@.str.1 = [43 x i8] c"There was an error with the glob function.\00"
define i32 @get_log_list() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @GLOB_TILDE
%4 = call i32 @glob(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, i32* null, i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int pthread_self();
void *printStuff() {
  printf("Nova thread criada. TID = %u!\n", pthread_self());
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<printStuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStuff>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Nova thread criada. TID = %u!\0A\00"
define i8* @printStuff() {
%1 = alloca i8*
%2 = call i32 (...) @pthread_self()
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @pthread_exit(i32* null)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@.str = [31 x i8] c"Nova thread criada. TID = %u!\0A\00"
define noalias i8* @printStuff() {
%1 = tail call i32 (...) @pthread_self()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
float remainingAngle(float angleA, float angleB) {
  float angleC;
  angleC = (180 - (angleA + angleB));
  printf("The remaining angle for %f and %f is %f\n", angleA, angleB, angleC);
  return angleC;
}


x86 assembly (clang, -O0):
<remainingAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
movss  0xecc(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainingAngle>:
push   %rax
movaps %xmm0,%xmm3
addss  %xmm1,%xmm3
movss  0xee0(%rip),%xmm2
subss  %xmm3,%xmm2
movss  %xmm2,0x4(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [41 x i8] c"The remaining angle for %f and %f is %f\0A\00"
define float @remainingAngle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fadd float %6, %7
%9 = fsub float 1.800000e+02, %8
store float %9, float* %5
%10 = load float, float* %3
%11 = load float, float* %4
%12 = load float, float* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), float %10, float %11, float %12)
%14 = load float, float* %5
ret float %14
}

LLVM IR (-O2):
@.str = [41 x i8] c"The remaining angle for %f and %f is %f\0A\00"
define float @remainingAngle(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fsub float 1.800000e+02, %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), float %0, float %1, float %4)
ret float %4
}