xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, unsigned int, unsigned int,
                       unsigned int);
int shim_close_range(unsigned int fd, unsigned int max_fd, unsigned int flags) {
  return (int)shim_enosys(0, fd, max_fd, flags);
}


x86 assembly (clang, -O0):
<shim_close_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_close_range>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_close_range(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
int gdt_compare_ulong(const void *p1, const void *p2) {
  unsigned long n1 = *((unsigned long *)p1);
  unsigned long n2 = *((unsigned long *)p2);
  if (n1 < n2) {
    return -1;
  } else if (n1 > n2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<gdt_compare_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    113c <gdt_compare_ulong+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <gdt_compare_ulong+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    1156 <gdt_compare_ulong+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <gdt_compare_ulong+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdt_compare_ulong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gdt_compare_ulong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ fchdir(int);
int open(char *, int /*<<< orphan*/);
int execute_fchdir() {
  int dfd = open(".", O_RDONLY);
  fchdir(dfd);
  return 0;
}


x86 assembly (clang, -O0):
<execute_fchdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fchdir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_fchdir>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
call   1030 <fchdir@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@O_RDONLY = global i32 0
define i32 @execute_fchdir() {
%1 = alloca i32
%2 = load i32, i32* @O_RDONLY
%3 = call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @fchdir(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@O_RDONLY = global i32 0
define i32 @execute_fchdir() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @fchdir(i32 %2)
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ recomment(int);
main() {
  int c, d;
  while ((c = getchar()) != EOF)
    recomment(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1040 <recomment@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1040 <recomment@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @recomment(i32 %9)
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @recomment(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
int test_imm_59uint8_reg(unsigned char val) {
  return ((val) & (0x59 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_59uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 89
%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_59uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 89
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
char **malloc(int);
void dangle() {
  char **p = malloc(20);
  *p = (char *)(p + 4);
  **p = 8;
  free(p);
  **p = 7;
}


x86 assembly (clang, -O0):
<dangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
add    $0x20,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0x8,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0x7,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dangle>:
push   %rbx
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
add    $0x20,%rax
mov    %rax,(%rbx)
movb   $0x8,0x20(%rbx)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
movb   $0x7,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @dangle() {
%1 = alloca i8**
%2 = call i8** @malloc(i32 20)
store i8** %2, i8*** %1
%3 = load i8**, i8*** %1
%4 = getelementptr inbounds i8*, i8** %3, i64 4
%5 = bitcast i8** %4 to i8*
%6 = load i8**, i8*** %1
store i8* %5, i8** %6
%7 = load i8**, i8*** %1
%8 = load i8*, i8** %7
store i8 8, i8* %8
%9 = load i8**, i8*** %1
%10 = call i32 @free(i8** %9)
%11 = load i8**, i8*** %1
%12 = load i8*, i8** %11
store i8 7, i8* %12
ret void
}

LLVM IR (-O2):
define void @dangle() {
%1 = tail call i8** @malloc(i32 20)
%2 = getelementptr inbounds i8*, i8** %1, i64 4
%3 = bitcast i8** %2 to i8*
%4 = bitcast i8** %1 to i8***
store i8** %2, i8*** %4
store i8 8, i8* %3
%5 = tail call i32 @free(i8** %1)
%6 = load i8*, i8** %1
store i8 7, i8* %6
ret void
}
int __sx25_find_link_parameters(struct link_data **lptr) {
  (void)lptr;
  return (0);
}


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

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

LLVM IR (-O0):
%struct.link_data = type opaque
define i32 @__sx25_find_link_parameters(%struct.link_data** %0) {
%2 = alloca %struct.link_data**
store %struct.link_data** %0, %struct.link_data*** %2
%3 = load %struct.link_data**, %struct.link_data*** %2
ret i32 0
}

LLVM IR (-O2):
%struct.link_data = type opaque
define i32 @__sx25_find_link_parameters(%struct.link_data** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
uintptr_t __attribute__((pure, no, noclone)) foo(int *a) {
  return (uintptr_t)a;
}


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

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

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

LLVM IR (-O2):
define i64 @foo(i32* %0) {
%2 = ptrtoint i32* %0 to i64
ret i64 %2
}
void DMA2_Stream6_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @DMA2_Stream6_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ escape(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char w[] = "This\tis\ta\ntest\tstring\n";
  char x[50];
  escape(w, x);
  printf("Unescaped: %s\n", w);
  printf("Escaped: %s\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xebf(%rip),%ax
mov    %ax,-0xc(%rbp)
mov    0xeb7(%rip),%al
mov    %al,-0xa(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <escape@plt>
lea    -0x20(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa676e69727473,%rax
mov    %rax,0xf(%rsp)
mov    %rsp,%rbx
lea    0x20(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <escape@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.w = [23 x i8] c"This\09is\09a\0Atest\09string\0A\00"
@.str = [15 x i8] c"Unescaped: %s\0A\00"
@.str.1 = [13 x i8] c"Escaped: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [23 x i8]
%3 = alloca [50 x i8]
store i32 0, i32* %1
%4 = bitcast [23 x i8]* %2 to i8*
%5 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%7 = call i32 @escape(i8* %5, i8* %6)
%8 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.w = [23 x i8] c"This\09is\09a\0Atest\09string\0A\00"
@.str = [15 x i8] c"Unescaped: %s\0A\00"
@.str.1 = [13 x i8] c"Escaped: %s\0A\00"
define i32 @main() {
%1 = alloca [23 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @escape(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
void ExttIsm5AuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttIsm5AuxTable() {
ret void
}
int test_first(int first1) { return first1; }


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

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

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

LLVM IR (-O2):
define i32 @test_first(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int close(int);
int errno;
int scsi_pt_close_device(int device_fd) {
  int res;
  res = close(device_fd);
  if (res < 0)
    res = -errno;
  return res;
}


x86 assembly (clang, -O0):
<scsi_pt_close_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    113e <scsi_pt_close_device+0x2e>
xor    %eax,%eax
mov    0x2ea7(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scsi_pt_close_device>:
push   %rax
call   1030 <close@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovs  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @scsi_pt_close_device(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = sub nsw i32 0, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @scsi_pt_close_device(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %5, i32 %2
ret i32 %6
}
void updateBatteryLevel() {}


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

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

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

LLVM IR (-O2):
define void @updateBatteryLevel() {
ret void
}
int device_perform_action(int which) { return which; }


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

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

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

LLVM IR (-O2):
define i32 @device_perform_action(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f2(void) { abort(); }


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

x86 assembly (clang, -O2):
<f2>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @f2() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @f2() {
%1 = tail call i32 (...) @abort()
unreachable
}
unsigned int controlloNumeroPrimo(unsigned int numeroDaControllare) {
  unsigned int contatoreDivisione;
  if (numeroDaControllare >= 2) {
    contatoreDivisione = (numeroDaControllare - 1);
    while (contatoreDivisione >= 2) {
      if (numeroDaControllare % contatoreDivisione == 0) {
        return 0;
      } else {
        contatoreDivisione--;
      }
    }
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<controlloNumeroPrimo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jb     115b <controlloNumeroPrimo+0x5b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jb     114f <controlloNumeroPrimo+0x4f>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    1141 <controlloNumeroPrimo+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1162 <controlloNumeroPrimo+0x62>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <controlloNumeroPrimo+0x1a>
movl   $0x1,-0x4(%rbp)
jmp    1162 <controlloNumeroPrimo+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<controlloNumeroPrimo>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jb     1122 <controlloNumeroPrimo+0x22>
lea    -0x1(%rdi),%esi
xor    %ecx,%ecx
nopl   0x0(%rax)
cmp    $0x2,%esi
jb     1125 <controlloNumeroPrimo+0x25>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    $0xffffffff,%esi
test   %edx,%edx
jne    1110 <controlloNumeroPrimo+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @controlloNumeroPrimo(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %5, %7 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = icmp ugt i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = urem i32 %0, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %7, %1
%11 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ]
ret i32 %11
}
/* Variables and functions */
int max(int /*<<< orphan*/, int, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[10] = {7, 2, -5, 9, -7, 3, 12, -9, 9, 7};
  printf("%d\n", max(0, 9, arr));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdx
xor    %edi,%edi
mov    $0x9,%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
xor    %edi,%edi
mov    $0x9,%esi
call   1040 <max@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 7, i32 2, i32 -5, i32 9, i32 -7, i32 3, i32 12, i32 -9, i32 9, i32 7]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @max(i32 0, i32 9, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 7, i32 2, i32 -5, i32 9, i32 -7, i32 3, i32 12, i32 -9, i32 9, i32 7]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @max(i32 0, i32 9, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_track_remove_sender(void *track, void *m) {
  return -EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_track_remove_sender(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void func01(void) {
  struct foo *ptr;
  asm("func01_label: .globl func01_label");
  ptr = (struct foo *)0x0;
  return;
}


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

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

LLVM IR (-O0):
%struct.foo = type opaque
define void @func01() {
%1 = alloca %struct.foo*
store %struct.foo* null, %struct.foo** %1
ret void
}

LLVM IR (-O2):
%struct.foo = type opaque
define void @func01() {
tail call void asm sideeffect "func01_label: .globl func01_label", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
unsigned int f24(unsigned int);
unsigned int f25(unsigned int a) { return f24(f24(a)); }


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

x86 assembly (clang, -O2):
<f25>:
push   %rax
call   1030 <f24@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f24@plt>

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

LLVM IR (-O2):
define i32 @f25(i32 %0) {
%2 = tail call i32 @f24(i32 %0)
%3 = tail call i32 @f24(i32 %2)
ret i32 %3
}
/* Variables and functions */
int *func_dep_one(int flag, int *input) {
  if (flag > 0) {
    return input;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<func_dep_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1122 <func_dep_one+0x22>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <func_dep_one+0x2a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_dep_one>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %rsi,%rax
ret

LLVM IR (-O0):
define i32* @func_dep_one(i32 %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32*, i32** %5
store i32* %9, i32** %3
br label %11
10: ; preds = %2
store i32* null, i32** %3
br label %11
11: ; preds = %10, %8
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @func_dep_one(i32 %0, i32* readnone %1) {
%3 = icmp sgt i32 %0, 0
%4 = select i1 %3, i32* %1, i32* null
ret i32* %4
}
const char *Process_Brief(void) { return "Operating System Process"; }


x86 assembly (clang, -O0):
<Process_Brief>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Process_Brief>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Operating System Process\00"
define i8* @Process_Brief() {
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [25 x i8] c"Operating System Process\00"
define i8* @Process_Brief() {
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}
void test_isascii(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, isascii(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_isascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1186 <test_isascii+0x66>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <isascii@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8d(%rip),%rdi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_isascii+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isascii>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <isascii@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_isascii+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isascii = [13 x i8] c"test_isascii\00"
define void @test_isascii() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @isascii to i32 (i32, ...)*)(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_isascii, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isascii = [13 x i8] c"test_isascii\00"
define void @test_isascii() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @isascii to i32 (i32, ...)*)(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_isascii, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
disp_msg() { printf("All the best"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"All the best\00"
define i32 @disp_msg() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"All the best\00"
define i32 @disp_msg() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void Settings_StoreInt(char *KeyName, int Value) {}


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

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

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

LLVM IR (-O2):
define void @Settings_StoreInt(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double ReflexTestData_GetMinResponseTime();
double LcdModel_GetMinResponseTime() {
  return ReflexTestData_GetMinResponseTime();
}


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

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

LLVM IR (-O0):
define double @LcdModel_GetMinResponseTime() {
%1 = call double (...) @ReflexTestData_GetMinResponseTime()
ret double %1
}

LLVM IR (-O2):
define double @LcdModel_GetMinResponseTime() {
%1 = tail call double (...) @ReflexTestData_GetMinResponseTime()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ operation_sleep();
int /*<<< orphan*/ set_wakeup_timer(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
void operation_sleep_notimer(void) {
  set_wakeup_timer(0, 0, 0);
  delay(100);
  operation_sleep();
}


x86 assembly (clang, -O0):
<operation_sleep_notimer>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <set_wakeup_timer@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x0,%al
call   1040 <operation_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_sleep_notimer>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <set_wakeup_timer@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <operation_sleep@plt>

LLVM IR (-O0):
define void @operation_sleep_notimer() {
%1 = call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = call i32 @delay(i32 100)
%3 = call i32 (...) @operation_sleep()
ret void
}

LLVM IR (-O2):
define void @operation_sleep_notimer() {
%1 = tail call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 (...) @operation_sleep()
ret void
}
char *AdvanceToNonBlank(char *ptr) {
  while (*ptr == ' ') {
    ptr++;
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<AdvanceToNonBlank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <AdvanceToNonBlank+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <AdvanceToNonBlank+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdvanceToNonBlank>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <AdvanceToNonBlank+0x10>
ret

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

LLVM IR (-O2):
define i8* @AdvanceToNonBlank(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
void VP8LEncDspInitMSA(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8LEncDspInitMSA() {
ret void
}
int is_new_face(int iface, int four_face[], int nf) {
  int i;
  for (i = 0; i < nf; ++i)
    if (iface == four_face[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_new_face>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <is_new_face+0x54>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1141 <is_new_face+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115b <is_new_face+0x5b>
jmp    1146 <is_new_face+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <is_new_face+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_new_face>:
mov    $0x1,%eax
test   %edx,%edx
jle    111e <is_new_face+0x1e>
mov    %edx,%ecx
xor    %edx,%edx
nopl   (%rax)
cmp    %edi,(%rsi,%rdx,4)
je     111f <is_new_face+0x1f>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <is_new_face+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_new_face(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %16
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ set_dec(int);
int tb_frequency();
void delay_ms(unsigned int ms) {
  uint32_t ticks_per_ms;
  ticks_per_ms = tb_frequency() / 1000;
  while (0 < ms) {
    set_dec(ticks_per_ms);
    while (((get_dec()) & 0x80000000) == 0)
      ;
    ms--;
  }
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <tb_frequency@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jae    1188 <delay_ms+0x58>
mov    -0x8(%rbp),%edi
call   1040 <set_dec@plt>
mov    $0x0,%al
call   1030 <get_dec@plt>
and    $0x80000000,%eax
cmp    $0x0,%eax
jne    117a <delay_ms+0x4a>
jmp    1160 <delay_ms+0x30>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    114d <delay_ms+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <tb_frequency@plt>
test   %ebx,%ebx
je     1180 <delay_ms+0x50>
cltq
imul   $0x10624dd3,%rax,%r14
mov    %r14,%rax
shr    $0x3f,%rax
sar    $0x26,%r14
add    %eax,%r14d
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
call   1040 <set_dec@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get_dec@plt>
test   %eax,%eax
jns    1170 <delay_ms+0x40>
add    $0xffffffff,%ebx
jne    1160 <delay_ms+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @delay_ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @tb_frequency()
%5 = sdiv i32 %4, 1000
store i32 %5, i32* %3
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %2
%8 = icmp ult i32 0, %7
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 @set_dec(i32 %10)
br label %12
12: ; preds = %16, %9
%13 = call i32 (...) @get_dec()
%14 = and i32 %13, -2147483648
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
br label %12
17: ; preds = %12
%18 = load i32, i32* %2
%19 = add i32 %18, -1
store i32 %19, i32* %2
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = tail call i32 (...) @tb_frequency()
%3 = sdiv i32 %2, 1000
%4 = icmp eq i32 %0, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %11
%6 = phi i32 [ %12, %11 ], [ %0, %1 ]
%7 = tail call i32 @set_dec(i32 %3)
br label %8
8: ; preds = %8, %5
%9 = tail call i32 (...) @get_dec()
%10 = icmp sgt i32 %9, -1
br i1 %10, label %8, label %11
11: ; preds = %8
%12 = add i32 %6, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %11, %1
ret void
}
int exists_3_commas(char *buffer) {
  int count = 0;
  while (*buffer) {
    if (*buffer == ',')
      count++;
    buffer++;
  }
  return (count == 3);
}


x86 assembly (clang, -O0):
<exists_3_commas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <exists_3_commas+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1135 <exists_3_commas+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <exists_3_commas+0xf>
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists_3_commas>:
xor    %ecx,%ecx
jmp    1117 <exists_3_commas+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ecx
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2c,%al
je     1110 <exists_3_commas+0x10>
test   %al,%al
jne    1113 <exists_3_commas+0x13>
xor    %eax,%eax
cmp    $0x3,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @exists_3_commas(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i32 [ 0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 44, label %6
]
6: ; preds = %2
%7 = add nsw i32 %4, 1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
%12 = icmp eq i32 %4, 3
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ tests_mnt(int);
void tests_mount(void) { tests_mnt(1); }


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

x86 assembly (clang, -O2):
<tests_mount>:
mov    $0x1,%edi
jmp    1030 <tests_mnt@plt>

LLVM IR (-O0):
define void @tests_mount() {
%1 = call i32 @tests_mnt(i32 1)
ret void
}

LLVM IR (-O2):
define void @tests_mount() {
%1 = tail call i32 @tests_mnt(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
int tac_connect(int /*<<< orphan*/ *, int);
int tac_connect_single(u_long server) { return (tac_connect(&server, 1)); }


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

x86 assembly (clang, -O2):
<tac_connect_single>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <tac_connect@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @tac_connect_single(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @tac_connect(i32* %2, i32 1)
ret i32 %3
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int getpri() { return syscall(2, 0, 0); }


x86 assembly (clang, -O0):
<getpri>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpri>:
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getpri() {
%1 = call i32 @syscall(i32 2, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpri() {
%1 = tail call i32 @syscall(i32 2, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fz_luminosity_rgb(int *, int *, int *, int, int, int, int,
                                     int, int);
void fz_color_rgb(int *rr, int *rg, int *rb, int br, int bg, int bb, int sr,
                  int sg, int sb) {
  fz_luminosity_rgb(rr, rg, rb, sr, sg, sb, br, bg, bb);
}


x86 assembly (clang, -O0):
<fz_color_rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x10(%rbp),%ecx
mov    0x18(%rbp),%r8d
mov    0x20(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    -0x20(%rbp),%r10d
mov    -0x24(%rbp),%eax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <fz_luminosity_rgb@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_color_rgb>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %ecx,%r11d
mov    0x10(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x20(%rsp),%r9d
sub    $0x8,%rsp
push   %rax
push   %r10
push   %r11
call   1030 <fz_luminosity_rgb@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @fz_color_rgb(i32* %0, i32* %1, i32* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32* %0, i32** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32*, i32** %10
%20 = load i32*, i32** %11
%21 = load i32*, i32** %12
%22 = load i32, i32* %16
%23 = load i32, i32* %17
%24 = load i32, i32* %18
%25 = load i32, i32* %13
%26 = load i32, i32* %14
%27 = load i32, i32* %15
%28 = call i32 @fz_luminosity_rgb(i32* %19, i32* %20, i32* %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27)
ret void
}

LLVM IR (-O2):
define void @fz_color_rgb(i32* %0, i32* %1, i32* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = tail call i32 @fz_luminosity_rgb(i32* %0, i32* %1, i32* %2, i32 %6, i32 %7, i32 %8, i32 %3, i32 %4, i32 %5)
ret void
}
int IsWhitespace(const char c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}


x86 assembly (clang, -O0):
<IsWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <IsWhitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <IsWhitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <IsWhitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsWhitespace>:
cmp    $0x20,%dil
ja     1120 <IsWhitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <IsWhitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @IsWhitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @IsWhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int KAPI_ia64_GetAPIVersion_MINOR() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @KAPI_ia64_GetAPIVersion_MINOR() {
ret i32 0
}