xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void bputs(const char *s) { fputs(s, stdout); }


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

x86 assembly (clang, -O2):
<bputs>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @bputs(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display(int *, int);
int /*<<< orphan*/ merge_sort(int *, int /*<<< orphan*/, int);
int main() {
  int n = 7;
  int a[] = {22, 1, 65, 33, 78, 33, 90};
  display(a, n);
  merge_sort(a, 0, n - 1);
  display(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <display@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <merge_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <display@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1040 <merge_sort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 22, i32 1, i32 65, i32 33, i32 78, i32 33, i32 90]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x i32]
store i32 0, i32* %1
store i32 7, i32* %2
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @display(i32* %5, i32 %6)
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = call i32 @merge_sort(i32* %8, i32 0, i32 %10)
%12 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%13 = load i32, i32* %2
%14 = call i32 @display(i32* %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 22, i32 1, i32 65, i32 33, i32 78, i32 33, i32 90]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @display(i32* %3, i32 7)
%5 = call i32 @merge_sort(i32* %3, i32 0, i32 6)
%6 = call i32 @display(i32* %3, i32 7)
ret i32 0
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local2;
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + 274866410UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      local2 = 0UL;
      while (local2 < 0UL) {
        if (state[0UL] != local2 - local1) {
        }
        local2++;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 454761159UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x30dd5ac,%rax
add    $0x106220ea,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jae    1185 <RandomFunc+0x85>
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1174 <RandomFunc+0x74>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    -0x28(%rbp),%rcx
cmp    %rcx,%rax
je     1163 <RandomFunc+0x63>
jmp    1163 <RandomFunc+0x63>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113e <RandomFunc+0x3e>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    112b <RandomFunc+0x2b>
mov    -0x18(%rbp),%rcx
add    $0x1b1b1ac7,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x2e8b115d,%eax
add    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = add i64 %10, 51238316
%12 = add i64 %11, 274866410
%13 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %12, i64* %13
store i64 0, i64* %7
br label %14
14: ; preds = %32, %2
%15 = load i64, i64* %7
%16 = icmp ult i64 %15, 0
br i1 %16, label %17, label %35
17: ; preds = %14
store i64 0, i64* %6
br label %18
18: ; preds = %29, %17
%19 = load i64, i64* %6
%20 = icmp ult i64 %19, 0
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%23 = load i64, i64* %22
%24 = load i64, i64* %6
%25 = load i64, i64* %7
%26 = sub i64 %24, %25
%27 = icmp ne i64 %23, %26
br i1 %27, label %28, label %29
28: ; preds = %21
br label %29
29: ; preds = %28, %21
%30 = load i64, i64* %6
%31 = add i64 %30, 1
store i64 %31, i64* %6
br label %18
32: ; preds = %18
%33 = load i64, i64* %7
%34 = add i64 %33, 2
store i64 %34, i64* %7
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%37 = load i64, i64* %36
%38 = add i64 %37, 454761159
%39 = load i64*, i64** %4
%40 = getelementptr inbounds i64, i64* %39, i64 0
store i64 %38, i64* %40
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 780865885
store i64 %4, i64* %1
ret void
}
/* Variables and functions */
char *mystrdup(char *);
char *strchr(char *, char);
char *getserv(char *host) {
  char *q, *x = mystrdup(host);
  q = strchr(x, ':');
  if (q)
    *q = 0;
  return x;
}


x86 assembly (clang, -O0):
<getserv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mystrdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <getserv+0x3d>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getserv>:
push   %rbx
call   1040 <mystrdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113e <getserv+0x1e>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @getserv(i8* %0) {
%2 = tail call i8* @mystrdup(i8* %0)
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 58)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* %3
br label %6
6: ; preds = %5, %1
ret i8* %2
}
/* Variables and functions */
int one(char **, int);
int strlen(char *);
int lt100(char **a, int i) { return strlen(a[i / 10 * 10]) + one(a, i % 10); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
imul   $0xa,%ecx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1040 <one@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
movslq %esi,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
cltq
mov    (%rdi,%rax,8),%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <one@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lt100(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 10
%8 = mul nsw i32 %7, 10
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %5, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @strlen(i8* %11)
%13 = load i8**, i8*** %3
%14 = load i32, i32* %4
%15 = srem i32 %14, 10
%16 = call i32 @one(i8** %13, i32 %15)
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @lt100(i8** %0, i32 %1) {
%3 = srem i32 %1, 10
%4 = sub i32 %1, %3
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 @strlen(i8* %7)
%9 = tail call i32 @one(i8** %0, i32 %3)
%10 = add nsw i32 %9, %8
ret i32 %10
}
/* Variables and functions */
float atof(char *);
char *cfg_get_str(char *, char *);
float cfg_get_float(char *sec, char *ent) {
  char *val;
  val = cfg_get_str(sec, ent);
  if (NULL == val)
    return -1;
  return atof(val);
}


x86 assembly (clang, -O0):
<cfg_get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <cfg_get_str@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    115f <cfg_get_float+0x3f>
movss  0xeab(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116d <cfg_get_float+0x4d>
mov    -0x20(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_get_float>:
push   %rax
call   1040 <cfg_get_str@plt>
test   %rax,%rax
je     1134 <cfg_get_float+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atof@plt>
movss  0xec4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cfg_get_float(i8* %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @cfg_get_str(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* null, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store float -1.000000e+00, float* %3
br label %16
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call float @atof(i8* %14)
store float %15, float* %3
br label %16
16: ; preds = %13, %12
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @cfg_get_float(i8* %0, i8* %1) {
%3 = tail call i8* @cfg_get_str(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call float @atof(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi float [ %6, %5 ], [ -1.000000e+00, %2 ]
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ KnuthMorrisPratt(char *, char *, int, int);
int /*<<< orphan*/ gets(char *);
int strlen(char *);
int main(void) {
  char word[20];
  gets(word);
  char pattern[20];
  gets(pattern);
  int n = strlen(word);
  int m = strlen(pattern);
  KnuthMorrisPratt(word, pattern, n, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x48(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%edx
mov    -0x48(%rbp),%ecx
call   1050 <KnuthMorrisPratt@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0x20(%rsp),%r14
mov    %r14,%rdi
call   1040 <gets@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
call   1050 <KnuthMorrisPratt@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = call i32 @gets(i8* %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %4
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
store i32 %13, i32* %5
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @KnuthMorrisPratt(i8* %14, i8* %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 @strlen(i8* %3)
%8 = call i32 @strlen(i8* %5)
%9 = call i32 @KnuthMorrisPratt(i8* %3, i8* %5, i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintCollisionInfoHeader() {
  printf("Unshareable;Shareable;Shared;SharedZeroPages;stack;stack "
         "rw;heap;heap rw;anonymous;anon rw;named;named rw;Sharing "
         "Op;SharingOpZeroPages;stack;stack rw;heap;heap rw;anonymous;anon "
         "rw;named;named rw;;;;shared count;named shared count;");
}


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

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

LLVM IR (-O0):
@.str = [233 x i8] c"Unshareable;Shareable;Shared;SharedZeroPages;stack;stack rw;heap;heap rw;anonymous;anon rw;named;named rw;Sharing Op;SharingOpZeroPages;stack;stack rw;heap;heap rw;anonymous;anon rw;named;named rw;;;;shared count;named shared count;\00"
define void @PrintCollisionInfoHeader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [233 x i8] c"Unshareable;Shareable;Shared;SharedZeroPages;stack;stack rw;heap;heap rw;anonymous;anon rw;named;named rw;Sharing Op;SharingOpZeroPages;stack;stack rw;heap;heap rw;anonymous;anon rw;named;named rw;;;;shared count;named shared count;\00"
define void @PrintCollisionInfoHeader() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo_1_2_1_2_1_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_1_1_2_1() {
ret void
}
int __attribute__((no)) inflate_fixed(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @inflate_fixed() {
ret i32 0
}
void gtk_file_selection_get_select_multiple() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_selection_get_select_multiple() {
ret void
}
void doubler(int *x) {
  int value = *x;
  value = 2 * value;
  *x = value;
}


x86 assembly (clang, -O0):
<doubler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubler>:
shll   (%rdi)
ret

LLVM IR (-O0):
define void @doubler(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 2, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32*, i32** %2
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @doubler(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ eMalloc(size_t);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
extern char *eStrndup(const char *str, size_t len) {
  char *result = (char *)eMalloc((size_t)(len + 1) * sizeof(char));
  memset(result, 0, len + 1);
  strncpy(result, str, len);
  return result;
}


x86 assembly (clang, -O0):
<eStrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1050 <eMalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eStrndup>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%r12
mov    %r12,%rdi
call   1050 <eMalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @eStrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = mul i64 %7, 1
%9 = call i64 @eMalloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = call i32 @memset(i8* %11, i32 0, i64 %13)
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = call i32 @strncpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @eStrndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @eMalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memset(i8* %5, i32 0, i64 %3)
%7 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ binary_operator_help();
int /*<<< orphan*/ nullary_operator_help();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unary_operator_help();
void help(void) {
  printf("\n");
  nullary_operator_help();
  printf("\n");
  binary_operator_help();
  printf("\n");
  unary_operator_help();
  printf("\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <nullary_operator_help@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <binary_operator_help@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <unary_operator_help@plt>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1060 <nullary_operator_help@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1030 <binary_operator_help@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1050 <unary_operator_help@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @nullary_operator_help()
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @binary_operator_help()
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @unary_operator_help()
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @help() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (...) @nullary_operator_help()
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (...) @binary_operator_help()
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (...) @unary_operator_help()
%7 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
void color_pair_on(int color_pair) { attron(COLOR_PAIR(color_pair)); }


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

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

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

LLVM IR (-O2):
define void @color_pair_on(i32 %0) {
%2 = tail call i32 @COLOR_PAIR(i32 %0)
%3 = tail call i32 @attron(i32 %2)
ret void
}
/* Variables and functions */
int rp_hex_nibble(char const);
int remote_decode_nibble(const char *in, unsigned int *nibble) {
  int nib;
  if ((nib = rp_hex_nibble(*in)) >= 0) {
    *nibble = nib;
    return (!0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<remote_decode_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <rp_hex_nibble@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jl     114d <remote_decode_nibble+0x3d>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1154 <remote_decode_nibble+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_decode_nibble>:
push   %rbx
mov    %rsi,%rbx
movsbl (%rdi),%edi
call   1030 <rp_hex_nibble@plt>
test   %eax,%eax
js     1129 <remote_decode_nibble+0x19>
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @remote_decode_nibble(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = tail call i32 @rp_hex_nibble(i8 signext %3)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 %4, i32* %1
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %8
}
int main() {
  char a = 1;
  char b = 2;
  a = b + a;
  a *= 2;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movb   $0x2,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
store i8 2, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = add nsw i32 %5, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = mul nsw i32 %11, 2
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 6
}
int pick_lowest(float a, float b, float c) {
  if (a < c)
    return a < b ? -1 : 0;
  return c < b ? +1 : 0;
}


x86 assembly (clang, -O0):
<pick_lowest>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1145 <pick_lowest+0x45>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <pick_lowest+0x5f>
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
xor    %eax,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick_lowest>:
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
xor    %eax,%eax
ucomiss %xmm2,%xmm1
seta   %al
ucomiss %xmm0,%xmm2
cmova  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pick_lowest(float %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %7
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load float, float* %5
%13 = load float, float* %6
%14 = fcmp olt float %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 -1, i32 0
store i32 %16, i32* %4
br label %23
17: ; preds = %3
%18 = load float, float* %7
%19 = load float, float* %6
%20 = fcmp olt float %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
store i32 %22, i32* %4
br label %23
23: ; preds = %17, %11
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @pick_lowest(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %2
%5 = fcmp olt float %0, %1
%6 = sext i1 %5 to i32
%7 = fcmp olt float %2, %1
%8 = zext i1 %7 to i32
%9 = select i1 %4, i32 %6, i32 %8
ret i32 %9
}
unsigned int isBitISet(unsigned int ch, int i) {
  unsigned int mask = 1U << i;
  return mask & ch;
}


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

x86 assembly (clang, -O2):
<isBitISet>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @isBitISet(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 = shl i32 1, %6
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = and i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @isBitISet(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
unsigned long dl_PowOf(unsigned long dim) {
  unsigned long num = 1;
  unsigned long i = 0;
  while (num < dim) {
    num <<= 1;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<dl_PowOf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1143 <dl_PowOf+0x43>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <dl_PowOf+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_PowOf>:
cmp    $0x2,%rdi
jb     111d <dl_PowOf+0x1d>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   (%rax)
add    %rcx,%rcx
add    $0x1,%rax
cmp    %rdi,%rcx
jb     1110 <dl_PowOf+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @dl_PowOf(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
store i64 0, i64* %4
br label %5
5: ; preds = %9, %1
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = icmp ult i64 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i64, i64* %3
%11 = shl i64 %10, 1
store i64 %11, i64* %3
%12 = load i64, i64* %4
%13 = add i64 %12, 1
store i64 %13, i64* %4
br label %5
14: ; preds = %5
%15 = load i64, i64* %4
ret i64 %15
}

LLVM IR (-O2):
define i64 @dl_PowOf(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ 1, %1 ]
%6 = shl i64 %5, 1
%7 = add i64 %4, 1
%8 = icmp ult i64 %6, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
#define SEEK_CUR 130
#define SEEK_END 129
#define SEEK_SET 128
short fuserl_l_whence_canonicalize(short l_whence) {
  switch (l_whence) {
  case SEEK_SET:
    return 0;
  case SEEK_CUR:
    return 1;
  case SEEK_END:
    return 2;
  default:
    return 3;
  }
}


x86 assembly (clang, -O0):
<fuserl_l_whence_canonicalize>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1148 <fuserl_l_whence_canonicalize+0x48>
jmp    1122 <fuserl_l_whence_canonicalize+0x22>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
je     115e <fuserl_l_whence_canonicalize+0x5e>
jmp    1135 <fuserl_l_whence_canonicalize+0x35>
mov    -0x8(%rbp),%eax
sub    $0x82,%eax
je     1153 <fuserl_l_whence_canonicalize+0x53>
jmp    1169 <fuserl_l_whence_canonicalize+0x69>
movw   $0x0,-0x2(%rbp)
jmp    116f <fuserl_l_whence_canonicalize+0x6f>
movw   $0x1,-0x2(%rbp)
jmp    116f <fuserl_l_whence_canonicalize+0x6f>
movw   $0x2,-0x2(%rbp)
jmp    116f <fuserl_l_whence_canonicalize+0x6f>
movw   $0x3,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuserl_l_whence_canonicalize>:
add    $0xffffff80,%edi
mov    %edi,%ecx
shl    $0x4,%ecx
movabs $0x100020000,%rdx
shr    %cl,%rdx
cmp    $0x3,%edi
mov    $0x3,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i16 @fuserl_l_whence_canonicalize(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
switch i32 %5, label %9 [
i32 128, label %6
i32 130, label %7
i32 129, label %8
]
6: ; preds = %1
store i16 0, i16* %2
br label %10
7: ; preds = %1
store i16 1, i16* %2
br label %10
8: ; preds = %1
store i16 2, i16* %2
br label %10
9: ; preds = %1
store i16 3, i16* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i16, i16* %2
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @fuserl_l_whence_canonicalize(i16 signext %0) {
%2 = sext i16 %0 to i32
%3 = add nsw i32 %2, -128
%4 = icmp ult i32 %3, 3
%5 = zext i32 %3 to i48
%6 = shl nuw nsw i48 %5, 4
%7 = lshr i48 4295098368, %6
%8 = trunc i48 %7 to i16
%9 = select i1 %4, i16 %8, i16 3
ret i16 %9
}
int sync_test_and_change_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  __asm__ __volatile__("lock; btcl %2,%1\n\tsbbl %0,%0"
                       : "=r"(oldbit), "+m"((*(volatile long *)addr))
                       : "Ir"(nr)
                       : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<sync_test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock btc %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_test_and_change_bit>:
lock btc %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sync_test_and_change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "lock; btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_test_and_change_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "lock; btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret i32 %3
}
void tgt_mod_exit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @tgt_mod_exit() {
ret void
}
/* Type definitions */
struct srcu_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __srcu_read_unlock(struct srcu_struct *, int);
__attribute__((always_)) void srcu_read_unlock(struct srcu_struct *sp,
                                               int idx) {
  do {
  } while (0);
  __srcu_read_unlock(sp, idx);
}


x86 assembly (clang, -O0):
<srcu_read_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
jmp    1124 <srcu_read_unlock+0x14>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <__srcu_read_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srcu_read_unlock>:
jmp    1030 <__srcu_read_unlock@plt>

LLVM IR (-O0):
%struct.srcu_struct = type { i32 }
define void @srcu_read_unlock(%struct.srcu_struct* %0, i32 %1) {
%3 = alloca %struct.srcu_struct*
%4 = alloca i32
store %struct.srcu_struct* %0, %struct.srcu_struct** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load %struct.srcu_struct*, %struct.srcu_struct** %3
%8 = load i32, i32* %4
%9 = call i32 @__srcu_read_unlock(%struct.srcu_struct* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.srcu_struct = type { i32 }
define void @srcu_read_unlock(%struct.srcu_struct* %0, i32 %1) {
%3 = tail call i32 @__srcu_read_unlock(%struct.srcu_struct* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DESDataWrite(uint32_t ui32Base, uint32_t *pui32Src) {
  ;
  while ((((*((volatile uint32_t *)(ui32Base + 0x00000020))) & 0x00000002)) ==
         0) {
  }
  (*((volatile uint32_t *)(0x44038000 + 0x00000028))) = pui32Src[0];
  (*((volatile uint32_t *)(0x44038000 + 0x0000002C))) = pui32Src[1];
}


x86 assembly (clang, -O0):
<DESDataWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1126 <DESDataWrite+0x26>
jmp    110b <DESDataWrite+0xb>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    $0x44038028,%eax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    $0x4403802c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESDataWrite>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x2,0x20(%rax)
je     1110 <DESDataWrite+0x10>
mov    (%rsi),%eax
mov    %eax,0x44038028
mov    0x4(%rsi),%eax
mov    %eax,0x4403802c
ret

LLVM IR (-O0):
define void @DESDataWrite(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
br label %5
5: ; preds = %13, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 32
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
store volatile i32 %17, i32* inttoptr (i64 1141080104 to i32*)
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
store volatile i32 %20, i32* inttoptr (i64 1141080108 to i32*)
ret void
}

LLVM IR (-O2):
define void @DESDataWrite(i32 %0, i32* nocapture %1) {
%3 = add nsw i32 %0, 32
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
br label %6
6: ; preds = %6, %2
%7 = load volatile i32, i32* %5
%8 = and i32 %7, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6
%11 = load i32, i32* %1
store volatile i32 %11, i32* inttoptr (i64 1141080104 to i32*)
%12 = getelementptr inbounds i32, i32* %1, i64 1
%13 = load i32, i32* %12
store volatile i32 %13, i32* inttoptr (i64 1141080108 to i32*)
ret void
}
int test_imm_F6uint16_mem(unsigned short *val) {
  return ((*val) & (0xF6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F6uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xf6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F6uint16_mem>:
testb  $0xf6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F6uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 246
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _sysapi_ifflags(char *, int);
int sysapi_is_dev_lo(char *ifname) { return _sysapi_ifflags(ifname, 1); }


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

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

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

LLVM IR (-O2):
define i32 @sysapi_is_dev_lo(i8* %0) {
%2 = tail call i32 @_sysapi_ifflags(i8* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lcd_write(int /*<<< orphan*/);
void lcd_puts(const char *s) {
  while (*s)
    lcd_write(*s++);
}


x86 assembly (clang, -O0):
<lcd_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <lcd_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <lcd_write@plt>
jmp    111c <lcd_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <lcd_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <lcd_write@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lcd_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lcd_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @lcd_write(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t llistxattr(const char *path, char *list, size_t size) {
  return (errno = ENOSYS, -1);
}


x86 assembly (clang, -O0):
<llistxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @llistxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
void set_eflags(unsigned long eflags) {
  asm volatile("pushq %0\n\tpopfq" : : "rm"(eflags) : "flags");
}


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

x86 assembly (clang, -O2):
<set_eflags>:
mov    %rdi,-0x8(%rsp)
push   -0x8(%rsp)
popf
ret

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

LLVM IR (-O2):
define void @set_eflags(i64 %0) {
tail call void asm sideeffect "pushq $0\0A\09popfq", "rm,~{flags},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ event_mask;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
long get_XSetWindowAttributes_event_mask(void *_p) {
  return (long)((XSetWindowAttributes *)_p)->event_mask;
}


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

x86 assembly (clang, -O2):
<get_XSetWindowAttributes_event_mask>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XSetWindowAttributes_event_mask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XSetWindowAttributes_event_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int fun_stub_base_0_stub();
int /*<<< orphan*/ printf(char *, ...);
int fun_stub_base_0_call() {
  printf("fun_stub_base_0_call: \n");
  int x = fun_stub_base_0_stub();
  printf("fun_stub_base_0_stub return %d\n", x);
  return x;
}


x86 assembly (clang, -O0):
<fun_stub_base_0_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fun_stub_base_0_stub@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_0_call>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <fun_stub_base_0_stub@plt>
mov    %eax,%ebx
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [32 x i8] c"fun_stub_base_0_stub return %d\0A\00"
@str = [23 x i8] c"fun_stub_base_0_call: \00"
define i32 @fun_stub_base_0_call() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fun_stub_base_0_stub()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 %2
}
/* Type definitions */
struct bio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bio *);
void submit_bio(int x, struct bio *y) {
  free(y);
  return;
}


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

x86 assembly (clang, -O2):
<submit_bio>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.bio = type { i32 }
define void @submit_bio(i32 %0, %struct.bio* %1) {
%3 = alloca i32
%4 = alloca %struct.bio*
store i32 %0, i32* %3
store %struct.bio* %1, %struct.bio** %4
%5 = load %struct.bio*, %struct.bio** %4
%6 = call i32 @free(%struct.bio* %5)
ret void
}

LLVM IR (-O2):
%struct.bio = type { i32 }
define void @submit_bio(i32 %0, %struct.bio* nocapture %1) {
%3 = tail call i32 @free(%struct.bio* %1)
ret void
}