xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void WatchdogEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogEnable>:
movslq %edi,%rax
orl    $0x1,0x8(%rax)
ret

LLVM IR (-O0):
define void @WatchdogEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 8
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @WatchdogEnable(i32 %0) {
%2 = add nsw i32 %0, 8
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("vlan options:\n"
         "--vlan-id [!] id       : vlan-tagged frame identifier, 0,1-4096 "
         "(integer)\n"
         "--vlan-prio [!] prio   : Priority-tagged frame's user priority, 0-7 "
         "(integer)\n"
         "--vlan-encap [!] encap : Encapsulated frame protocol (hexadecimal or "
         "name)\n");
}


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

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

LLVM IR (-O0):
@.str = [242 x i8] c"vlan options:\0A--vlan-id [!] id : vlan-tagged frame identifier, 0,1-4096 (integer)\0A--vlan-prio [!] prio : Priority-tagged frame's user priority, 0-7 (integer)\0A--vlan-encap [!] encap : Encapsulated frame protocol (hexadecimal or name)\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [241 x i8] c"vlan options:\0A--vlan-id [!] id : vlan-tagged frame identifier, 0,1-4096 (integer)\0A--vlan-prio [!] prio : Priority-tagged frame's user priority, 0-7 (integer)\0A--vlan-encap [!] encap : Encapsulated frame protocol (hexadecimal or name)\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([241 x i8], [241 x i8]* @str, i64 0, i64 0))
ret void
}
int updateI8k(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @updateI8k() {
ret i32 0
}
void cprop_result14(int *data) {
  int j = data[0];
  int m = data[1];
  if (data[2])
    data[3] = 60 + j + m;
  else
    data[0] = 10 * (j - 20 * (m - 30));
}


x86 assembly (clang, -O0):
<cprop_result14>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x8(%rax)
je     113e <cprop_result14+0x3e>
mov    -0xc(%rbp),%ecx
add    $0x3c,%ecx
add    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
jmp    1155 <cprop_result14+0x55>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1e,%ecx
imul   $0x14,%ecx,%ecx
sub    %ecx,%eax
imul   $0xa,%eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_result14>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
cmpl   $0x0,0x8(%rdi)
je     1114 <cprop_result14+0x14>
add    %ecx,%eax
add    $0x3c,%eax
mov    %eax,0xc(%rdi)
ret
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
lea    (%rax,%rax,4),%eax
add    %eax,%eax
add    $0x1770,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_result14(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = add nsw i32 %2, 60
%10 = add nsw i32 %9, %4
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
br label %17
12: ; preds = %1
%13 = mul i32 %4, -20
%14 = add i32 %2, 600
%15 = add i32 %14, %13
%16 = mul nsw i32 %15, 10
store i32 %16, i32* %0
br label %17
17: ; preds = %12, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rSpace(char *);
int main() {
  char frase2[200] = "minha   frase com   algums     espaços";
  rSpace(frase2);
  printf("%s\n", frase2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    -0xd0(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0xc8,%edx
call   1040 <memcpy@plt>
lea    -0xd0(%rbp),%rdi
call   1050 <rSpace@plt>
lea    -0xd0(%rbp),%rsi
lea    0xf5b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    $0xc8,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1050 <rSpace@plt>
lea    0xf6a(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.frase2 = [200 x i8] c"minha frase com algums espa\C3\A7os\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = bitcast [200 x i8]* %1 to i8*
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%4 = call i32 @rSpace(i8* %3)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.frase2 = [200 x i8] c"minha frase com algums espa\C3\A7os\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @rSpace(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int time_before(unsigned long, unsigned long);
int cfs_time_after(unsigned long t1, unsigned long t2) {
  return time_before(t2, t1);
}


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

x86 assembly (clang, -O2):
<cfs_time_after>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <time_before@plt>

LLVM IR (-O0):
define i32 @cfs_time_after(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = call i32 @time_before(i64 %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cfs_time_after(i64 %0, i64 %1) {
%3 = tail call i32 @time_before(i64 %1, i64 %0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ basename(char *);
int /*<<< orphan*/ fwrite(int /*<<< orphan*/, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int write_name(FILE *target, char *filename) {
  char buffer[128] = {0};
  strncpy(buffer, filename, sizeof(buffer));
  fwrite(basename(buffer), sizeof(buffer), 1, target);
}


x86 assembly (clang, -O0):
<write_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x80,%edx
call   1030 <strncpy@plt>
lea    -0xa0(%rbp),%rdi
call   1050 <basename@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rcx
mov    $0x80,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_name>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
call   1040 <basename@plt>
mov    %eax,%edi
mov    $0x80,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @write_name(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca [128 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
%7 = bitcast [128 x i8]* %6 to i8*
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 128)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%12 = call i32 @basename(i8* %11)
%13 = load i32*, i32** %4
%14 = call i32 @fwrite(i32 %12, i32 128, i32 1, i32* %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @write_name(i32* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %1, i32 128)
%6 = call i32 @basename(i8* %4)
%7 = call i32 @fwrite(i32 %6, i32 128, i32 1, i32* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  struct A {
    int i, j, k;
  } x = {
      .i = 5,
      .j = 2,
      x.k = 3,
  };
  if (x.i != 5 || x.j != 2 || x.k != 3)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x5,-0x10(%rbp)
jne    1159 <main+0x49>
cmpl   $0x2,-0xc(%rbp)
jne    1159 <main+0x49>
cmpl   $0x3,-0x8(%rbp)
je     1160 <main+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i32, i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.A
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 0
store i32 5, i32* %3
%4 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 1
store i32 2, i32* %4
%5 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 2
%6 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 2
store i32 3, i32* %6
store i32 3, i32* %5
%7 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 5
br i1 %9, label %18, label %10
10: ; preds = %0
%11 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 1
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 2
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 2
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 3
br i1 %17, label %18, label %20
18: ; preds = %14, %10, %0
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void PrintHelloFile2(void) { fprintf(stderr, "Hello from file2!\n"); }


x86 assembly (clang, -O0):
<PrintHelloFile2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHelloFile2>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Hello from file2!\0A\00"
define void @PrintHelloFile2() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Hello from file2!\0A\00"
define void @PrintHelloFile2() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int funcaoH(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Valor retornado pela funcao H quando m=5 e n=8 eh: %d ",
         funcaoH(5, 8));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x8,%esi
call   1030 <funcaoH@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Valor retornado pela funcao H quando m=5 e n=8 eh: %d \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @funcaoH(i32 5, i32 8)
%3 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"Valor retornado pela funcao H quando m=5 e n=8 eh: %d \00"
define i32 @main() {
%1 = tail call i32 @funcaoH(i32 5, i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int default_tas_instr_callback(void) { return 1; }


x86 assembly (clang, -O0):
<default_tas_instr_callback>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @default_tas_instr_callback() {
ret i32 1
}

LLVM IR (-O2):
define i32 @default_tas_instr_callback() {
ret i32 1
}
int irc_islower(int c) { return (c >= 'a' && c <= 'z'); }


x86 assembly (clang, -O0):
<irc_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <irc_islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @irc_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @irc_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t CRYPTODmaStatus(void) {
  return ((*((volatile unsigned long *)(0x40024000 + 0x00000018))));
}


x86 assembly (clang, -O0):
<CRYPTODmaStatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40024018,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTODmaStatus>:
mov    0x40024018,%rax
40
ret

LLVM IR (-O0):
define i64 @CRYPTODmaStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1073889304 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @CRYPTODmaStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1073889304 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_ones_complement(int i) { __emit_expression_range(0, ~i); }


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

x86 assembly (clang, -O2):
<test_ones_complement>:
mov    %edi,%esi
not    %esi
xor    %edi,%edi
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_ones_complement(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = call i32 @__emit_expression_range(i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
define void @test_ones_complement(i32 %0) {
%2 = xor i32 %0, -1
%3 = tail call i32 @__emit_expression_range(i32 0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, char const *,
                           char const *);
void debug(FILE *fp, const char *location, const char *msg, int sec, int step) {
  fprintf(fp, "(wt=%d,ms=%d) Executing %s: %s\n", sec, step, location, msg);
}


x86 assembly (clang, -O0):
<debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug>:
mov    %rdx,%r9
mov    %rsi,%rax
lea    0xee3(%rip),%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %rax,%r8
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"(wt=%d,ms=%d) Executing %s: %s\0A\00"
define void @debug(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %9
%13 = load i32, i32* %10
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"(wt=%d,ms=%d) Executing %s: %s\0A\00"
define void @debug(i32* nocapture %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i8* %1, i8* %2)
ret void
}
/* Type definitions */
typedef int int64_t;

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


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

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @cfs_stub_listxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
size_t fwrite(void *, int, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int stdout_putchar(void *ctx, size_t count, void *c) {
  return (fwrite(c, 1, count, stdout) != count);
}


x86 assembly (clang, -O0):
<stdout_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fwrite@plt>
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_putchar>:
push   %rbx
mov    %rdx,%rdi
mov    %rsi,%rbx
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    %rbx,%rdx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @stdout_putchar(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i64, i64* %5
%9 = load i32, i32* @stdout
%10 = call i64 @fwrite(i8* %7, i32 1, i64 %8, i32 %9)
%11 = load i64, i64* %5
%12 = icmp ne i64 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @stdout_putchar(i8* nocapture readnone %0, i64 %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = tail call i64 @fwrite(i8* %2, i32 1, i64 %1, i32 %4)
%6 = icmp ne i64 %5, %1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: %s <threadcount> <count> <program> [<arg1> [<arg2> ...]]\n",
          getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: %s <threadcount> <count> <program> [<arg1> [<arg2> ...]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: %s <threadcount> <count> <program> [<arg1> [<arg2> ...]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ MaxHeapify(int *, int);
int fact(int);
int length(int *);
void MaxHeap(int A[]) {
  int b;
  int heap_size;
  heap_size = length(A);
  for (b = fact(heap_size / 2); b < 1; b--) {
    MaxHeapify(A, b);
  }
}


x86 assembly (clang, -O0):
<MaxHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <length@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <fact@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1181 <MaxHeap+0x51>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <MaxHeapify@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    115d <MaxHeap+0x2d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaxHeap>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <length@plt>
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
call   1040 <fact@plt>
test   %eax,%eax
jle    1154 <MaxHeap+0x24>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <MaxHeapify@plt>
add    $0xffffffff,%ebp
jmp    1160 <MaxHeap+0x30>

LLVM IR (-O0):
define void @MaxHeap(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @length(i32* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 2
%9 = call i32 @fact(i32 %8)
store i32 %9, i32* %3
br label %10
10: ; preds = %17, %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32*, i32** %2
%15 = load i32, i32* %3
%16 = call i32 @MaxHeapify(i32* %14, i32 %15)
br label %17
17: ; preds = %13
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -1
store i32 %19, i32* %3
br label %10
20: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @MaxHeap(i32* %0) {
%2 = tail call i32 @length(i32* %0)
%3 = sdiv i32 %2, 2
%4 = tail call i32 @fact(i32 %3)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %4, %1 ]
%8 = tail call i32 @MaxHeapify(i32* %0, i32 %7)
%9 = add nsw i32 %7, -1
br label %6
10: ; preds = %1
ret void
}
struct WorldCoor *wcsninitn(hstring, lhstring, name) const char *hstring;
int lhstring;
const char *name;
{
  hlength(hstring, lhstring);
  return (wcsinitn(hstring, name));
}


x86 assembly (clang, -O0):
<wcsninitn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <hlength@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <wcsinitn@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsninitn>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <hlength@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <wcsinitn@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.WorldCoor = type opaque
define %struct.WorldCoor* @wcsninitn(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @hlength to i32 (i8*, i32, ...)*)(i8* %7, i32 %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wcsinitn to i32 (i8*, i8*, ...)*)(i8* %10, i8* %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to %struct.WorldCoor*
ret %struct.WorldCoor* %14
}

LLVM IR (-O2):
%struct.WorldCoor = type opaque
define %struct.WorldCoor* @wcsninitn(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @hlength to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wcsinitn to i32 (i8*, i8*, ...)*)(i8* %0, i8* %2)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.WorldCoor*
ret %struct.WorldCoor* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error_minor(char *msg) {
  printf("%s\n", msg);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @error_minor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error_minor(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
int /*<<< orphan*/ set_bios_reset();
void soft_reset(void) {
  set_bios_reset();
  outb(0x02, 0x0cf9);
  outb(0x06, 0x0cf9);
}


x86 assembly (clang, -O0):
<soft_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <set_bios_reset@plt>
mov    $0x2,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
mov    $0x6,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_reset>:
push   %rax
xor    %eax,%eax
call   1040 <set_bios_reset@plt>
mov    $0x2,%edi
mov    $0xcf9,%esi
call   1030 <outb@plt>
mov    $0x6,%edi
mov    $0xcf9,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @soft_reset() {
%1 = call i32 (...) @set_bios_reset()
%2 = call i32 @outb(i32 2, i32 3321)
%3 = call i32 @outb(i32 6, i32 3321)
ret void
}

LLVM IR (-O2):
define void @soft_reset() {
%1 = tail call i32 (...) @set_bios_reset()
%2 = tail call i32 @outb(i32 2, i32 3321)
%3 = tail call i32 @outb(i32 6, i32 3321)
ret void
}
int pointerSize() {
  double *ptrArray[10];
  double **ptrPtr1;
  double **ptrPtr2;
  ptrPtr1 = ptrArray;
  ptrPtr2 = ptrArray + 1;
  return (long)ptrPtr2 + (~(long)ptrPtr1 + 1);
}


x86 assembly (clang, -O0):
<pointerSize>:
push   %rbp
mov    %rsp,%rbp
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
add    $0x1,%rcx
add    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pointerSize() {
%1 = alloca [10 x double*]
%2 = alloca double**
%3 = alloca double**
%4 = getelementptr inbounds [10 x double*], [10 x double*]* %1, i64 0, i64 0
store double** %4, double*** %2
%5 = getelementptr inbounds [10 x double*], [10 x double*]* %1, i64 0, i64 0
%6 = getelementptr inbounds double*, double** %5, i64 1
store double** %6, double*** %3
%7 = load double**, double*** %3
%8 = ptrtoint double** %7 to i64
%9 = load double**, double*** %2
%10 = ptrtoint double** %9 to i64
%11 = xor i64 %10, -1
%12 = add nsw i64 %11, 1
%13 = add nsw i64 %8, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @pointerSize() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int **, int ***, int *, int **, int *);
int main() {
  int a[3] = {1, 2, 3};
  int *p = a;
  int **r = &p;
  int ***q = &r;
  printf("*q:%p q:%p *r:%p r:%p a:%p\n", *q, q, *r, r, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x20(%rbp),%r8
lea    -0x10(%rbp),%r9
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0x18(%rsp),%rcx
mov    %rcx,0x10(%rsp)
lea    0x10(%rsp),%rsi
mov    %rsi,0x8(%rsp)
lea    0xec7(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    %rsi,%r8
mov    %rcx,%r9
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [28 x i8] c"*q:%p q:%p *r:%p r:%p a:%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32*
%4 = alloca i32**
%5 = alloca i32***
store i32 0, i32* %1
%6 = bitcast [3 x i32]* %2 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32* %7, i32** %3
store i32** %3, i32*** %4
store i32*** %4, i32**** %5
%8 = load i32***, i32**** %5
%9 = load i32**, i32*** %8
%10 = load i32***, i32**** %5
%11 = load i32**, i32*** %4
%12 = load i32*, i32** %11
%13 = load i32**, i32*** %4
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32** %9, i32*** %10, i32* %12, i32** %13, i32* %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [28 x i8] c"*q:%p q:%p *r:%p r:%p a:%p\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i32*
%3 = alloca i32**
%4 = bitcast [3 x i32]* %1 to i8*
%5 = bitcast i32** %2 to i8*
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32* %6, i32** %2
%7 = bitcast i32*** %3 to i8*
store i32** %2, i32*** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32** %2, i32*** %3, i32* %6, i32** %2, i32* %6)
ret i32 0
}
__attribute__((no, noclone)) char *f6(char *p, int i) { return p - i; }


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %rdi,%rax
movslq %esi,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @f6(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = sub i64 0, %7
%9 = getelementptr inbounds i8, i8* %5, i64 %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @f6(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i64 0, %3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, ...);
int main(int argc, char **argv) {
  if (argc > 1) {
    printf("%s:%s\n", argv[0], argv[1]);
  } else {
    printf("%s\n", argv[0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1152 <main+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1167 <main+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea3(%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
mov    %rsi,%rax
mov    (%rsi),%rsi
cmp    $0x2,%edi
jl     1130 <main+0x20>
mov    0x8(%rax),%rdx
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    113e <main+0x2e>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%s\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %14)
br label %21
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %16, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%s\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = load i8*, i8** %1
br i1 %3, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %7)
br label %11
9: ; preds = %2
%10 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %11
11: ; preds = %9, %5
ret i32 0
}
int cmp(const void *a, const void *b) {
  unsigned int x, y;
  x = (unsigned int)a;
  y = (unsigned int)b;
  return y - x;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    %rsi,%rax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub i32 %6, %4
ret i32 %7
}
void dlm_create_debugfs_subroot(struct dlm_ctxt *dlm) {}


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

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

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

LLVM IR (-O2):
%struct.dlm_ctxt = type opaque
define void @dlm_create_debugfs_subroot(%struct.dlm_ctxt* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SensorSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void SensorSettingsUpdated() { UAVObjUpdated(SensorSettingsHandle()); }


x86 assembly (clang, -O0):
<SensorSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SensorSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <SensorSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @SensorSettingsUpdated() {
%1 = call i32 (...) @SensorSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SensorSettingsUpdated() {
%1 = tail call i32 (...) @SensorSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ munlock(void *, int);
void free_noswap(void *ptr, int size) {
  munlock(ptr, size);
  free(ptr);
}


x86 assembly (clang, -O0):
<free_noswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <munlock@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_noswap>:
push   %rbx
mov    %rdi,%rbx
call   1030 <munlock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>

LLVM IR (-O0):
define void @free_noswap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @munlock(i8* %5, i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @free_noswap(i8* %0, i32 %1) {
%3 = tail call i32 @munlock(i8* %0, i32 %1)
%4 = tail call i32 @free(i8* %0)
ret void
}
void I2SMasterClockSelect(unsigned long ulBase, unsigned long ulMClock) {
  unsigned long ulConfig;
  ;
  ;
  ulConfig = (*((volatile unsigned long *)(ulBase + 0x00000C00))) &
             ~(0x00000010 | 0x00000020);
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) = ulConfig | ulMClock;
}


x86 assembly (clang, -O0):
<I2SMasterClockSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rax
and    $0xffffffffffffffcf,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xc00(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SMasterClockSelect>:
mov    0xc00(%rdi),%rax
and    $0xffffffffffffffcf,%rax
or     %rsi,%rax
mov    %rax,0xc00(%rdi)
ret

LLVM IR (-O0):
define void @I2SMasterClockSelect(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 3072
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, -49
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = or i64 %11, %12
%14 = load i64, i64* %3
%15 = add i64 %14, 3072
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
ret void
}

LLVM IR (-O2):
define void @I2SMasterClockSelect(i64 %0, i64 %1) {
%3 = add i64 %0, 3072
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -49
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_write(int, char *, int);
int /*<<< orphan*/ write_int(unsigned int);
void write_ptr(void *p) {
  sys_write(1, "0x", 2);
  write_int((unsigned int)p);
}


x86 assembly (clang, -O0):
<write_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
lea    0xec8(%rip),%rsi
mov    $0x2,%edx
call   1040 <sys_write@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <write_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ptr>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1040 <sys_write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <write_int@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"0x\00"
define void @write_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sys_write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @write_int(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"0x\00"
define void @write_ptr(i8* %0) {
%2 = tail call i32 @sys_write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @write_int(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int setsockopt(int, int /*<<< orphan*/, int, int *, int);
int BMI_sockio_set_sockopt(int s, int optname, int val) {
  if (setsockopt(s, SOL_SOCKET, optname, &val, sizeof(val)) == -1)
    return (-1);
  else
    return (val);
}


x86 assembly (clang, -O0):
<BMI_sockio_set_sockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    1154 <BMI_sockio_set_sockopt+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <BMI_sockio_set_sockopt+0x4a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMI_sockio_set_sockopt>:
push   %rax
mov    %esi,%eax
mov    %edx,0x4(%rsp)
mov    0x2eca(%rip),%rcx
mov    (%rcx),%esi
lea    0x4(%rsp),%rcx
mov    %eax,%edx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     113b <BMI_sockio_set_sockopt+0x2b>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
define i32 @BMI_sockio_set_sockopt(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = load i32, i32* @SOL_SOCKET
%6 = call i32 @setsockopt(i32 %0, i32 %5, i32 %1, i32* %4, i32 4)
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* %4
%9 = select i1 %7, i32 -1, i32 %8
ret i32 %9
}
void powernv_set_nmmu_ptcr(unsigned long ptcr) {}


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

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

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

LLVM IR (-O2):
define void @powernv_set_nmmu_ptcr(i64 %0) {
ret void
}
int jOponente(int j) {
  if (j == 1) {
    return 2;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<jOponente>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <jOponente+0x1d>
movl   $0x2,-0x4(%rbp)
jmp    1124 <jOponente+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jOponente>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @jOponente(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 2, i32 1
ret i32 %3
}