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

/* Variables and functions */
uint32_t int_log2(uint32_t x) {
  uint32_t count = 0;
  while (x > 0) {
    x >>= 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<int_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <int_log2+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <int_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_log2>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <int_log2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <int_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_log2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
__attribute__((no)) long trampoline_collect_stat(void) {
  long ret;
  __asm__ __volatile__("leaq 1f(%%rip), %%r11\n\t"
                       "movq %%r11, %%fs:0x20\n\t"
                       "jmpq *%%gs:0x10000+"
                       "0xE8"
                       "\n\t"
                       "1:\n\t"
                       : "=a"(ret)
                       :
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<trampoline_collect_stat>:
push   %rbp
mov    %rsp,%rbp
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100e8
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_collect_stat>:
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100e8
ret

LLVM IR (-O0):
define i64 @trampoline_collect_stat() {
%1 = alloca i64
%2 = call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xE8\0A\091:\0A\09", "={ax},~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @trampoline_collect_stat() {
%1 = tail call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xE8\0A\091:\0A\09", "={ax},~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void serial_setopts_(volatile unsigned char *UART, unsigned int opts) {
  UART[0x0C] = opts & (~(1 << 7));
}


x86 assembly (clang, -O0):
<serial_setopts_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffffff7f,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_setopts_>:
and    $0x7f,%sil
mov    %sil,0xc(%rdi)
ret

LLVM IR (-O0):
define void @serial_setopts_(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, -129
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 12
store volatile i8 %7, i8* %9
ret void
}

LLVM IR (-O2):
define void @serial_setopts_(i8* %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = and i8 %3, 127
%5 = getelementptr inbounds i8, i8* %0, i64 12
store volatile i8 %4, i8* %5
ret void
}
int on_write_data(struct fs_context *context, int cid) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.fs_context = type opaque
define i32 @on_write_data(%struct.fs_context* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int do_send(int, char *, char const *, char const *);
int irc_topic(int fd, const char *channel, const char *topic) {
  return do_send(fd, "TOPIC %s :%s", channel, topic);
}


x86 assembly (clang, -O0):
<irc_topic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <do_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_topic>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"TOPIC %s :%s\00"
define i32 @irc_topic(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @do_send(i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"TOPIC %s :%s\00"
define i32 @irc_topic(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double fabs(double);
void assert_approx_equal(double a, double b) { assert(fabs(a - b) < 0.005); }


x86 assembly (clang, -O0):
<assert_approx_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xedd(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_approx_equal>:
subsd  %xmm1,%xmm0
andpd  0xee4(%rip),%xmm0
movsd  0xeec(%rip),%xmm1
xor    %edi,%edi
ucomisd %xmm0,%xmm1
seta   %dil
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @assert_approx_equal(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* %4
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
%9 = fcmp olt double %8, 5.000000e-03
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @assert_approx_equal(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 5.000000e-03
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p224_to_bytes(uintptr_t, uintptr_t);
void fiat_p224_to_bytes(uint8_t out1[28], const uint64_t arg1[4]) {
  internal_fiat_p224_to_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p224_to_bytes>:
jmp    1030 <internal_fiat_p224_to_bytes@plt>

LLVM IR (-O0):
define void @fiat_p224_to_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p224_to_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p224_to_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p224_to_bytes(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int f496(int *);
int f497(int *p) { return f496(p); }


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

x86 assembly (clang, -O2):
<f497>:
jmp    1030 <f496@plt>

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

LLVM IR (-O2):
define i32 @f497(i32* %0) {
%2 = tail call i32 @f496(i32* %0)
ret i32 %2
}
int param_is_interval(int p) { return (p >= 8) && (p <= 19); }


x86 assembly (clang, -O0):
<param_is_interval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <param_is_interval+0x20>
cmpl   $0x13,-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):
<param_is_interval>:
add    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0xc,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @param_is_interval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 8
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 19
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 @param_is_interval(i32 %0) {
%2 = add i32 %0, -8
%3 = icmp ult i32 %2, 12
%4 = zext i1 %3 to i32
ret i32 %4
}
void set_uint32(unsigned char *p, unsigned int v) {
  p[0] = (v >> 24) & 0xff;
  p[1] = (v >> 16) & 0xff;
  p[2] = (v >> 8) & 0xff;
  p[3] = v & 0xff;
}


x86 assembly (clang, -O0):
<set_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_uint32>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set_uint32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = lshr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @set_uint32(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void masked_write(uint32_t *dst, uint32_t value, uint32_t mask) {
  *dst = (*dst & ~mask) | (value & mask);
}


x86 assembly (clang, -O0):
<masked_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%ecx
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<masked_write>:
mov    (%rdi),%eax
xor    %eax,%esi
and    %edx,%esi
xor    %eax,%esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @masked_write(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = xor i32 %2, -1
%6 = and i32 %4, %5
%7 = and i32 %2, %1
%8 = or i32 %6, %7
store i32 %8, i32* %0
ret void
}
char *strcpy(char *dest, const char *src) {
  char *res = dest;
  while (*src != '\0')
    *dest++ = *src++;
  *dest++ = *src++;
  return res;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <strcpy+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
unsigned int merge_two_u(unsigned int a, unsigned int b, int n) {
  return (a << n) + b;
}


x86 assembly (clang, -O0):
<merge_two_u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_two_u>:
mov    %edx,%ecx
shl    %cl,%edi
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @merge_two_u(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, %2
%5 = add i32 %4, %1
ret i32 %5
}
int x27_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x27_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
getpriority(char c) {
  if (c == '*' || c == '/' || c == '%')
    return 3;
  if (c == '+' || c == '-')
    return 2;
  else
    return 1;
}


x86 assembly (clang, -O0):
<getpriority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     1131 <getpriority+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     1131 <getpriority+0x31>
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
jne    113d <getpriority+0x3d>
movl   $0x3,-0x4(%rbp)
jmp    116a <getpriority+0x6a>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1157 <getpriority+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1163 <getpriority+0x63>
movl   $0x2,-0x4(%rbp)
jmp    116a <getpriority+0x6a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpriority>:
add    $0xdb,%dil
mov    $0x1,%eax
cmp    $0xa,%dil
ja     111d <getpriority+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getpriority(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 42
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 37
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 3, i32* %2
br label %26
16: ; preds = %11
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 43
br i1 %19, label %24, label %20
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 45
br i1 %23, label %24, label %25
24: ; preds = %20, %16
store i32 2, i32* %2
br label %26
25: ; preds = %20
store i32 1, i32* %2
br label %26
26: ; preds = %25, %24, %15
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@switch.table.getpriority = [11 x i32] [i32 3, i32 1, i32 1, i32 1, i32 1, i32 3, i32 2, i32 1, i32 2, i32 1, i32 3]
define i32 @getpriority(i8 signext %0) {
%2 = add i8 %0, -37
%3 = icmp ult i8 %2, 11
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.getpriority, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *tx_strdup(const char *s1) {
  assert(s1 != NULL);
  size_t len = strlen(s1) + 1;
  char *s2 = malloc(len);
  if (s2 == NULL)
    return NULL;
  memcpy(s2, s1, len);
  return s2;
}


x86 assembly (clang, -O0):
<tx_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1195 <tx_strdup+0x55>
movq   $0x0,-0x8(%rbp)
jmp    11ae <tx_strdup+0x6e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1182 <tx_strdup+0x42>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @tx_strdup(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = tail call i8* @malloc(i64 %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = tail call i32 @memcpy(i8* %8, i8* %0, i64 %7)
br label %12
12: ; preds = %1, %10
ret i8* %8
}
/* Variables and functions */
char *strchr(char *, char);
int /*<<< orphan*/ util_strscpy(char *, size_t, char const *);
const char *keyval(const char *str, const char **val, char *buf, size_t size) {
  char *pos;
  util_strscpy(buf, size, str);
  pos = strchr(buf, '=');
  if (pos != NULL) {
    pos[0] = 0;
    pos++;
  }
  *val = pos;
  return buf;
}


x86 assembly (clang, -O0):
<keyval>:
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    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <util_strscpy@plt>
mov    -0x18(%rbp),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1179 <keyval+0x59>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyval>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rdx
mov    %rbx,%rdi
mov    %rcx,%rsi
call   1030 <util_strscpy@plt>
mov    %rbx,%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1153 <keyval+0x33>
movb   $0x0,(%rax)
add    $0x1,%rax
jmp    1155 <keyval+0x35>
xor    %eax,%eax
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @keyval(i8* %0, i8** nocapture writeonly %1, i8* returned %2, i64 %3) {
%5 = tail call i32 @util_strscpy(i8* %2, i64 %3, i8* %0)
%6 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 61)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %4
store i8 0, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
br label %10
10: ; preds = %8, %4
%11 = phi i8* [ %9, %8 ], [ null, %4 ]
store i8* %11, i8** %1
ret i8* %2
}
float kph_to_mph(float value) { return value * 0.6213711922f; }


x86 assembly (clang, -O0):
<kph_to_mph>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kph_to_mph>:
mulss  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @kph_to_mph(float %0) {
%2 = fmul float %0, 0x3FE3E245E0000000
ret float %2
}
__attribute__((always_)) unsigned min_unsigned(unsigned a, unsigned b) {
  return a < b ? a : b;
}


x86 assembly (clang, -O0):
<min_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <min_unsigned+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min_unsigned+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @min_unsigned(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 = icmp ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min_unsigned(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
char *strsep(char **s, const char *ct) {
  char *sbegin = *s;
  char *end;
  if (sbegin == ((void *)0))
    return ((void *)0);
  end = strpbrk(sbegin, ct);
  if (end)
    *end++ = '\0';
  *s = end;
  return sbegin;
}


x86 assembly (clang, -O0):
<strsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1143 <strsep+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1184 <strsep+0x74>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1171 <strsep+0x61>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsep>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
test   %rbx,%rbx
je     113d <strsep+0x2d>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strpbrk@plt>
test   %rax,%rax
je     1138 <strsep+0x28>
mov    %rax,%rcx
add    $0x1,%rcx
movb   $0x0,(%rax)
jmp    113a <strsep+0x2a>
xor    %ecx,%ecx
mov    %rcx,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strsep(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i8* @strpbrk(i8* %3, i8* %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %6
br label %10
10: ; preds = %8, %5
%11 = phi i8* [ %9, %8 ], [ null, %5 ]
store i8* %11, i8** %0
br label %12
12: ; preds = %2, %10
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ gen_halo(int, int, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  gen_halo(-1, 1, NULL, 1);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @gen_halo(i32 -1, i32 1, i32* null, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @gen_halo(i32 -1, i32 1, i32* null, i32 1)
ret i32 0
}
/* Variables and functions */
double pow(double, double);
double spow(double x, double y) { return x < 0.0 ? -pow(-x, y) : pow(x, y); }


x86 assembly (clang, -O0):
<spow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1177 <spow+0x67>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    118b <spow+0x7b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spow>:
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jbe    1132 <spow+0x22>
push   %rax
xorpd  0xedd(%rip),%xmm0
call   1030 <pow@plt>
xorpd  0xed0(%rip),%xmm0
pop    %rax
ret
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @spow(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 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load double, double* %3
%9 = fneg double %8
%10 = load double, double* %4
%11 = call double @pow(double %9, double %10)
%12 = fneg double %11
br label %17
13: ; preds = %2
%14 = load double, double* %3
%15 = load double, double* %4
%16 = call double @pow(double %14, double %15)
br label %17
17: ; preds = %13, %7
%18 = phi double [ %12, %7 ], [ %16, %13 ]
ret double %18
}

LLVM IR (-O2):
define double @spow(double %0, double %1) {
%3 = fcmp olt double %0, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = fneg double %0
%6 = tail call double @pow(double %5, double %1)
%7 = fneg double %6
br label %10
8: ; preds = %2
%9 = tail call double @pow(double %0, double %1)
br label %10
10: ; preds = %8, %4
%11 = phi double [ %7, %4 ], [ %9, %8 ]
ret double %11
}
void X509_print_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_print_fp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ saveaddr(int /*<<< orphan*/, void *);
void saveaddrsep(const char *p, void *ptr) {
  while (*p)
    saveaddr(*p++, ptr);
}


x86 assembly (clang, -O0):
<saveaddrsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <saveaddrsep+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <saveaddr@plt>
jmp    1120 <saveaddrsep+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveaddrsep>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <saveaddrsep+0x36>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <saveaddr@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <saveaddrsep+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @saveaddrsep(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @saveaddr(i32 %9, i8* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fftss_plan_with_nthreads(int);
void fftss_plan_with_nthreads__(int *nthreads) {
  fftss_plan_with_nthreads(*nthreads);
}


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

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

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

LLVM IR (-O2):
define void @fftss_plan_with_nthreads__(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @fftss_plan_with_nthreads(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blink2() {
  blinkdot();
  blinkdot();
  blinkdash();
  blinkdash();
  blinkdash();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blink2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
movsd  0xea1(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink2>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
movsd  0xea4(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blink2() {
%1 = call i32 (...) @blinkdot()
%2 = call i32 (...) @blinkdot()
%3 = call i32 (...) @blinkdash()
%4 = call i32 (...) @blinkdash()
%5 = call i32 (...) @blinkdash()
%6 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blink2() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdash()
%5 = tail call i32 (...) @blinkdash()
%6 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
/* Variables and functions */
scalar_t__ EEXIST;
scalar_t__ errno;
int mkdir(char *, int);
int mkdir_p(char *path) {
  int res = mkdir(path, 0755);
  if (res < 0 && errno == EEXIST) {
    return 0;
  }
  return res;
}


x86 assembly (clang, -O0):
<mkdir_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115d <mkdir_p+0x4d>
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%rax
jne    115d <mkdir_p+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1163 <mkdir_p+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir_p>:
push   %rax
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
test   %eax,%eax
jns    1137 <mkdir_p+0x27>
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%rdx
mov    0x2eb0(%rip),%rsi
xor    %ecx,%ecx
cmp    (%rsi),%rdx
je     1139 <mkdir_p+0x29>
mov    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @mkdir_p(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @mkdir(i8* %5, i32 493)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = load i64, i64* @EEXIST
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 0, i32* %2
br label %16
14: ; preds = %9, %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %13
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@errno = global i64 0
@EEXIST = global i64 0
define i32 @mkdir_p(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 493)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EEXIST
%7 = icmp eq i64 %5, %6
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ %2, %8 ], [ 0, %4 ]
ret i32 %10
}
/* Type definitions */
struct config_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct config_parser *);
void config_parser_delete(struct config_parser *__restrict parser) {
  free(parser);
}


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

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

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

LLVM IR (-O2):
%struct.config_parser = type { i32 }
define void @config_parser_delete(%struct.config_parser* noalias nocapture %0) {
%2 = tail call i32 @free(%struct.config_parser* %0)
ret void
}
void ptrace_sandbox_permit_umask(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

LLVM IR (-O0):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_umask(%struct.pt_sandbox* %0) {
%2 = alloca %struct.pt_sandbox*
store %struct.pt_sandbox* %0, %struct.pt_sandbox** %2
%3 = load %struct.pt_sandbox*, %struct.pt_sandbox** %2
ret void
}

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_umask(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
size_t strnlen(const char *src, size_t max) {
  size_t i = 0;
  while ((*src++) && (i < max))
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1142 <strnlen+0x42>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1163 <strnlen+0x63>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1136 <strnlen+0x36>
test   %rsi,%rsi
je     1136 <strnlen+0x36>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
je     1132 <strnlen+0x32>
cmp    %rsi,%rcx
mov    %rax,%rcx
jb     1120 <strnlen+0x20>
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp ne i8 %3, 0
%5 = icmp ne i64 %1, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ 0, %2 ]
%9 = phi i8* [ %10, %7 ], [ %0, %2 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = add nuw i64 %8, 1
%12 = load i8, i8* %10
%13 = icmp ne i8 %12, 0
%14 = icmp ult i64 %11, %1
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %7, label %16
16: ; preds = %7, %2
%17 = phi i64 [ 0, %2 ], [ %11, %7 ]
ret i64 %17
}
/* Variables and functions */
char *strrchr(char *, int);
char *split_at_right(char *string, int delimiter) {
  char *cp;
  if ((cp = strrchr(string, delimiter)) != 0)
    *cp++ = 0;
  return (cp);
}


x86 assembly (clang, -O0):
<split_at_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114b <split_at_right+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_at_right>:
push   %rax
call   1030 <strrchr@plt>
test   %rax,%rax
je     1127 <split_at_right+0x17>
mov    %rax,%rcx
add    $0x1,%rax
movb   $0x0,(%rcx)
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @split_at_right(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
br label %7
7: ; preds = %5, %2
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
void nvm_put_blk(struct nvm_dev *dev, struct nvm_block *blk) {}


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

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

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

LLVM IR (-O2):
%struct.nvm_dev = type opaque
%struct.nvm_block = type opaque
define void @nvm_put_blk(%struct.nvm_dev* nocapture %0, %struct.nvm_block* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_email();
int /*<<< orphan*/ setup_fs();
void setup_vr() {
  setup_fs();
  setup_email();
}


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

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

LLVM IR (-O0):
define void @setup_vr() {
%1 = call i32 (...) @setup_fs()
%2 = call i32 (...) @setup_email()
ret void
}

LLVM IR (-O2):
define void @setup_vr() {
%1 = tail call i32 (...) @setup_fs()
%2 = tail call i32 (...) @setup_email()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseqdx_set_color(uint8_t *p_mp2vseqdx) { p_mp2vseqdx[4] |= 0x1; }


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

x86 assembly (clang, -O2):
<mp2vseqdx_set_color>:
orb    $0x1,0x10(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseqdx_set_color(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = or i32 %5, 1
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mp2vseqdx_set_color(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = or i32 %3, 1
store i32 %4, i32* %2
ret void
}