xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_entry(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t n) {
  void *retval = malloc(n);
  if (!retval) {
    log_entry(errno, "cannot allocate %d bytes", n);
    exit(1);
  }
  return (retval);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <log_entry@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <log_entry@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [25 x i8] c"cannot allocate %d bytes\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = load i64, i64* %2
%11 = call i32 @log_entry(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [25 x i8] c"cannot allocate %d bytes\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @log_entry(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int combo(int m, int n) {}


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

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

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

LLVM IR (-O2):
define i32 @combo(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int strtol(char const *, char **, int);
int get_int_arg(const char *arg, int *val) {
  char *endptr = (char *)arg;
  *val = strtol(arg, &endptr, 10);
  return (*endptr) ? -1 : 0;
}


x86 assembly (clang, -O0):
<get_int_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int_arg>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rax
xor    %ecx,%ecx
cmp    (%rax),%cl
sbb    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_int_arg(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
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = call i32 @strtol(i8* %7, i8** %5, i32 10)
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_int_arg(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* %0, i8** %3
%5 = call i32 @strtol(i8* %0, i8** %3, i32 10)
store i32 %5, i32* %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = sext i1 %8 to i32
ret i32 %9
}
void test_add_fixit_insert_formatted_single_line(void) {
  {}
}


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

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

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

LLVM IR (-O2):
define void @test_add_fixit_insert_formatted_single_line() {
ret void
}
unsigned short int f70(unsigned short int x, unsigned long int y) {
  return (x << y) + (x >> (8 * 2 - y));
}


x86 assembly (clang, -O0):
<f70>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f70>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x10,%dl
sub    %cl,%dl
mov    %edx,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f70(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 16, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %11, %14
%16 = add nsw i32 %9, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f70(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = sub i32 16, %4
%7 = lshr i32 %3, %6
%8 = add nsw i32 %7, %5
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ gl_err(char *);
char *strdup(char *);
char *gl_strdup(char *str) {
  char *s;
  s = strdup(str);
  if (!s)
    gl_err("No more memory");
  return s;
}


x86 assembly (clang, -O0):
<gl_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <gl_strdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <gl_err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <gl_strdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <gl_err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"No more memory\00"
define i8* @gl_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @gl_err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"No more memory\00"
define noalias i8* @gl_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @gl_err(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_sstdevpn(int /*<<< orphan*/ const, float const,
                              float const *, int /*<<< orphan*/ const);
float stdlib_strided_sstdev(const int64_t N, const float correction,
                            const float *X, const int64_t stride) {
  return stdlib_strided_sstdevpn(N, correction, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_sstdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_sstdevpn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_sstdev>:
jmp    1030 <stdlib_strided_sstdevpn@plt>

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

LLVM IR (-O2):
define float @stdlib_strided_sstdev(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call float @stdlib_strided_sstdevpn(i32 %0, float %1, float* %2, i32 %3)
ret float %5
}
void save_processor_state(void) { return; }


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

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

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

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

/* Variables and functions */
int mutex_unlock(int /*<<< orphan*/ *);
int mtx_unlock(mtx_t *mtx) { return mutex_unlock(mtx); }


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

x86 assembly (clang, -O2):
<mtx_unlock>:
jmp    1030 <mutex_unlock@plt>

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

LLVM IR (-O2):
define i32 @mtx_unlock(i32* %0) {
%2 = tail call i32 @mutex_unlock(i32* %0)
ret i32 %2
}
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fatorial(5));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <fatorial@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fatorial(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int main() { int *val = malloc(sizeof(int)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
ret i32 0
}
long ldlong(p)
register char *p;
{
  int i;
  register unsigned int val;
  val = 0;
  for (i = 0; i < 32 / 8; i++)
    val = (val << 8) + *((unsigned char *)p++);
  return ((long)val);
}


x86 assembly (clang, -O0):
<ldlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    114b <ldlong+0x4b>
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <ldlong+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldlong>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @ldlong(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %8, %9
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %5
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %11
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_setzero_si128();
__m128i test_mm_setzero_si128() { return _mm_setzero_si128(); }


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

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

LLVM IR (-O0):
define i32 @test_mm_setzero_si128() {
%1 = call i32 (...) @_mm_setzero_si128()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_mm_setzero_si128() {
%1 = tail call i32 (...) @_mm_setzero_si128()
ret i32 %1
}
int mutils_base64_encode_len(int len) { return ((len + 2) / 3 * 4) + 1; }


x86 assembly (clang, -O0):
<mutils_base64_encode_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutils_base64_encode_len>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    0x1(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @mutils_base64_encode_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 4
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @mutils_base64_encode_len(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
%5 = or i32 %4, 1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct fp_dscv_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fp_driver_get_driver_id(int /*<<< orphan*/);
int /*<<< orphan*/ fp_dscv_dev_get_driver(struct fp_dscv_dev *);
uint16_t fp_dscv_dev_get_driver_id(struct fp_dscv_dev *dev) {
  return fp_driver_get_driver_id(fp_dscv_dev_get_driver(dev));
}


x86 assembly (clang, -O0):
<fp_dscv_dev_get_driver_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fp_dscv_dev_get_driver@plt>
mov    %eax,%edi
call   1040 <fp_driver_get_driver_id@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fp_dscv_dev = type { i32 }
define i32 @fp_dscv_dev_get_driver_id(%struct.fp_dscv_dev* %0) {
%2 = alloca %struct.fp_dscv_dev*
store %struct.fp_dscv_dev* %0, %struct.fp_dscv_dev** %2
%3 = load %struct.fp_dscv_dev*, %struct.fp_dscv_dev** %2
%4 = call i32 @fp_dscv_dev_get_driver(%struct.fp_dscv_dev* %3)
%5 = call i32 @fp_driver_get_driver_id(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.fp_dscv_dev = type { i32 }
define i32 @fp_dscv_dev_get_driver_id(%struct.fp_dscv_dev* %0) {
%2 = tail call i32 @fp_dscv_dev_get_driver(%struct.fp_dscv_dev* %0)
%3 = tail call i32 @fp_driver_get_driver_id(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getChar();
int /*<<< orphan*/ initTable();
void init() {
  initTable();
  getChar();
}


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

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

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @initTable()
%2 = call i32 (...) @getChar()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @initTable()
%2 = tail call i32 (...) @getChar()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ namcoSetN163(int /*<<< orphan*/);
int /*<<< orphan*/ namco_setParamsD0XX_N163(int /*<<< orphan*/,
                                            int /*<<< orphan*/);
void namco_setParamsD0XX_SetN163(uint16_t addr, uint8_t val) {
  namcoSetN163(addr);
  namco_setParamsD0XX_N163(addr, val);
}


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

x86 assembly (clang, -O2):
<namco_setParamsD0XX_SetN163>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <namcoSetN163@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <namco_setParamsD0XX_N163@plt>

LLVM IR (-O0):
define void @namco_setParamsD0XX_SetN163(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @namcoSetN163(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @namco_setParamsD0XX_N163(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @namco_setParamsD0XX_SetN163(i32 %0, i32 %1) {
%3 = tail call i32 @namcoSetN163(i32 %0)
%4 = tail call i32 @namco_setParamsD0XX_N163(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setDefaultKey(char *, int *);
int /*<<< orphan*/ toUpper(char *, char *, int *);
void prepareStrings(char *str, char *key) {
  int p = 0, *keyIsNotAlpha = &p;
  toUpper(str, key, keyIsNotAlpha);
  setDefaultKey(key, keyIsNotAlpha);
}


x86 assembly (clang, -O0):
<prepareStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <toUpper@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <setDefaultKey@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepareStrings>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rdx
call   1040 <toUpper@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <setDefaultKey@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @prepareStrings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i32* %5, i32** %6
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = load i32*, i32** %6
%10 = call i32 @toUpper(i8* %7, i8* %8, i32* %9)
%11 = load i8*, i8** %4
%12 = load i32*, i32** %6
%13 = call i32 @setDefaultKey(i8* %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @prepareStrings(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @toUpper(i8* %0, i8* %1, i32* %3)
%6 = call i32 @setDefaultKey(i8* %1, i32* %3)
ret void
}
/* Variables and functions */
int getc_unlocked(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int getchar_unlocked(void) { return (getc_unlocked(stdin)); }


x86 assembly (clang, -O0):
<getchar_unlocked>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getc_unlocked@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar_unlocked>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getc_unlocked@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @getchar_unlocked() {
%1 = load i32, i32* @stdin
%2 = call i32 @getc_unlocked(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getchar_unlocked() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc_unlocked(i32 %1)
ret i32 %2
}
unsigned int pack_r(int r) { return (unsigned int)r; }


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

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

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

LLVM IR (-O2):
define i32 @pack_r(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int nvme_identify(int, int /*<<< orphan*/, int, void *);
int nvme_identify_ctrl(int fd, void *data) {
  return nvme_identify(fd, 0, 1, data);
}


x86 assembly (clang, -O0):
<nvme_identify_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <nvme_identify@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_identify_ctrl>:
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <nvme_identify@plt>

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

LLVM IR (-O2):
define i32 @nvme_identify_ctrl(i32 %0, i8* %1) {
%3 = tail call i32 @nvme_identify(i32 %0, i32 0, i32 1, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void foo2(void) { exit(0); }


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @foo2() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @foo2() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *malloc(size_t);
void *ezmbs_malloc(size_t _sz) {
  if (_sz & (sizeof(long) - 1))
    _sz += sizeof(long) - (_sz & (sizeof(long) - 1));
  return malloc(_sz);
}


x86 assembly (clang, -O0):
<ezmbs_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
cmp    $0x0,%rax
je     1146 <ezmbs_malloc+0x36>
mov    -0x8(%rbp),%rcx
and    $0x7,%rcx
mov    $0x8,%eax
sub    %rcx,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ezmbs_malloc>:
mov    %edi,%eax
and    $0x7,%eax
mov    $0x8,%ecx
sub    %rax,%rcx
test   %rax,%rax
cmove  %rax,%rcx
add    %rcx,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @ezmbs_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 7
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i64, i64* %2
%8 = and i64 %7, 7
%9 = sub i64 8, %8
%10 = load i64, i64* %2
%11 = add i64 %10, %9
store i64 %11, i64* %2
br label %12
12: ; preds = %6, %1
%13 = load i64, i64* %2
%14 = call i8* @malloc(i64 %13)
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @ezmbs_malloc(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = sub nuw nsw i64 8, %2
%5 = select i1 %3, i64 0, i64 %4
%6 = add i64 %5, %0
%7 = tail call i8* @malloc(i64 %6)
ret i8* %7
}
int do_245() { return 245; }


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

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

LLVM IR (-O0):
define i32 @do_245() {
ret i32 245
}

LLVM IR (-O2):
define i32 @do_245() {
ret i32 245
}
int get_nchunks(int size_, int ws) {
  int nchunks;
  nchunks = ws / size_;
  if (nchunks > (32 * 1024))
    nchunks = (32 * 1024);
  if (nchunks < 1)
    nchunks = 1;
  return nchunks;
}


x86 assembly (clang, -O0):
<get_nchunks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0xc(%rbp)
cmpl   $0x8000,-0xc(%rbp)
jle    1128 <get_nchunks+0x28>
movl   $0x8000,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1139 <get_nchunks+0x39>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nchunks>:
mov    %esi,%eax
cltd
idiv   %edi
cmp    $0x8000,%eax
mov    $0x8000,%ecx
cmovge %ecx,%eax
test   %eax,%eax
mov    $0x1,%ecx
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_nchunks(i32 %0, i32 %1) {
%3 = sdiv i32 %1, %0
%4 = icmp slt i32 %3, 32768
%5 = select i1 %4, i32 %3, i32 32768
%6 = icmp sgt i32 %5, 1
%7 = select i1 %6, i32 %5, i32 1
ret i32 %7
}
/* Type definitions */
struct stack_st_OPENSSL_BLOCK {
  int dummy;
};

/* Variables and functions */
scalar_t__ OPENSSL_sk_new_null();
struct stack_st_OPENSSL_BLOCK *sk_OPENSSL_BLOCK_new_null(void) {
  return (struct stack_st_OPENSSL_BLOCK *)OPENSSL_sk_new_null();
}


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

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

LLVM IR (-O0):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define %struct.stack_st_OPENSSL_BLOCK* @sk_OPENSSL_BLOCK_new_null() {
%1 = call i64 (...) @OPENSSL_sk_new_null()
%2 = inttoptr i64 %1 to %struct.stack_st_OPENSSL_BLOCK*
ret %struct.stack_st_OPENSSL_BLOCK* %2
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define %struct.stack_st_OPENSSL_BLOCK* @sk_OPENSSL_BLOCK_new_null() {
%1 = tail call i64 (...) @OPENSSL_sk_new_null()
%2 = inttoptr i64 %1 to %struct.stack_st_OPENSSL_BLOCK*
ret %struct.stack_st_OPENSSL_BLOCK* %2
}
help(str, swp) char *str;
struct swit *swp;
{
  printf("syntax: %s\n", str);
  printf("  switches are:\n");
  printsw("", swp, "-");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
lea    0xebb(%rip),%rdx
mov    $0x0,%al
call   1040 <printsw@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb3(%rip),%rdi
lea    0xead(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printsw@plt>

LLVM IR (-O0):
%struct.swit = type opaque
@.str = [12 x i8] c"syntax: %s\0A\00"
@.str.1 = [17 x i8] c" switches are:\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"-\00"
define i32 @help(i8* %0, %struct.swit* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.swit*
store i8* %0, i8** %4
store %struct.swit* %1, %struct.swit** %5
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%9 = load %struct.swit*, %struct.swit** %5
%10 = call i32 (i8*, %struct.swit*, i8*, ...) bitcast (i32 (...)* @printsw to i32 (i8*, %struct.swit*, i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %struct.swit* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.swit = type opaque
@.str = [12 x i8] c"syntax: %s\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"-\00"
@str = [16 x i8] c" switches are:\00"
define i32 @help(i8* %0, %struct.swit* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, %struct.swit*, i8*, ...) bitcast (i32 (...)* @printsw to i32 (i8*, %struct.swit*, i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %struct.swit* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, int);
int coe(int fd) { return fcntl(fd, F_SETFD, 1); }


x86 assembly (clang, -O0):
<coe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coe>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
define i32 @coe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFD
%5 = call i32 @fcntl(i32 %3, i32 %4, i32 1)
ret i32 %5
}

LLVM IR (-O2):
@F_SETFD = global i32 0
define i32 @coe(i32 %0) {
%2 = load i32, i32* @F_SETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 1)
ret i32 %3
}
double maxDouble(double a, double b) {
  if (a < b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<maxDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <maxDouble+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <maxDouble+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxDouble>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @maxDouble(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @maxDouble(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t minu8(uint8_t a, uint8_t b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<minu8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <minu8+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <minu8+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minu8>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @minu8(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ convert_lineno();
int /*<<< orphan*/ store(int);
int /*<<< orphan*/ store_lineno(int /*<<< orphan*/);
void copy_lineno(void) {
  store(0x1Eu);
  store_lineno(convert_lineno());
}


x86 assembly (clang, -O0):
<copy_lineno>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
call   1030 <store@plt>
mov    $0x0,%al
call   1040 <convert_lineno@plt>
mov    %eax,%edi
call   1050 <store_lineno@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_lineno>:
push   %rax
mov    $0x1e,%edi
call   1030 <store@plt>
xor    %eax,%eax
call   1040 <convert_lineno@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <store_lineno@plt>

LLVM IR (-O0):
define void @copy_lineno() {
%1 = call i32 @store(i32 30)
%2 = call i32 (...) @convert_lineno()
%3 = call i32 @store_lineno(i32 %2)
ret void
}

LLVM IR (-O2):
define void @copy_lineno() {
%1 = tail call i32 @store(i32 30)
%2 = tail call i32 (...) @convert_lineno()
%3 = tail call i32 @store_lineno(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
void swap(unsigned char left[], unsigned char right[]) {
  unsigned char x[4];
  memcpy(x, right, 4);
  memcpy(right, left, 4);
  memcpy(left, x, 4);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xc(%rsp),%r15
mov    %r15,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [4 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 4)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @memcpy(i8* %9, i8* %10, i32 4)
%12 = load i8*, i8** %3
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 4)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %1, i32 4)
%6 = call i32 @memcpy(i8* %1, i8* %0, i32 4)
%7 = call i32 @memcpy(i8* %0, i8* %4, i32 4)
ret void
}
char uart_getchar() {
  while ((*((volatile int *)(((0x10000000 + 0xA100000) + 0x0000) + 0x14)) &
          0x1) != 0x1)
    ;
  return *(volatile int *)(((0x10000000 + 0xA100000) + 0x0000) + 0x00);
}


x86 assembly (clang, -O0):
<uart_getchar>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <uart_getchar+0x9>
mov    $0x1a100014,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x1,%eax
je     1121 <uart_getchar+0x21>
jmp    1109 <uart_getchar+0x9>
mov    $0x1a100000,%eax
mov    (%rax),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getchar>:
testl  $0x1,0x1a100014
je     1100 <uart_getchar>
mov    0x1a100000,%eax
ret

LLVM IR (-O0):
define signext i8 @uart_getchar() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 437256212 to i32*)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 437256192 to i32*)
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @uart_getchar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 437256212 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 437256192 to i32*)
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int set_nonblockfd(int fd) {
  int ret;
  ret = fcntl(fd, F_GETFL, 0);
  fcntl(fd, F_SETFL, ret | O_NONBLOCK);
  return ret;
}


x86 assembly (clang, -O0):
<set_nonblockfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblockfd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
or     %ebp,%edx
mov    %ebx,%edi
call   1030 <fcntl@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @set_nonblockfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @set_nonblockfd(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret i32 %3
}
void BrzBuiltinVariable_ackdown(struct comp *comp, int port) {}


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

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

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

LLVM IR (-O2):
%struct.comp = type opaque
define void @BrzBuiltinVariable_ackdown(%struct.comp* nocapture %0, i32 %1) {
ret void
}
void busy() {
  int i;
  for (i = 0; i < 1e8; i++)
    ;
}


x86 assembly (clang, -O0):
<busy>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1135 <busy+0x35>
jmp    1127 <busy+0x27>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <busy+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @busy() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to double
%5 = fcmp olt double %4, 1.000000e+08
br i1 %5, label %6, label %10
6: ; preds = %2
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @busy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ICPrintLengthString(char *);
int main(int argc, const char *argv[]) {
  ICPrintLengthString("Hi!");
  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)
lea    0xed3(%rip),%rdi
call   1030 <ICPrintLengthString@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"Hi!\00"
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 @ICPrintLengthString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"Hi!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ICPrintLengthString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int do_cmd(char const *, char const *, char *, int);
int do_simple(const char *cmd, char *buf, int len) {
  return do_cmd(cmd, cmd, buf, len);
}


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

x86 assembly (clang, -O2):
<do_simple>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <do_cmd@plt>

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

LLVM IR (-O2):
define i32 @do_simple(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @do_cmd(i8* %0, i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void UARTRXIntRegister(uint32_t ui32Base, void (*pfnHandler)(void)) {
  uint32_t ui32Int;
  ;
  ui32Int = ((ui32Base == 0x00007200) ? 0x600901 : 0x620903);
  IntRegister(ui32Int, pfnHandler);
  IntEnable(ui32Int);
}


x86 assembly (clang, -O0):
<UARTRXIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x620903,%eax
mov    $0x600901,%ecx
cmp    $0x7200,%edx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x14(%rbp),%edi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRXIntRegister>:
push   %rbx
cmp    $0x7200,%edi
mov    $0x600901,%eax
mov    $0x620903,%ebx
cmove  %eax,%ebx
mov    %ebx,%edi
call   1040 <IntRegister@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @UARTRXIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
%5 = alloca i32
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 29184
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 6293761, i32 6424835
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load void ()*, void ()** %4
%12 = bitcast void ()* %11 to void (...)*
%13 = call i32 @IntRegister(i32 %10, void (...)* %12)
%14 = load i32, i32* %5
%15 = call i32 @IntEnable(i32 %14)
ret void
}

LLVM IR (-O2):
define void @UARTRXIntRegister(i32 %0, void ()* %1) {
%3 = icmp eq i32 %0, 29184
%4 = select i1 %3, i32 6293761, i32 6424835
%5 = bitcast void ()* %1 to void (...)*
%6 = tail call i32 @IntRegister(i32 %4, void (...)* %5)
%7 = tail call i32 @IntEnable(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int stbi_hdr_test_file(int /*<<< orphan*/ *);
extern int stbi_is_hdr_from_file(FILE *f) { return stbi_hdr_test_file(f); }


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

x86 assembly (clang, -O2):
<stbi_is_hdr_from_file>:
jmp    1030 <stbi_hdr_test_file@plt>

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

LLVM IR (-O2):
define i32 @stbi_is_hdr_from_file(i32* %0) {
%2 = tail call i32 @stbi_hdr_test_file(i32* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ server_work();
void server_consume_work_left(void) {
  while (server_work() != 0)
    continue;
}


x86 assembly (clang, -O0):
<server_consume_work_left>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <server_consume_work_left+0x9>
mov    $0x0,%al
call   1030 <server_work@plt>
cmp    $0x0,%rax
je     112f <server_consume_work_left+0x1f>
jmp    1119 <server_consume_work_left+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_consume_work_left>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <server_work@plt>
test   %rax,%rax
jne    1120 <server_consume_work_left+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @server_consume_work_left() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @server_work()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @server_consume_work_left() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @server_work()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hashmap_free_value(void *entry) {
  if (entry) {
    free(entry);
  }
}


x86 assembly (clang, -O0):
<hashmap_free_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <hashmap_free_value+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_free_value>:
test   %rdi,%rdi
je     111a <hashmap_free_value+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @hashmap_free_value(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}