xunge/DecIR huggingface dataset:
/* Variables and functions */
int foo(int);
int main() {
  int j = foo(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
ret i32 0
}
__attribute__((always_)) void vmk_CPUMemFenceWrite(void) {
  asm volatile("sfence" ::: "memory");
}


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

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

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

LLVM IR (-O2):
define void @vmk_CPUMemFenceWrite() {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void Plain_LinkCheck(void) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @Plain_LinkCheck() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  i = 0;
  j = 0;
  while (i < 4) {
    i = i + 1;
    j = j + 2;
  }
  assert(j == 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x9,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void fail(char **argv) {
  printf("usage: %s [-l|--list] <problem number>\n\n  -l, --list\tlist solved "
         "problems, with link to problem on projecteuler.net\n",
         argv[0]);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    (%rdi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [117 x i8] c"usage: %s [-l|--list] <problem number>\0A\0A -l, --list\09list solved problems, with link to problem on projecteuler.net\0A\00"
@EXIT_FAILURE = global i32 0
define void @fail(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [117 x i8] c"usage: %s [-l|--list] <problem number>\0A\0A -l, --list\09list solved problems, with link to problem on projecteuler.net\0A\00"
@EXIT_FAILURE = global i32 0
define void @fail(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int main() {
  int i;
  printf("begining port 0x80 write test\n");
  for (i = 0; i < 10000000; ++i)
    asm volatile("outb %al, $0x80");
  printf("done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    1151 <main+0x41>
out    %al,$0x80
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x989680,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
out    %al,$0x80
add    $0xffffffff,%eax
jne    1130 <main+0x20>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"begining port 0x80 write test\0A\00"
@.str.1 = [6 x i8] c"done\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10000000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"begining port 0x80 write test\00"
@str.2 = [5 x i8] c"done\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %4, %2 ]
tail call void asm sideeffect "outb %al, $$0x80", "~{dirflag},~{fpsr},~{flags}"()
%4 = add nuw nsw i32 %3, 1
%5 = icmp eq i32 %4, 10000000
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void key_destroy(void *param) {}


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

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

LLVM IR (-O0):
define void @key_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @key_destroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void cleanup(int sockd) {
  if (sockd)
    close(sockd);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112d <cleanup+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
test   %edi,%edi
je     1119 <cleanup+0x9>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @cleanup(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
char *path_getFileNameOnly(char *path) {
  char *p = path;
  char *s = p;
  while (*p) {
    if (*p == '\\' || *p == '/') {
      s = p + 1;
    }
    p++;
  }
  return s;
}


x86 assembly (clang, -O0):
<path_getFileNameOnly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <path_getFileNameOnly+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1145 <path_getFileNameOnly+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1151 <path_getFileNameOnly+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <path_getFileNameOnly+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_getFileNameOnly>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <path_getFileNameOnly+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <path_getFileNameOnly+0x10>
cmp    $0x5c,%dl
je     1110 <path_getFileNameOnly+0x10>
test   %dl,%dl
jne    1113 <path_getFileNameOnly+0x13>
ret

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

LLVM IR (-O2):
define i8* @path_getFileNameOnly(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 92, label %6
i8 47, label %6
]
6: ; preds = %2, %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ kstrcpy(char *, char const *);
char *kstrcat(char *s1, const char *s2) {
  char *s = s1;
  while (*s != '\0')
    s++;
  kstrcpy(s, s2);
  return s1;
}


x86 assembly (clang, -O0):
<kstrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <kstrcat+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <kstrcat+0x18>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <kstrcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kstrcat>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <kstrcat+0x10>
call   1030 <kstrcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @kstrcat(i8* returned %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @kstrcpy(i8* %4, i8* %1)
ret i8* %0
}
int test_imm_65int8_reg(signed char val) {
  return ((val) & (-0x65 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_65int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff9b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_65int8_reg>:
test   $0x9b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_65int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -101
%6 = icmp ne i32 %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_65int8_reg(i8 signext %0) {
%2 = and i8 %0, -101
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned short make15color(unsigned char r, unsigned char g, unsigned char b) {
  return ((((r >> 3) & 31) << 10) | (((g >> 3) & 31) << 5) | ((b >> 3) & 31));
}


x86 assembly (clang, -O0):
<make15color>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
shl    $0xa,%eax
movzbl -0x2(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1f,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzbl -0x3(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1f,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make15color>:
shr    $0x3,%dil
movzbl %dil,%eax
shl    $0xa,%eax
shr    $0x3,%sil
movzbl %sil,%ecx
shl    $0x5,%ecx
or     %eax,%ecx
shr    $0x3,%dl
movzbl %dl,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @make15color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 3
%10 = and i32 %9, 31
%11 = shl i32 %10, 10
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = ashr i32 %13, 3
%15 = and i32 %14, 31
%16 = shl i32 %15, 5
%17 = or i32 %11, %16
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = ashr i32 %19, 3
%21 = and i32 %20, 31
%22 = or i32 %17, %21
%23 = trunc i32 %22 to i16
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @make15color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = lshr i8 %0, 3
%5 = zext i8 %4 to i16
%6 = shl nuw nsw i16 %5, 10
%7 = lshr i8 %1, 3
%8 = zext i8 %7 to i16
%9 = shl nuw nsw i16 %8, 5
%10 = or i16 %9, %6
%11 = lshr i8 %2, 3
%12 = zext i8 %11 to i16
%13 = or i16 %10, %12
ret i16 %13
}
/* Variables and functions */
int /*<<< orphan*/ print_supported_filetypes();
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf(
      "cbfstool: Management utility for CBFS formatted ROM images\n\n"
      "USAGE:\n"
      " cbfstool [-h]\n"
      " cbfstool FILE COMMAND [PARAMETERS]...\n\n"
      "OPTIONs:\n"
      "  -h		Display this help message\n\n"
      "COMMANDs:\n"
      " add FILE NAME TYPE [base address]    Add a component\n"
      " add-payload FILE NAME [COMP] [base]  Add a payload to the ROM\n"
      " add-stage FILE NAME [COMP] [base]    Add a stage to the ROM\n"
      " create SIZE BOOTBLOCK [ALIGN]        Create a ROM file\n"
      " locate FILE NAME ALIGN               Find a place for a file of that "
      "size\n"
      " print                                Show the contents of the ROM\n\n"
      "TYPEs:\n");
  print_supported_filetypes();
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_supported_filetypes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print_supported_filetypes@plt>

LLVM IR (-O0):
@.str = [559 x i8] c"cbfstool: Management utility for CBFS formatted ROM images\0A\0AUSAGE:\0A cbfstool [-h]\0A cbfstool FILE COMMAND [PARAMETERS]...\0A\0AOPTIONs:\0A -h\09\09Display this help message\0A\0ACOMMANDs:\0A add FILE NAME TYPE [base address] Add a component\0A add-payload FILE NAME [COMP] [base] Add a payload to the ROM\0A add-stage FILE NAME [COMP] [base] Add a stage to the ROM\0A create SIZE BOOTBLOCK [ALIGN] Create a ROM file\0A locate FILE NAME ALIGN Find a place for a file of that size\0A print Show the contents of the ROM\0A\0ATYPEs:\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([559 x i8], [559 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @print_supported_filetypes()
ret void
}

LLVM IR (-O2):
@str = [558 x i8] c"cbfstool: Management utility for CBFS formatted ROM images\0A\0AUSAGE:\0A cbfstool [-h]\0A cbfstool FILE COMMAND [PARAMETERS]...\0A\0AOPTIONs:\0A -h\09\09Display this help message\0A\0ACOMMANDs:\0A add FILE NAME TYPE [base address] Add a component\0A add-payload FILE NAME [COMP] [base] Add a payload to the ROM\0A add-stage FILE NAME [COMP] [base] Add a stage to the ROM\0A create SIZE BOOTBLOCK [ALIGN] Create a ROM file\0A locate FILE NAME ALIGN Find a place for a file of that size\0A print Show the contents of the ROM\0A\0ATYPEs:\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([558 x i8], [558 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @print_supported_filetypes()
ret void
}
void plug_nl_datetime_shutdown(void *in_context) {}


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

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

LLVM IR (-O0):
define void @plug_nl_datetime_shutdown(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @plug_nl_datetime_shutdown(i8* nocapture %0) {
ret void
}
int test_imm_DEuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xDE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DEuint64_lowword_reg>:
test   $0xde,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DEuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 222
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void I422ToRGB565() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *itoa(int number) {
  static char buffer[33];
  snprintf(buffer, sizeof(buffer), "%d", number);
  return buffer;
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x21,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x21,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@itoa.buffer = internal global [33 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @itoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @itoa.buffer, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @itoa.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@itoa.buffer = internal global [33 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @itoa(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @itoa.buffer, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @itoa.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ADC_IRQ_Disable();
void ADC_IRQ_Stop(void) { ADC_IRQ_Disable(); }


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

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

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

LLVM IR (-O2):
define void @ADC_IRQ_Stop() {
%1 = tail call i32 (...) @ADC_IRQ_Disable()
ret void
}
void *slab_data(struct slab *slab) { return (char *)slab + slab_sizeof(); }


x86 assembly (clang, -O0):
<slab_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <slab_sizeof@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slab_data>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <slab_sizeof@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.slab = type opaque
define i8* @slab_data(%struct.slab* %0) {
%2 = alloca %struct.slab*
store %struct.slab* %0, %struct.slab** %2
%3 = load %struct.slab*, %struct.slab** %2
%4 = bitcast %struct.slab* %3 to i8*
%5 = call i32 (...) @slab_sizeof()
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
ret i8* %7
}

LLVM IR (-O2):
%struct.slab = type opaque
define i8* @slab_data(%struct.slab* readnone %0) {
%2 = bitcast %struct.slab* %0 to i8*
%3 = tail call i32 (...) @slab_sizeof()
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
ret i8* %5
}
void test___atomic_add_fetch_0(char *mem) { __atomic_add_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_add_fetch_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,%al
lock xadd %al,(%rdx)
add    %cl,%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_add_fetch_0>:
lock addb $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_add_fetch_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw add i8* %5, i8 %6 acq_rel
%8 = add i8 %7, %6
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_add_fetch_0(i8* nocapture %0) {
%2 = atomicrmw add i8* %0, i8 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int a = 0, b = 0, s = 0;
  printf("Valores de a y b: ");
  scanf("%d %d", &a, &b);
  s = a + b;
  printf("La suma es %d\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Valores de a y b: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [15 x i8] c"La suma es %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Valores de a y b: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [15 x i8] c"La suma es %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int atol(char const *);
__attribute__((unused)) int atoi(const char *s) { return atol(s); }


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

x86 assembly (clang, -O2):
<atoi>:
jmp    1030 <atol@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i32 @atol(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void dah(FILE *out) { fputc('-', out); }


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

x86 assembly (clang, -O2):
<dah>:
mov    %rdi,%rsi
mov    $0x2d,%edi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @dah(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputc(i8 signext 45, i32* %3)
ret void
}

LLVM IR (-O2):
define void @dah(i32* nocapture %0) {
%2 = tail call i32 @fputc(i8 signext 45, i32* %0)
ret void
}
int write(int file, char *ptr, int len) {}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int task(int);
int thread(int thread) { return task(thread) + 1; }


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

x86 assembly (clang, -O2):
<thread>:
push   %rax
call   1030 <task@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @thread(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @task(i32 %3)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @thread(i32 %0) {
%2 = tail call i32 @task(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
long f(long x) { return x / (-0x7fffffffL - 1L); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffffffff80000000,%rcx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x7fffffff(%rdi),%rax
test   %rdi,%rdi
cmovns %rdi,%rax
sar    $0x1f,%rax
neg    %rax
ret

LLVM IR (-O0):
define i64 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sdiv i64 %3, -2147483648
ret i64 %4
}

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = sdiv i64 %0, -2147483648
ret i64 %2
}
unsigned int pseudo_random(unsigned int x_n) {
  return 1103515245 * x_n + 12345;
}


x86 assembly (clang, -O0):
<pseudo_random>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x41c64e6d,-0x4(%rbp),%eax
add    $0x3039,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pseudo_random>:
imul   $0x41c64e6d,%edi,%eax
add    $0x3039,%eax
ret

LLVM IR (-O0):
define i32 @pseudo_random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 1103515245, %3
%5 = add i32 %4, 12345
ret i32 %5
}

LLVM IR (-O2):
define i32 @pseudo_random(i32 %0) {
%2 = mul i32 %0, 1103515245
%3 = add i32 %2, 12345
ret i32 %3
}
/* Variables and functions */
void stub1(float, short);
void testClosureFSrV(void (*closure)(float, short), float a1, short a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureFSrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1132 <testClosureFSrV+0x32>
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movswl -0xe(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFSrV>:
test   %rdi,%rdi
je     110d <testClosureFSrV+0xd>
mov    %rdi,%rax
movswl %si,%edi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureFSrV(void (float, i16)* %0, float %1, i16 signext %2) {
%4 = icmp eq void (float, i16)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(float %1, i16 signext %2)
br label %6
6: ; preds = %5, %3
ret void
}
unsigned long ppc_function_entry(void *func) { return (unsigned long)func; }


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

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

LLVM IR (-O0):
define i64 @ppc_function_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @ppc_function_entry(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
int test_imm_39uint32_mem(unsigned int *val) {
  return ((*val) & (0x39 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_39uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 57
%6 = icmp ne i32 %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_39uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 57
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_normalize(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2i *psvec2i_normalize(struct vec2i *result,
                                                         struct vec2i *a) {
  vec2i_normalize((int32_t *)result, (int32_t *)a);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2i_normalize>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_normalize@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_normalize(%struct.vec2i* %0, %struct.vec2i* %1) {
%3 = alloca %struct.vec2i*
%4 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %3
store %struct.vec2i* %1, %struct.vec2i** %4
%5 = load %struct.vec2i*, %struct.vec2i** %3
%6 = bitcast %struct.vec2i* %5 to i32*
%7 = load %struct.vec2i*, %struct.vec2i** %4
%8 = bitcast %struct.vec2i* %7 to i32*
%9 = call i32 @vec2i_normalize(i32* %6, i32* %8)
%10 = load %struct.vec2i*, %struct.vec2i** %3
ret %struct.vec2i* %10
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_normalize(%struct.vec2i* returned %0, %struct.vec2i* %1) {
%3 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%4 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%5 = tail call i32 @vec2i_normalize(i32* %3, i32* %4)
ret %struct.vec2i* %0
}
void freeTenDigits(long long *value) {}


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

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

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

LLVM IR (-O2):
define void @freeTenDigits(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int strcmp(char *const, char *const);
int assert_suite_compare(const void *p1, const void *p2) {
  return strcmp(*(char *const *)p1, *(char *const *)p2);
}


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

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

LLVM IR (-O0):
define i32 @assert_suite_compare(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @assert_suite_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg16(int);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, int);
unsigned short VIM_LCDIF_RsHExR(void) {
  VIM_HIF_SetReg8((0x0400 + 0x026), 0x1);
  return (unsigned short)VIM_HIF_GetReg16((0x0400 + 0x022));
}


x86 assembly (clang, -O0):
<VIM_LCDIF_RsHExR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x426,%edi
mov    $0x1,%esi
call   1040 <VIM_HIF_SetReg8@plt>
mov    $0x422,%edi
call   1030 <VIM_HIF_GetReg16@plt>
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_LCDIF_RsHExR>:
push   %rax
mov    $0x426,%edi
mov    $0x1,%esi
call   1040 <VIM_HIF_SetReg8@plt>
mov    $0x422,%edi
call   1030 <VIM_HIF_GetReg16@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @VIM_LCDIF_RsHExR() {
%1 = call i32 @VIM_HIF_SetReg8(i32 1062, i32 1)
%2 = call i64 @VIM_HIF_GetReg16(i32 1058)
%3 = trunc i64 %2 to i16
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @VIM_LCDIF_RsHExR() {
%1 = tail call i32 @VIM_HIF_SetReg8(i32 1062, i32 1)
%2 = tail call i64 @VIM_HIF_GetReg16(i32 1058)
%3 = trunc i64 %2 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ idt_init();
int /*<<< orphan*/ kerror(char const *);
int /*<<< orphan*/ keyboard_init();
int /*<<< orphan*/ kprint_newline();
void kmain(void) {
  const char *str = "welcome to the kernel";
  clear_screen();
  kerror(str);
  kprint_newline();
  kprint_newline();
  idt_init();
  keyboard_init();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <clear_screen@plt>
mov    -0x8(%rbp),%rdi
call   1070 <kerror@plt>
mov    $0x0,%al
call   1030 <kprint_newline@plt>
mov    $0x0,%al
call   1030 <kprint_newline@plt>
mov    $0x0,%al
call   1050 <idt_init@plt>
mov    $0x0,%al
call   1040 <keyboard_init@plt>
jmp    118f <kmain+0x3f>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1060 <clear_screen@plt>
lea    0xea1(%rip),%rdi
call   1070 <kerror@plt>
xor    %eax,%eax
call   1030 <kprint_newline@plt>
xor    %eax,%eax
call   1030 <kprint_newline@plt>
xor    %eax,%eax
call   1050 <idt_init@plt>
xor    %eax,%eax
call   1040 <keyboard_init@plt>
jmp    1180 <kmain+0x30>

LLVM IR (-O0):
@.str = [22 x i8] c"welcome to the kernel\00"
define void @kmain() {
%1 = alloca i8*
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 (...) @clear_screen()
%3 = load i8*, i8** %1
%4 = call i32 @kerror(i8* %3)
%5 = call i32 (...) @kprint_newline()
%6 = call i32 (...) @kprint_newline()
%7 = call i32 (...) @idt_init()
%8 = call i32 (...) @keyboard_init()
br label %9
9: ; preds = %0, %9
br label %9
}

LLVM IR (-O2):
@.str = [22 x i8] c"welcome to the kernel\00"
define void @kmain() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 @kerror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @kprint_newline()
%4 = tail call i32 (...) @kprint_newline()
%5 = tail call i32 (...) @idt_init()
%6 = tail call i32 (...) @keyboard_init()
br label %7
7: ; preds = %7, %0
br label %7
}
int toi_incremental_support(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @toi_incremental_support() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ closed_files(int, int);
void closed_files_test(void **state) {
  assert_int_equal(0x0101010101010101ul | 0x0202020202020202ul |
                       0x2020202020202020ul,
                   closed_files(0x0000000000003300ul, 0x0023000000000000ul));
}


x86 assembly (clang, -O0):
<closed_files_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3300,%edi
xor    %esi,%esi
call   1030 <closed_files@plt>
mov    %eax,%esi
mov    $0x23232323,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closed_files_test>:
push   %rax
mov    $0x3300,%edi
xor    %esi,%esi
call   1030 <closed_files@plt>
mov    $0x23232323,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @closed_files_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @closed_files(i32 13056, i32 0)
%4 = call i32 @assert_int_equal(i32 589505315, i32 %3)
ret void
}

LLVM IR (-O2):
define void @closed_files_test(i8** nocapture readnone %0) {
%2 = tail call i32 @closed_files(i32 13056, i32 0)
%3 = tail call i32 @assert_int_equal(i32 589505315, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perm(int *, int /*<<< orphan*/);
int main() {
  static int memo[10];
  perm(memo, 0);
  return 0;
}


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

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

LLVM IR (-O0):
@main.memo = internal global [10 x i32] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @perm(i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.memo, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@main.memo = internal global [10 x i32] zeroinitializer
define i32 @main() {
%1 = tail call i32 @perm(i32* getelementptr inbounds ([10 x i32], [10 x i32]* @main.memo, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t counter_high(uint64_t counter) {
  return (uint32_t)(counter >> 32);
}


x86 assembly (clang, -O0):
<counter_high>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @counter_high(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ free_first_sem(int);
void kick_client(int semid) { free_first_sem(semid); }


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

x86 assembly (clang, -O2):
<kick_client>:
jmp    1030 <free_first_sem@plt>

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

LLVM IR (-O2):
define void @kick_client(i32 %0) {
%2 = tail call i32 @free_first_sem(i32 %0)
ret void
}
int at91_suspend_entering_slow_clock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @at91_suspend_entering_slow_clock() {
ret i32 0
}
void kexec_crash_save_cpu(void) {}


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

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

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

LLVM IR (-O2):
define void @kexec_crash_save_cpu() {
ret void
}
int array_to_position(int i) {
  return ((i % 4) * 2 + (((i / 4) % 2) ^ 1)) * 10 + (i / 4);
}


x86 assembly (clang, -O0):
<array_to_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
xor    $0x1,%edx
add    %edx,%eax
imul   $0xa,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_to_position>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%edi
mov    %eax,%ecx
sar    $0x2,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
and    $0xfffffffe,%eax
mov    %ecx,%edx
sub    %eax,%edx
xor    $0x1,%edx
lea    (%rdx,%rdi,2),%eax
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @array_to_position(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = mul nsw i32 %4, 2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 4
%8 = srem i32 %7, 2
%9 = xor i32 %8, 1
%10 = add nsw i32 %5, %9
%11 = mul nsw i32 %10, 10
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 4
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @array_to_position(i32 %0) {
%2 = srem i32 %0, 4
%3 = shl nsw i32 %2, 1
%4 = sdiv i32 %0, 4
%5 = srem i32 %4, 2
%6 = xor i32 %5, 1
%7 = add nsw i32 %6, %3
%8 = mul nsw i32 %7, 10
%9 = add nsw i32 %8, %4
ret i32 %9
}
void reset_array(int *arr, int size) {
  int i;
  for (i = 0; i < size; ++i)
    arr[i] = 0;
}


x86 assembly (clang, -O0):
<reset_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <reset_array+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <reset_array+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_array>:
test   %esi,%esi
jle    1126 <reset_array+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @reset_array(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @reset_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}