xunge/DecIR huggingface dataset:
void __outlc_p(unsigned int value, unsigned short port) {
  __asm__ __volatile__("out"
                       "l"
                       " %"
                       "0,%"
                       ""
                       "1"
                       :
                       : "a"(value), "id"(port));
  __asm__ __volatile__("outb %al,$0x80");
}


x86 assembly (clang, -O0):
<__outlc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outlc_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @__outlc_p(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,$1", "{ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *new;
  if ((s == NULL) || ((new = malloc(strlen(s) + 1)) == NULL)) {
    return NULL;
  }
  strcpy(new, s);
  return new;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116a <strdup+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1177 <strdup+0x47>
movq   $0x0,-0x8(%rbp)
jmp    118c <strdup+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <strdup+0x2f>
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115f <strdup+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1161 <strdup+0x31>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %10
10: ; preds = %1, %3, %8
%11 = phi i8* [ %6, %8 ], [ null, %3 ], [ null, %1 ]
ret i8* %11
}
unsigned xrop3_53_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_53_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_53_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xffffff00,%edx
or     %ecx,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_53_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -256
%8 = or i32 %6, %7
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ mtx_to_driver();
int /*<<< orphan*/ uvz_to_driver();
int main3(void) {
  uvz_to_driver();
  mtx_to_driver();
}


x86 assembly (clang, -O0):
<main3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <uvz_to_driver@plt>
mov    $0x0,%al
call   1030 <mtx_to_driver@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main3() {
%1 = alloca i32
%2 = call i32 (...) @uvz_to_driver()
%3 = call i32 (...) @mtx_to_driver()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @main3() {
%1 = tail call i32 (...) @uvz_to_driver()
%2 = tail call i32 (...) @mtx_to_driver()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *mid(char *target, char *source, int pos) {
  if (target == NULL)
    return NULL;
  if (source == NULL)
    target[0] = '\0';
  else
    strcpy(target, &source[pos]);
  return target;
}


x86 assembly (clang, -O0):
<mid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113b <mid+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    116e <mid+0x5e>
cmpq   $0x0,-0x18(%rbp)
jne    1152 <mid+0x42>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1166 <mid+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mid>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1131 <mid+0x21>
test   %rsi,%rsi
je     112e <mid+0x1e>
movslq %edx,%rax
add    %rax,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
jmp    1131 <mid+0x21>
movb   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @mid(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp eq i8* %1, null
br i1 %6, label %7, label %8
7: ; preds = %5
store i8 0, i8* %0
br label %12
8: ; preds = %5
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = tail call i32 @strcpy(i8* %0, i8* %10)
br label %12
12: ; preds = %7, %8, %3
ret i8* %0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
__attribute__((warn_unused_result)) uint16_t modbusBitsToBytes(uint16_t n) {
  return (n + 7) >> 3;
}


x86 assembly (clang, -O0):
<modbusBitsToBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbusBitsToBytes>:
lea    0x7(%rdi),%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @modbusBitsToBytes(i32 %0) {
%2 = add nsw i32 %0, 7
%3 = ashr i32 %2, 3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ r();
void good_paired3(void) {
  a();
  a();
  r();
  r();
}


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

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

LLVM IR (-O0):
define void @good_paired3() {
%1 = call i32 (...) @a()
%2 = call i32 (...) @a()
%3 = call i32 (...) @r()
%4 = call i32 (...) @r()
ret void
}

LLVM IR (-O2):
define void @good_paired3() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @a()
%3 = tail call i32 (...) @r()
%4 = tail call i32 (...) @r()
ret void
}
void l4sccp_link_status_change(struct link *link, int up) {}


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

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

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

LLVM IR (-O2):
%struct.link = type opaque
define void @l4sccp_link_status_change(%struct.link* nocapture %0, i32 %1) {
ret void
}
int base10_len(int n) {
  int len = 0;
  while (n) {
    n /= 10;
    ++len;
  }
  return len;
}


x86 assembly (clang, -O0):
<base10_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <base10_len+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <base10_len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base10_len>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <base10_len+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <base10_len+0x10>
ret

LLVM IR (-O0):
define i32 @base10_len(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 ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
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 @base10_len(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ avg_420_downsample_ag_rb_vectors_sse2(int /*<<< orphan*/ *,
                                                         int /*<<< orphan*/ *,
                                                         int /*<<< orphan*/ *);
extern void avg_420_downsample_ag_rb_vectors_sse2_ssse3(
    __m128i *in_4_v16i_current_ag_rb_vectors_1,
    __m128i *in_4_v16i_current_ag_rb_vectors_2,
    __m128i *out_2_v16i_avg_420_ag_rb_vectors) {
  avg_420_downsample_ag_rb_vectors_sse2(in_4_v16i_current_ag_rb_vectors_1,
                                        in_4_v16i_current_ag_rb_vectors_2,
                                        out_2_v16i_avg_420_ag_rb_vectors);
}


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

x86 assembly (clang, -O2):
<avg_420_downsample_ag_rb_vectors_sse2_ssse3>:
jmp    1030 <avg_420_downsample_ag_rb_vectors_sse2@plt>

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

LLVM IR (-O2):
define void @avg_420_downsample_ag_rb_vectors_sse2_ssse3(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @avg_420_downsample_ag_rb_vectors_sse2(i32* %0, i32* %1, i32* %2)
ret void
}
int AAS_RT_GetReachabilityIndex(int areanum, int reachIndex) {
  return reachIndex;
}


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

x86 assembly (clang, -O2):
<AAS_RT_GetReachabilityIndex>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @AAS_RT_GetReachabilityIndex(i32 %0, i32 returned %1) {
ret i32 %1
}
int Queue(int t1) {
  if (t1 == 0 || t1 == 1 || t1 == 2 || t1 == 3) {
    return 1;
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<Queue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <Queue+0x2f>
cmpl   $0x1,-0x8(%rbp)
je     112f <Queue+0x2f>
cmpl   $0x2,-0x8(%rbp)
je     112f <Queue+0x2f>
cmpl   $0x3,-0x8(%rbp)
jne    113b <Queue+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <Queue+0x42>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Queue>:
cmp    $0x4,%edi
mov    $0x2,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @Queue(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = select i1 %2, i32 1, i32 2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int dopr(char *, size_t, char const *, int /*<<< orphan*/);
int vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
  if (str != 0)
    str[0] = 0;
  return dopr(str, count, fmt, args);
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <vsnprintf+0x29>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <dopr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
test   %rdi,%rdi
je     1118 <vsnprintf+0x8>
movb   $0x0,(%rdi)
jmp    1030 <dopr@plt>

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

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i8 0, i8* %0
br label %7
7: ; preds = %6, %4
%8 = tail call i32 @dopr(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %8
}
/* Variables and functions */
int status_print(int /*<<< orphan*/);
int status_cmd(void) { return status_print(0); }


x86 assembly (clang, -O0):
<status_cmd>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <status_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_cmd>:
xor    %edi,%edi
jmp    1030 <status_print@plt>

LLVM IR (-O0):
define i32 @status_cmd() {
%1 = call i32 @status_print(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @status_cmd() {
%1 = tail call i32 @status_print(i32 0)
ret i32 %1
}
/* Variables and functions */
int S3C2410_GPF(int);
int brcm_gpio_host_wake(void) { return S3C2410_GPF(6); }


x86 assembly (clang, -O0):
<brcm_gpio_host_wake>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <S3C2410_GPF@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<brcm_gpio_host_wake>:
mov    $0x6,%edi
jmp    1030 <S3C2410_GPF@plt>

LLVM IR (-O0):
define i32 @brcm_gpio_host_wake() {
%1 = call i32 @S3C2410_GPF(i32 6)
ret i32 %1
}

LLVM IR (-O2):
define i32 @brcm_gpio_host_wake() {
%1 = tail call i32 @S3C2410_GPF(i32 6)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char *message) {
  fprintf(stderr, "ERROR: %s\n", message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ver_up_draw_ver_1_2_22();
void ver_up_game_data_cnf_1_2_22(void) { ver_up_draw_ver_1_2_22(); }


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

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

LLVM IR (-O0):
define void @ver_up_game_data_cnf_1_2_22() {
%1 = call i32 (...) @ver_up_draw_ver_1_2_22()
ret void
}

LLVM IR (-O2):
define void @ver_up_game_data_cnf_1_2_22() {
%1 = tail call i32 (...) @ver_up_draw_ver_1_2_22()
ret void
}
/* Type definitions */
struct can_filter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CAN_RAW_FILTER;
int /*<<< orphan*/ SOL_CAN_RAW;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, struct can_filter *,
               int);
int socketcan_apply_filters(int fd, struct can_filter *filters, int n) {
  return setsockopt(fd, SOL_CAN_RAW, CAN_RAW_FILTER, filters,
                    n * sizeof(struct can_filter));
}


x86 assembly (clang, -O0):
<socketcan_apply_filters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%r8d
call   1030 <setsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketcan_apply_filters>:
mov    %rsi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
lea    0x0(,%rdx,4),%r8d
mov    %eax,%edx
jmp    1030 <setsockopt@plt>

LLVM IR (-O0):
%struct.can_filter = type { i32 }
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
define i32 @socketcan_apply_filters(i32 %0, %struct.can_filter* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.can_filter*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.can_filter* %1, %struct.can_filter** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* @SOL_CAN_RAW
%9 = load i32, i32* @CAN_RAW_FILTER
%10 = load %struct.can_filter*, %struct.can_filter** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i32 @setsockopt(i32 %7, i32 %8, i32 %9, %struct.can_filter* %10, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.can_filter = type { i32 }
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
define i32 @socketcan_apply_filters(i32 %0, %struct.can_filter* %1, i32 %2) {
%4 = load i32, i32* @SOL_CAN_RAW
%5 = load i32, i32* @CAN_RAW_FILTER
%6 = shl i32 %2, 2
%7 = tail call i32 @setsockopt(i32 %0, i32 %4, i32 %5, %struct.can_filter* %1, i32 %6)
ret i32 %7
}
void INT_Excep_ETHER_EINT(void) {}


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

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

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

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

/* Variables and functions */
int get_total_energy_consumed(int /*<<< orphan*/, int, double *);
int /*<<< orphan*/ pkg_node_to_cpu(int /*<<< orphan*/);
int get_pkg_total_energy_consumed(uint64_t node,
                                  double *total_energy_consumed_joules) {
  uint64_t cpu = pkg_node_to_cpu(node);
  return get_total_energy_consumed(cpu, 0x611, total_energy_consumed_joules);
}


x86 assembly (clang, -O0):
<get_pkg_total_energy_consumed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pkg_node_to_cpu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x611,%esi
call   1030 <get_total_energy_consumed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pkg_total_energy_consumed>:
push   %rbx
mov    %rsi,%rbx
call   1040 <pkg_node_to_cpu@plt>
mov    %eax,%edi
mov    $0x611,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <get_total_energy_consumed@plt>

LLVM IR (-O0):
define i32 @get_pkg_total_energy_consumed(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%6 = load i32, i32* %3
%7 = call i32 @pkg_node_to_cpu(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load double*, double** %4
%10 = call i32 @get_total_energy_consumed(i32 %8, i32 1553, double* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_pkg_total_energy_consumed(i32 %0, double* %1) {
%3 = tail call i32 @pkg_node_to_cpu(i32 %0)
%4 = tail call i32 @get_total_energy_consumed(i32 %3, i32 1553, double* %1)
ret i32 %4
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *STRCPY(char *_Dest, const char *_Source) {
  return strcpy(_Dest, _Source);
}


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

x86 assembly (clang, -O2):
<STRCPY>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @STRCPY(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
unsigned long master_valueRangeTest(unsigned char typeValue, void *value) {
  switch (typeValue) {
  case 0x9F:
    if (*(unsigned char *)value != (unsigned char)0)
      return 0x06090030;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<master_valueRangeTest>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x9(%rbp),%al
sub    $0x9f,%al
jne    1140 <master_valueRangeTest+0x40>
jmp    111e <master_valueRangeTest+0x1e>
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     113b <master_valueRangeTest+0x3b>
movq   $0x6090030,-0x8(%rbp)
06
jmp    1148 <master_valueRangeTest+0x48>
jmp    1140 <master_valueRangeTest+0x40>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<master_valueRangeTest>:
cmp    $0x9f,%dil
jne    1111 <master_valueRangeTest+0x11>
mov    $0x6090030,%eax
cmpb   $0x0,(%rsi)
je     1111 <master_valueRangeTest+0x11>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @master_valueRangeTest(i8 zeroext %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
switch i32 %7, label %15 [
i32 159, label %8
]
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i64 101253168, i64* %3
br label %16
14: ; preds = %8
br label %15
15: ; preds = %2, %14
store i64 0, i64* %3
br label %16
16: ; preds = %15, %13
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @master_valueRangeTest(i8 zeroext %0, i8* nocapture %1) {
%3 = icmp eq i8 %0, -97
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %2
br label %8
8: ; preds = %4, %7
%9 = phi i64 [ 0, %7 ], [ 101253168, %4 ]
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ reb_murmur3_32(char const *, int /*<<< orphan*/, int const);
scalar_t__ strlen(char const *);
uint32_t reb_hash(const char *str) {
  const int reb_seed = 1983;
  return reb_murmur3_32(str, (uint32_t)strlen(str), reb_seed);
}


x86 assembly (clang, -O0):
<reb_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x7bf,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    $0x7bf,%edx
call   1040 <reb_murmur3_32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reb_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x7bf,%edx
pop    %rbx
jmp    1040 <reb_murmur3_32@plt>

LLVM IR (-O0):
define i32 @reb_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1983, i32* %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = call i32 @reb_murmur3_32(i8* %4, i32 %7, i32 1983)
ret i32 %8
}

LLVM IR (-O2):
define i32 @reb_hash(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @reb_murmur3_32(i8* %0, i32 %3, i32 1983)
ret i32 %4
}
int audio_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @audio_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ register_write(int, int);
void register_write_igp(unsigned int key, unsigned int val) {
  register_write(0x168, (key & 0x7f) | (1 << 8));
  register_write(0x16c, val);
  register_write(0x168, 0x7f);
}


x86 assembly (clang, -O0):
<register_write_igp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
and    $0x7f,%esi
or     $0x100,%esi
mov    $0x168,%edi
call   1030 <register_write@plt>
mov    -0x8(%rbp),%esi
mov    $0x16c,%edi
call   1030 <register_write@plt>
mov    $0x168,%edi
mov    $0x7f,%esi
call   1030 <register_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_write_igp>:
push   %rbx
mov    %esi,%ebx
and    $0x7f,%edi
lea    0x100(%rdi),%esi
mov    $0x168,%edi
call   1030 <register_write@plt>
mov    $0x16c,%edi
mov    %ebx,%esi
call   1030 <register_write@plt>
mov    $0x168,%edi
mov    $0x7f,%esi
pop    %rbx
jmp    1030 <register_write@plt>

LLVM IR (-O0):
define void @register_write_igp(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 = and i32 %5, 127
%7 = or i32 %6, 256
%8 = call i32 @register_write(i32 360, i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @register_write(i32 364, i32 %9)
%11 = call i32 @register_write(i32 360, i32 127)
ret void
}

LLVM IR (-O2):
define void @register_write_igp(i32 %0, i32 %1) {
%3 = and i32 %0, 127
%4 = or i32 %3, 256
%5 = tail call i32 @register_write(i32 360, i32 %4)
%6 = tail call i32 @register_write(i32 364, i32 %1)
%7 = tail call i32 @register_write(i32 360, i32 127)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
int my_putstr(const char *str) { return (write(1, str, my_strlen(str))); }


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <write@plt>

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

LLVM IR (-O2):
define i32 @my_putstr(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret i32 %3
}
int bar(int y) {
  int z = y + 20;
  return z;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    0x14(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add nsw i32 %0, 20
ret i32 %2
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sonuc = f(3);
  printf("3! = %d\n", sonuc);
  sonuc = f(6);
  printf("6! = %d\n", sonuc);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"3! = %d\0A\00"
@.str.1 = [9 x i8] c"6! = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @f(i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ listClear(struct list *);
int /*<<< orphan*/ wfree(struct list *);
void freeList(struct list *l) {
  listClear(l);
  wfree(l);
}


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

x86 assembly (clang, -O2):
<freeList>:
push   %rbx
mov    %rdi,%rbx
call   1030 <listClear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <wfree@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @freeList(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = call i32 @listClear(%struct.list* %3)
%5 = load %struct.list*, %struct.list** %2
%6 = call i32 @wfree(%struct.list* %5)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @freeList(%struct.list* %0) {
%2 = tail call i32 @listClear(%struct.list* %0)
%3 = tail call i32 @wfree(%struct.list* %0)
ret void
}
int open(char *name, int flags) {}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
struct mas_stack {
  int dummy;
};
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ memset(struct mas_stack *, int /*<<< orphan*/, int);
void stack_init(struct mas_stack *s) { memset(s, 0, sizeof(s)); }


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

x86 assembly (clang, -O2):
<stack_init>:
xor    %esi,%esi
mov    $0x8,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
%struct.mas_stack = type { i32 }
define void @stack_init(%struct.mas_stack* %0) {
%2 = alloca %struct.mas_stack*
store %struct.mas_stack* %0, %struct.mas_stack** %2
%3 = load %struct.mas_stack*, %struct.mas_stack** %2
%4 = call i32 @memset(%struct.mas_stack* %3, i32 0, i32 8)
ret void
}

LLVM IR (-O2):
%struct.mas_stack = type { i32 }
define void @stack_init(%struct.mas_stack* %0) {
%2 = tail call i32 @memset(%struct.mas_stack* %0, i32 0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Flush_Buffer32();
unsigned int Show_Bits(int);
unsigned int Get_Bits32(void) {
  unsigned int l;
  {
    l = Show_Bits(32);
    Flush_Buffer32();
    return (l);
  }
}


x86 assembly (clang, -O0):
<Get_Bits32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1030 <Show_Bits@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Flush_Buffer32@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Bits32>:
push   %rbx
mov    $0x20,%edi
call   1030 <Show_Bits@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <Flush_Buffer32@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Get_Bits32() {
%1 = alloca i32
%2 = call i32 @Show_Bits(i32 32)
store i32 %2, i32* %1
%3 = call i32 (...) @Flush_Buffer32()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @Get_Bits32() {
%1 = tail call i32 @Show_Bits(i32 32)
%2 = tail call i32 (...) @Flush_Buffer32()
ret i32 %1
}
int rect_max_dist() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rect_max_dist() {
ret i32 0
}
double HPAtoMB(double HPA) {
  double MB = HPA;
  return MB;
}


x86 assembly (clang, -O0):
<HPAtoMB>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @HPAtoMB(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_RFM_CTL0_PIN() { clear_io_bit(0x43, 7); }


x86 assembly (clang, -O0):
<TOSH_CLR_RFM_CTL0_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x7,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_RFM_CTL0_PIN>:
mov    $0x43,%edi
mov    $0x7,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_RFM_CTL0_PIN() {
%1 = call i32 @clear_io_bit(i32 67, i32 7)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_RFM_CTL0_PIN() {
%1 = tail call i32 @clear_io_bit(i32 67, i32 7)
ret void
}
void fsl_udc_clk_finalize(struct platform_device *pdev) {}


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define void @fsl_udc_clk_finalize(%struct.platform_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  unsigned long long tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ get_time(struct timespec *);
uint64_t current_time_ns(void) {
  struct timespec ts;
  get_time(&ts);
  return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<current_time_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <get_time@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time_ns>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <get_time@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @current_time_ns() {
%1 = alloca %struct.timespec
%2 = call i32 @get_time(%struct.timespec* %1)
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @current_time_ns() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @get_time(%struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_ctype {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_ctype *_Locale_ctype_create(const char *name,
                                           struct _Locale_name_hint *hint
                                           __attribute__((__unused__)),
                                           int *__err_code) {
  return (struct _Locale_ctype *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_ctype_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_ctype = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_ctype* @_Locale_ctype_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_ctype*
ret %struct._Locale_ctype* %10
}

LLVM IR (-O2):
%struct._Locale_ctype = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_ctype* @_Locale_ctype_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_ctype*
ret %struct._Locale_ctype* %5
}
/* Variables and functions */
char *strrchr(char *, char);
char *WpeStringCutChar(char *s, char c) {
  char *tmp;
  tmp = strrchr(s, c);
  if (tmp != NULL) {
    *tmp = '\0';
  }
  return (s);
}


x86 assembly (clang, -O0):
<WpeStringCutChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <WpeStringCutChar+0x35>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WpeStringCutChar>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strrchr@plt>
test   %rax,%rax
je     1121 <WpeStringCutChar+0x11>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @WpeStringCutChar(i8* returned %0, i8 signext %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ _delay_ms(int);
int /*<<< orphan*/ lcd_set_4bit();
int /*<<< orphan*/ lcd_wr_command(int);
void lcd_init() {
  lcd_set_4bit();
  _delay_ms(1);
  lcd_wr_command(0x28);
  lcd_wr_command(0x01);
  lcd_wr_command(0x06);
  lcd_wr_command(0x0E);
  lcd_wr_command(0x80);
}


x86 assembly (clang, -O0):
<lcd_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lcd_set_4bit@plt>
mov    $0x1,%edi
call   1040 <_delay_ms@plt>
mov    $0x28,%edi
call   1050 <lcd_wr_command@plt>
mov    $0x1,%edi
call   1050 <lcd_wr_command@plt>
mov    $0x6,%edi
call   1050 <lcd_wr_command@plt>
mov    $0xe,%edi
call   1050 <lcd_wr_command@plt>
mov    $0x80,%edi
call   1050 <lcd_wr_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_init>:
push   %rax
xor    %eax,%eax
call   1030 <lcd_set_4bit@plt>
mov    $0x1,%edi
call   1040 <_delay_ms@plt>
mov    $0x28,%edi
call   1050 <lcd_wr_command@plt>
mov    $0x1,%edi
call   1050 <lcd_wr_command@plt>
mov    $0x6,%edi
call   1050 <lcd_wr_command@plt>
mov    $0xe,%edi
call   1050 <lcd_wr_command@plt>
mov    $0x80,%edi
pop    %rax
jmp    1050 <lcd_wr_command@plt>

LLVM IR (-O0):
define void @lcd_init() {
%1 = call i32 (...) @lcd_set_4bit()
%2 = call i32 @_delay_ms(i32 1)
%3 = call i32 @lcd_wr_command(i32 40)
%4 = call i32 @lcd_wr_command(i32 1)
%5 = call i32 @lcd_wr_command(i32 6)
%6 = call i32 @lcd_wr_command(i32 14)
%7 = call i32 @lcd_wr_command(i32 128)
ret void
}

LLVM IR (-O2):
define void @lcd_init() {
%1 = tail call i32 (...) @lcd_set_4bit()
%2 = tail call i32 @_delay_ms(i32 1)
%3 = tail call i32 @lcd_wr_command(i32 40)
%4 = tail call i32 @lcd_wr_command(i32 1)
%5 = tail call i32 @lcd_wr_command(i32 6)
%6 = tail call i32 @lcd_wr_command(i32 14)
%7 = tail call i32 @lcd_wr_command(i32 128)
ret void
}