xunge/DecIR huggingface dataset:
int main() {
  __asm__("mov $42, %rdi\n\t");
  __asm__("mov $60, %rax\n\t");
  __asm__("syscall\n\t");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%rdi
mov    $0x3c,%rax
syscall
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2a,%rdi
mov    $0x3c,%rax
syscall
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "mov $$42, %rdi\0A\09", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "mov $$60, %rax\0A\09", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "syscall\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ system(char *);
int main() {
  chdir("/mnt/user/code/JavascriptTest/bin");
  system("/mnt/user/jvm/java Main");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <chdir@plt>
lea    0xeeb(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"/mnt/user/code/JavascriptTest/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @chdir(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"/mnt/user/code/JavascriptTest/bin\00"
@.str.1 = [24 x i8] c"/mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int rand();
void next_one(unsigned int nr, int *coeff) {
  int i = 0;
  while (i < nr) {
    coeff[i] = rand() % 3;
    i++;
  }
}


x86 assembly (clang, -O0):
<next_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    115a <next_one+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <next_one+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_one>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     115f <next_one+0x4f>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <next_one+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @next_one(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @next_one(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 3
%10 = getelementptr inbounds i32, i32* %1, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void tty_flush(void *ui) {
  FILE *tty = ui;
  fprintf(tty, "flush: \r\n");
}


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

x86 assembly (clang, -O2):
<tty_flush>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"flush: \0D\0A\00"
define void @tty_flush(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"flush: \0D\0A\00"
define void @tty_flush(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 9, i64 1, i32* %2)
ret void
}
int fun1(char *a, char *b) {
  while (*a == *b) {
    a++;
    b++;
  }
  if (*b)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113f <fun1+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <fun1+0xc>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <fun1+0x58>
movl   $0x0,-0x4(%rbp)
jmp    115f <fun1+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
mov    (%rsi),%cl
cmp    %cl,(%rdi)
jne    1120 <fun1+0x20>
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
lea    0x1(%rax),%rdx
cmp    %cl,(%rdi,%rax,1)
mov    %rdx,%rax
je     1110 <fun1+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @fun1(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i8* [ %10, %6 ], [ %1, %2 ]
%8 = phi i8* [ %9, %6 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = load i8, i8* %10
%13 = icmp eq i8 %11, %12
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = phi i8 [ %4, %2 ], [ %12, %6 ]
%16 = icmp eq i8 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
void fig07_12() {
  int y;
  f(&y);
}


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

x86 assembly (clang, -O2):
<fig07_12>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fig07_12() {
%1 = alloca i32
%2 = call i32 @f(i32* %1)
ret void
}

LLVM IR (-O2):
define void @fig07_12() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @f(i32* %1)
ret void
}
void retorna_algo(int size, int *destino) {
  if (size == 1) {
    *destino = 1;
  } else if (size == 3) {
    destino = (int[]){1, 2, 3};
  }
}


x86 assembly (clang, -O0):
<retorna_algo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1124 <retorna_algo+0x24>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1150 <retorna_algo+0x50>
cmpl   $0x3,-0x4(%rbp)
jne    114b <retorna_algo+0x4b>
movl   $0x1,-0x1c(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x3,-0x14(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <retorna_algo+0x50>
pop    %rbp
ret

x86 assembly (clang, -O2):
<retorna_algo>:
cmp    $0x1,%edi
jne    110b <retorna_algo+0xb>
movl   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @retorna_algo(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %5
4: ; preds = %2
store i32 1, i32* %1
br label %5
5: ; preds = %2, %4
ret void
}
int hostprog_lib_ck_dd(void *data, char *dd) {
  (void)data;
  (void)dd;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @hostprog_lib_ck_dd(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
ret i32 0
}

LLVM IR (-O2):
define i32 @hostprog_lib_ck_dd(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
char _is_space(const char s) {
  if ((s == '\t') || (s == ' ')) {
    return ' ';
  }
  return 0;
}


x86 assembly (clang, -O0):
<_is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x9,%eax
je     1124 <_is_space+0x24>
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jne    112d <_is_space+0x2d>
movb   $0x20,-0x1(%rbp)
jmp    1131 <_is_space+0x31>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_space>:
cmp    $0x20,%dil
sete   %cl
cmp    $0x9,%dil
sete   %al
or     %cl,%al
shl    $0x5,%al
ret

LLVM IR (-O0):
define signext i8 @_is_space(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 9
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 32, i8* %2
br label %13
12: ; preds = %7
store i8 0, i8* %2
br label %13
13: ; preds = %12, %11
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @_is_space(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = select i1 %4, i8 32, i8 0
ret i8 %5
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR86_get(void) { return U_WMRCORENONE_get("U_WMR86"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR86\00"
define i32 @U_WMR86_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR86\00"
define i32 @U_WMR86_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int threeSumClosest(int *, int, int);
void threeSumClosestMain(void) {
  int len = 0;
  int array[] = {1, 1, 1, 0};
  { len = sizeof(array) / sizeof(array[0]); };
  printf("%d\n", threeSumClosest(array, len, 100));
}


x86 assembly (clang, -O0):
<threeSumClosestMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x64,%edx
call   1030 <threeSumClosest@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threeSumClosestMain>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x64,%edx
call   1030 <threeSumClosest@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.threeSumClosestMain.array = [4 x i32] [i32 1, i32 1, i32 1, i32 0]
@.str = [4 x i8] c"%d\0A\00"
define void @threeSumClosestMain() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
store i32 4, i32* %1
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %1
%6 = call i32 @threeSumClosest(i32* %4, i32 %5, i32 100)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@__const.threeSumClosestMain.array = [4 x i32] [i32 1, i32 1, i32 1, i32 0]
@.str = [4 x i8] c"%d\0A\00"
define void @threeSumClosestMain() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @threeSumClosest(i32* %3, i32 4, i32 100)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_version(void) {
  printf("Ident2 version %s, maintainer %s\n\n", "1.05-FINAL",
         "mike@bacarella.com");
}


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

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rdi
lea    0xf05(%rip),%rsi
lea    0xf09(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Ident2 version %s, maintainer %s\0A\0A\00"
@.str.1 = [11 x i8] c"1.05-FINAL\00"
@.str.2 = [19 x i8] c"mike@bacarella.com\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Ident2 version %s, maintainer %s\0A\0A\00"
@.str.1 = [11 x i8] c"1.05-FINAL\00"
@.str.2 = [19 x i8] c"mike@bacarella.com\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sla_dvn(double *, double *, double *);
double csla_dvn(double v[3], double uv[3], double *vm) {
  return sla_dvn(v, uv, vm);
}


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

x86 assembly (clang, -O2):
<csla_dvn>:
jmp    1030 <sla_dvn@plt>

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

LLVM IR (-O2):
define double @csla_dvn(double* %0, double* %1, double* %2) {
%4 = tail call double @sla_dvn(double* %0, double* %1, double* %2)
ret double %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XLeaveWindowEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XLeaveWindowEvent_display(void *_p, void *_v) {
  ((XLeaveWindowEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XLeaveWindowEvent_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XLeaveWindowEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XLeaveWindowEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f_long_1(long const);
int /*<<< orphan*/ sink(int /*<<< orphan*/);
void test_long_cst(void) {
  const long min = (-0x7fffffffffffffffL - 1L);
  const long max = 0x7fffffffffffffffL;
  sink(f_long_1(min));
  sink(f_long_1(-1));
  sink(f_long_1(0));
  sink(f_long_1(1));
  sink(f_long_1(max));
}


x86 assembly (clang, -O0):
<test_long_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movabs $0x8000000000000000,%rax
mov    %rax,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x10(%rbp)
movabs $0x8000000000000000,%rdi
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0xffffffffffffffff,%rdi
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0x1,%edi
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
movabs $0x7fffffffffffffff,%rdi
ff ff 7f
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_long_cst>:
push   %rbx
movabs $0x7fffffffffffffff,%rbx
ff ff 7f
lea    0x1(%rbx),%rdi
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0xffffffffffffffff,%rdi
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
xor    %edi,%edi
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0x1,%edi
call   1040 <f_long_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    %rbx,%rdi
call   1040 <f_long_1@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <sink@plt>

LLVM IR (-O0):
define void @test_long_cst() {
%1 = alloca i64
%2 = alloca i64
store i64 -9223372036854775808, i64* %1
store i64 9223372036854775807, i64* %2
%3 = call i32 @f_long_1(i64 -9223372036854775808)
%4 = call i32 @sink(i32 %3)
%5 = call i32 @f_long_1(i64 -1)
%6 = call i32 @sink(i32 %5)
%7 = call i32 @f_long_1(i64 0)
%8 = call i32 @sink(i32 %7)
%9 = call i32 @f_long_1(i64 1)
%10 = call i32 @sink(i32 %9)
%11 = call i32 @f_long_1(i64 9223372036854775807)
%12 = call i32 @sink(i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_long_cst() {
%1 = tail call i32 @f_long_1(i64 -9223372036854775808)
%2 = tail call i32 @sink(i32 %1)
%3 = tail call i32 @f_long_1(i64 -1)
%4 = tail call i32 @sink(i32 %3)
%5 = tail call i32 @f_long_1(i64 0)
%6 = tail call i32 @sink(i32 %5)
%7 = tail call i32 @f_long_1(i64 1)
%8 = tail call i32 @sink(i32 %7)
%9 = tail call i32 @f_long_1(i64 9223372036854775807)
%10 = tail call i32 @sink(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_to_lower_case(char *);
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int close_xml_document_(int fd) {
  char *XML = "</sphinx:document>\n\n";
  int bwrite = 0;
  str_to_lower_case(XML);
  bwrite = write(fd, XML, strlen(XML));
  return 0;
}


x86 assembly (clang, -O0):
<close_xml_document_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <str_to_lower_case@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_xml_document_>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
call   1050 <str_to_lower_case@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"</sphinx:document>\0A\0A\00"
define i32 @close_xml_document_(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @str_to_lower_case(i8* %5)
%7 = load i32, i32* %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
store i32 %11, i32* %4
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"</sphinx:document>\0A\0A\00"
define i32 @close_xml_document_(i32 %0) {
%2 = tail call i32 @str_to_lower_case(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
short get_number(short *board, int x, int y) {
  return *(board + ((y << 2) + x));
}


x86 assembly (clang, -O0):
<get_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x2,%ecx
add    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movswl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number>:
lea    (%rsi,%rdx,4),%eax
cltq
movzwl (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define signext i16 @get_number(i16* %0, i32 %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i32
%6 = alloca i32
store i16* %0, i16** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i16*, i16** %4
%8 = load i32, i32* %6
%9 = shl i32 %8, 2
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i16, i16* %7, i64 %12
%14 = load i16, i16* %13
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @get_number(i16* nocapture %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = add nsw i32 %4, %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i16, i16* %0, i64 %6
%8 = load i16, i16* %7
ret i16 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
int *makelist(int nextquad) {
  int *list = (int *)malloc(sizeof(int) * 15);
  list[0] = nextquad;
  list[1] = 0;
  return list;
}


x86 assembly (clang, -O0):
<makelist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3c,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makelist>:
push   %rbx
mov    %edi,%ebx
mov    $0x3c,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
movl   $0x0,0x4(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @makelist(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 60)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
store i32 0, i32* %10
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
define i32* @makelist(i32 %0) {
%2 = tail call i64 @malloc(i32 60)
%3 = inttoptr i64 %2 to i32*
store i32 %0, i32* %3
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 0, i32* %4
ret i32* %3
}
int test_imm_86int64_midword_reg(long long val) {
  return ((val >> 16) & (0x86 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_86int64_midword_reg(i64 %0) {
%2 = and i64 %0, 8781824
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test_five(int x, int y, int z) {
#pragma omp target teams distribute parallel for simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      for (int i = 0; i < z; i++)
        ;
}


x86 assembly (clang, -O0):
<test_five>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117f <test_five+0x7f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <test_five+0x6c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <test_five+0x59>
jmp    114b <test_five+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <test_five+0x3a>
jmp    115e <test_five+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <test_five+0x27>
jmp    1171 <test_five+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <test_five+0x14>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_five(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %10
10: ; preds = %33, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %36
14: ; preds = %10
store i32 0, i32* %8
br label %15
15: ; preds = %29, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %32
19: ; preds = %15
store i32 0, i32* %9
br label %20
20: ; preds = %25, %19
%21 = load i32, i32* %9
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %20
br label %25
25: ; preds = %24
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %20
28: ; preds = %20
br label %29
29: ; preds = %28
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %15
32: ; preds = %15
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %10
36: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @test_five(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int file_write(int /*<<< orphan*/ *, char const *, int);
int strlen(char const *);
int file_puts(BIO *bp, const char *str) {
  int n, ret;
  n = strlen(str);
  ret = file_write(bp, str, n);
  return (ret);
}


x86 assembly (clang, -O0):
<file_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <file_write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <file_write@plt>

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

LLVM IR (-O2):
define i32 @file_puts(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @file_write(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int lps(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() {
  char seq[] = "zabcz";
  int n = strlen(seq);
  printf("The length of the LPS is %d", lps(seq, 0, n - 1));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeab(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xea5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1050 <lps@plt>
mov    %eax,%esi
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x7a,0xc(%rsp)
movl   $0x6362617a,0x8(%rsp)
63
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <lps@plt>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.seq = [6 x i8] c"zabcz\00"
@.str = [28 x i8] c"The length of the LPS is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @lps(i8* %7, i32 0, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.seq = [6 x i8] c"zabcz\00"
@.str = [28 x i8] c"The length of the LPS is %d\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = call i32 @lps(i8* %2, i32 0, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int ENXIO;
int pm8921_bms_get_percent_charge(void) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_bms_get_percent_charge>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_bms_get_percent_charge>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8921_bms_get_percent_charge() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_bms_get_percent_charge() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "usage: %s [samples]\n\n"
          "  samples  samples to average over (default: %d)\n",
          name, 100);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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
mov    $0x64,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [71 x i8] c"usage: %s [samples]\0A\0A samples samples to average over (default: %d)\0A\00"
define void @usage(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 ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %4, i32 100)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [71 x i8] c"usage: %s [samples]\0A\0A samples samples to average over (default: %d)\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %0, i32 100)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
char *hcharminus(char *x) {
  *x -= 24;
  if (!*x)
    foo(x);
  return x;
}


x86 assembly (clang, -O0):
<hcharminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x18,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113e <hcharminus+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hcharminus>:
push   %rbx
mov    %rdi,%rbx
addb   $0xe8,(%rdi)
jne    1121 <hcharminus+0x11>
mov    %rbx,%rdi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @hcharminus(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 24
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @foo(i8* %12)
br label %14
14: ; preds = %11, %1
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @hcharminus(i8* returned %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -24
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @foo(i8* %0)
br label %7
7: ; preds = %5, %1
ret i8* %0
}
/* Variables and functions */
int PollIn1(int, int);
int pollPipe(int, int);
int _PollIn(int fd, int msec) {
  int nready;
  if (fd < 0)
    return -1;
  nready = pollPipe(fd, msec);
  if (0 <= nready)
    return nready;
  return PollIn1(fd, msec);
}


x86 assembly (clang, -O0):
<_PollIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1144 <_PollIn+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <_PollIn+0x56>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <pollPipe@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%eax
jg     1168 <_PollIn+0x48>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <_PollIn+0x56>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <PollIn1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_PollIn>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1143 <_PollIn+0x23>
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <pollPipe@plt>
test   %eax,%eax
jns    1148 <_PollIn+0x28>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <PollIn1@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_PollIn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %22
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @pollPipe(i32 %11, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp sle i32 0, %14
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = load i32, i32* %6
store i32 %17, i32* %3
br label %22
18: ; preds = %10
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i32 @PollIn1(i32 %19, i32 %20)
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %16, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @_PollIn(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @pollPipe(i32 %0, i32 %1)
%6 = icmp sgt i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @PollIn1(i32 %0, i32 %1)
br label %9
9: ; preds = %4, %2, %7
%10 = phi i32 [ %8, %7 ], [ -1, %2 ], [ %5, %4 ]
ret i32 %10
}
void fancy(int *p) {
  if (p != ((void *)0) && (p[0] == 0 || p[1] == 0)) {
    p[0] = p[1];
  }
}


x86 assembly (clang, -O0):
<fancy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <fancy+0x3b>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     112e <fancy+0x2e>
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jne    113b <fancy+0x3b>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fancy>:
test   %rdi,%rdi
je     1111 <fancy+0x11>
cmpl   $0x0,(%rdi)
mov    0x4(%rdi),%eax
je     1114 <fancy+0x14>
test   %eax,%eax
je     1112 <fancy+0x12>
ret
xor    %eax,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @fancy(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
br i1 %5, label %10, label %8
8: ; preds = %3
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %12
10: ; preds = %3, %8
%11 = phi i32 [ 0, %8 ], [ %7, %3 ]
store i32 %11, i32* %0
br label %12
12: ; preds = %10, %8, %1
ret void
}
/* Type definitions */
struct sched_entity {
  int dummy;
};
struct cfs_rq {
  int dummy;
};

/* Variables and functions */
scalar_t__ unlikely(int);
int /*<<< orphan*/ update_hw(struct cfs_rq *, struct sched_entity *);
void entity_tick_hw(struct cfs_rq *cfs_rq, struct sched_entity *curr) {
  if (unlikely(!curr))
    return;
  update_hw(cfs_rq, curr);
}


x86 assembly (clang, -O0):
<entity_tick_hw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <unlikely@plt>
cmp    $0x0,%rax
je     1153 <entity_tick_hw+0x33>
jmp    1160 <entity_tick_hw+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <update_hw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entity_tick_hw>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %rsi,%rsi
sete   %dil
call   1040 <unlikely@plt>
test   %rax,%rax
je     1145 <entity_tick_hw+0x25>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <update_hw@plt>

LLVM IR (-O0):
%struct.cfs_rq = type { i32 }
%struct.sched_entity = type { i32 }
define void @entity_tick_hw(%struct.cfs_rq* %0, %struct.sched_entity* %1) {
%3 = alloca %struct.cfs_rq*
%4 = alloca %struct.sched_entity*
store %struct.cfs_rq* %0, %struct.cfs_rq** %3
store %struct.sched_entity* %1, %struct.sched_entity** %4
%5 = load %struct.sched_entity*, %struct.sched_entity** %4
%6 = icmp ne %struct.sched_entity* %5, null
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = call i64 @unlikely(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
br label %16
12: ; preds = %2
%13 = load %struct.cfs_rq*, %struct.cfs_rq** %3
%14 = load %struct.sched_entity*, %struct.sched_entity** %4
%15 = call i32 @update_hw(%struct.cfs_rq* %13, %struct.sched_entity* %14)
br label %16
16: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
%struct.cfs_rq = type { i32 }
%struct.sched_entity = type { i32 }
define void @entity_tick_hw(%struct.cfs_rq* %0, %struct.sched_entity* %1) {
%3 = icmp eq %struct.sched_entity* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i64 @unlikely(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @update_hw(%struct.cfs_rq* %0, %struct.sched_entity* %1)
br label %9
9: ; preds = %2, %7
ret void
}
void foo_2_2_1_1_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_2_1_1_2() {
ret void
}
void HwMdClearScreen(void) {
  while ((*(volatile unsigned short *)0x20004020))
    ;
  (*(volatile unsigned short *)0x20004020) = 0x0400;
  while ((*(volatile unsigned short *)0x20004020))
    ;
}


x86 assembly (clang, -O0):
<HwMdClearScreen>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HwMdClearScreen+0x9>
mov    $0x20004020,%eax
mov    (%rax),%ax
cmp    $0x0,%ax
je     1120 <HwMdClearScreen+0x20>
jmp    1109 <HwMdClearScreen+0x9>
mov    $0x20004020,%eax
movw   $0x400,(%rax)
mov    $0x20004020,%eax
mov    (%rax),%ax
cmp    $0x0,%ax
je     1141 <HwMdClearScreen+0x41>
jmp    112a <HwMdClearScreen+0x2a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwMdClearScreen>:
cmpw   $0x0,0x20004020
jne    1100 <HwMdClearScreen>
movw   $0x400,0x20004020
cs nopw 0x0(%rax,%rax,1)
nop
cmpw   $0x0,0x20004020
jne    1120 <HwMdClearScreen+0x20>
ret

LLVM IR (-O0):
define void @HwMdClearScreen() {
br label %1
1: ; preds = %4, %0
%2 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%3 = icmp ne i16 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
store volatile i16 1024, i16* inttoptr (i64 536887328 to i16*)
br label %6
6: ; preds = %9, %5
%7 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%8 = icmp ne i16 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %6
10: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @HwMdClearScreen() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%3 = icmp eq i16 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
store volatile i16 1024, i16* inttoptr (i64 536887328 to i16*)
br label %5
5: ; preds = %5, %4
%6 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%7 = icmp eq i16 %6, 0
br i1 %7, label %8, label %5
8: ; preds = %5
ret void
}
unsigned char *hmac1digest(bitstr, bitcnt, key, keylen)
unsigned char *bitstr;
unsigned long bitcnt;
unsigned char *key;
unsigned int keylen;
{ return ((unsigned char *)hmaccomp(1, 1, bitstr, bitcnt, key, keylen)); }


x86 assembly (clang, -O0):
<hmac1digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <hmaccomp@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac1digest>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <hmaccomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hmac1digest(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 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 1, i32 1, i8* %9, i64 %10, i8* %11, i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @hmac1digest(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 1, i32 1, i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ CuFail_Line(int /*<<< orphan*/ *, char const *, int,
                               int /*<<< orphan*/ *, char const *);
void CuTestAssertForDb(const char *msg, const char *file, int line) {
  CuFail_Line(NULL, file, line, NULL, msg);
}


x86 assembly (clang, -O0):
<CuTestAssertForDb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%r8
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdi
call   1030 <CuFail_Line@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CuTestAssertForDb>:
mov    %rdi,%r8
xor    %edi,%edi
xor    %ecx,%ecx
jmp    1030 <CuFail_Line@plt>

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

LLVM IR (-O2):
define void @CuTestAssertForDb(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @CuFail_Line(i32* null, i8* %1, i32 %2, i32* null, i8* %0)
ret void
}