xunge/DecIR huggingface dataset:
int max(int arr[]) {
  int m;
  int i = 0;
  int len = (sizeof(arr) / sizeof(int));
  for (i = 0; i < len; i++) {
    if (m > arr[i])
      m = m;
    else
      m = arr[i];
    i++;
    arr++;
  }
  return m;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1179 <max+0x79>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1148 <max+0x48>
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <max+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <max+0x1d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ perror(char *);
int xyz_sock_accept(int sockfd) {
  struct sockaddr sa;
  socklen_t len;
  int conn;
  len = sizeof(sa);
  conn = accept(sockfd, &sa, &len);
  if (conn == -1) {
    perror("accept() error");
  }
  return conn;
}


x86 assembly (clang, -O0):
<xyz_sock_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    115b <xyz_sock_accept+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <perror@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz_sock_accept>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <accept@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     114b <xyz_sock_accept+0x2b>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xeae(%rip),%rdi
call   1030 <perror@plt>
jmp    1143 <xyz_sock_accept+0x23>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [15 x i8] c"accept() error\00"
define i32 @xyz_sock_accept(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%6 = load i32, i32* %2
%7 = call i32 @accept(i32 %6, %struct.sockaddr* %3, i32* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [15 x i8] c"accept() error\00"
define i32 @xyz_sock_accept(i32 %0) {
%2 = alloca %struct.sockaddr
%3 = alloca i32
%4 = bitcast %struct.sockaddr* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = call i32 @accept(i32 %0, %struct.sockaddr* %2, i32* %3)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
void medianArray(char string[]) {
  int length = strlen(string);
  int middle = length / 2;
  printf("[SortA] MEDIAN = %d \n", string[middle] - 48);
  printf("\n");
}


x86 assembly (clang, -O0):
<medianArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
sub    $0x30,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<medianArray>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
movsbl (%rbx,%rax,1),%esi
add    $0xffffffd0,%esi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"[SortA] MEDIAN = %d \0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @medianArray(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 2
store i32 %8, i32* %4
%9 = load i8*, i8** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"[SortA] MEDIAN = %d \0A\00"
define void @medianArray(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sdiv i32 %2, 2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, -48
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void start_b2(void) { printf("start_b2\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"start_b2\0A\00"
define void @start_b2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"start_b2\00"
define void @start_b2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void fail(const char *msg) {
  fputs(msg, stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int seq_utils_bits_to_count(int bits) {
  int i;
  int temp = bits;
  for (i = 0; i < 32; i++) {
    if (temp & 0x01) {
      return i;
    }
    temp = temp >> 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<seq_utils_bits_to_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    114f <seq_utils_bits_to_count+0x4f>
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1138 <seq_utils_bits_to_count+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <seq_utils_bits_to_count+0x56>
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <seq_utils_bits_to_count+0x14>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_utils_bits_to_count>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   $0x1,%dil
jne    113c <seq_utils_bits_to_count+0x3c>
test   $0x2,%dil
jne    1139 <seq_utils_bits_to_count+0x39>
test   $0x4,%dil
jne    113d <seq_utils_bits_to_count+0x3d>
test   $0x8,%dil
jne    1141 <seq_utils_bits_to_count+0x41>
sar    $0x4,%edi
add    $0x4,%eax
cmp    $0x20,%eax
jne    1110 <seq_utils_bits_to_count+0x10>
mov    $0xffffffff,%eax
ret
add    $0x1,%eax
ret
add    $0x2,%eax
ret
add    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @seq_utils_bits_to_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %5
store i32 0, i32* %4
br label %7
7: ; preds = %19, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* %5
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %23
16: ; preds = %10
%17 = load i32, i32* %5
%18 = ashr i32 %17, 1
store i32 %18, i32* %5
br label %19
19: ; preds = %16
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %7
22: ; preds = %7
store i32 -1, i32* %2
br label %23
23: ; preds = %22, %14
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @seq_utils_bits_to_count(i32 %0) {
br label %2
2: ; preds = %16, %1
%3 = phi i32 [ %0, %1 ], [ %17, %16 ]
%4 = phi i32 [ 0, %1 ], [ %18, %16 ]
%5 = and i32 %3, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %26
7: ; preds = %2
%8 = and i32 %3, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = and i32 %3, 4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = and i32 %3, 8
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = ashr i32 %3, 4
%18 = add nuw nsw i32 %4, 4
%19 = icmp eq i32 %18, 32
br i1 %19, label %26, label %2
20: ; preds = %13
%21 = or i32 %4, 3
br label %26
22: ; preds = %10
%23 = or i32 %4, 2
br label %26
24: ; preds = %7
%25 = or i32 %4, 1
br label %26
26: ; preds = %2, %16, %24, %22, %20
%27 = phi i32 [ %21, %20 ], [ %23, %22 ], [ %25, %24 ], [ -1, %16 ], [ %4, %2 ]
ret i32 %27
}
int security_task_alloc(struct task_struct *p) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @security_task_alloc(%struct.task_struct* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *result = malloc(size);
  assert(size == 0 || result != NULL);
  return result;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1154 <safe_malloc+0x34>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
sete   %al
test   %r14,%r14
setne  %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i64 %0, 0
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ error0(char *, char *);
void ac_civ(int v, char *vv) {
  if (!v) {
    error0("Check Assertion Violated.", vv);
  }
}


x86 assembly (clang, -O0):
<ac_civ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1139 <ac_civ+0x29>
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <error0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ac_civ>:
test   %edi,%edi
je     1115 <ac_civ+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <error0@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Check Assertion Violated.\00"
define void @ac_civ(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @error0(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Check Assertion Violated.\00"
define void @ac_civ(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @error0(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ USE(int *);
__attribute__((no)) void FUNC0() {
  int x[4];
  USE(&x[0]);
}


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

x86 assembly (clang, -O2):
<FUNC0>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <USE@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @FUNC0() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = call i32 @USE(i32* %2)
ret void
}

LLVM IR (-O2):
define void @FUNC0() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @USE(i32* %3)
ret void
}
long gcd(long a, long b) {
  long c;
  while (1) {
    c = a % b;
    if (c == 0)
      return b;
    a = b;
    b = c;
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    112b <gcd+0x2b>
mov    -0x10(%rbp),%rax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rdx
mov    %rdi,%rax
jmp    111d <gcd+0x1d>
nopl   0x0(%rax,%rax,1)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %1, %2 ], [ %6, %3 ]
%5 = phi i64 [ %0, %2 ], [ %4, %3 ]
%6 = srem i64 %5, %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i64 %4
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ datestring;

/* Variables and functions */
int /*<<< orphan*/ D_T_FMT;
int /*<<< orphan*/ nl_langinfo(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, int /*<<< orphan*/, struct tm *);
void date_print(struct tm *time) {
  char datestring[256];
  strftime(datestring, sizeof(datestring), nl_langinfo(D_T_FMT), time);
  printf("%s\n", datestring);
}


x86 assembly (clang, -O0):
<date_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <nl_langinfo@plt>
mov    -0x118(%rbp),%rdi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    $0x100,%esi
call   1050 <strftime@plt>
lea    -0x110(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_print>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <nl_langinfo@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
mov    %eax,%edx
mov    %rbx,%rcx
call   1050 <strftime@plt>
lea    0xe99(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@D_T_FMT = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @date_print(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca [256 x i8]
store %struct.tm* %0, %struct.tm** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @D_T_FMT
%6 = call i32 @nl_langinfo(i32 %5)
%7 = load %struct.tm*, %struct.tm** %2
%8 = call i32 @strftime(i8* %4, i32 256, i32 %6, %struct.tm* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@D_T_FMT = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @date_print(%struct.tm* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @D_T_FMT
%5 = tail call i32 @nl_langinfo(i32 %4)
%6 = call i32 @strftime(i8* %3, i32 256, i32 %5, %struct.tm* %0)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
struct flow {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ file_new(char const *, int /*<<< orphan*/, struct flow *,
                            void *);
void file_read_new(const char *path, struct flow *flow, void *passthrough) {
  file_new(path, O_RDONLY, flow, passthrough);
}


x86 assembly (clang, -O0):
<file_read_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <file_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_read_new>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ecb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <file_new@plt>

LLVM IR (-O0):
%struct.flow = type { i32 }
@O_RDONLY = global i32 0
define void @file_read_new(i8* %0, %struct.flow* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.flow*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.flow* %1, %struct.flow** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* @O_RDONLY
%9 = load %struct.flow*, %struct.flow** %5
%10 = load i8*, i8** %6
%11 = call i32 @file_new(i8* %7, i32 %8, %struct.flow* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.flow = type { i32 }
@O_RDONLY = global i32 0
define void @file_read_new(i8* %0, %struct.flow* %1, i8* %2) {
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @file_new(i8* %0, i32 %4, %struct.flow* %1, i8* %2)
ret void
}
/* Variables and functions */
int M_PI;
double Rad2Deg(const double rad) { return rad * (180 / M_PI); }


x86 assembly (clang, -O0):
<Rad2Deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0xb4,%eax
mov    0x2ece(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rad2Deg>:
mov    0x2ee1(%rip),%rcx
mov    $0xb4,%eax
xor    %edx,%edx
idivl  (%rcx)
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @Rad2Deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 180, %4
%6 = sitofp i32 %5 to double
%7 = fmul double %3, %6
ret double %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @Rad2Deg(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 180, %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ __set_bit_le(int, void *);
void *mb_correct_addr_and_bit(int *, void *);
__attribute__((always_)) __attribute__((no_instrument_function)) void
mb_set_bit(int bit, void *addr) {
  addr = mb_correct_addr_and_bit(&bit, addr);
  __set_bit_le(bit, addr);
}


x86 assembly (clang, -O0):
<mb_set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
call   1040 <mb_correct_addr_and_bit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <__set_bit_le@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_set_bit>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <mb_correct_addr_and_bit@plt>
mov    0x4(%rsp),%edi
mov    %rax,%rsi
call   1030 <__set_bit_le@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @mb_set_bit(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %1)
%5 = load i32, i32* %3
%6 = call i32 @__set_bit_le(i32 %5, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbg_break();
void gdb_arch_continue(void) { dbg_break(); }


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

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

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

LLVM IR (-O2):
define void @gdb_arch_continue() {
%1 = tail call i32 (...) @dbg_break()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *mx_strskipwhitespaces(char *str) {
  char *s;
  assert(str);
  for (s = str; *s && *s == ' '; s++)
    ;
  return s;
}


x86 assembly (clang, -O0):
<mx_strskipwhitespaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1152 <mx_strskipwhitespaces+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1162 <mx_strskipwhitespaces+0x52>
jmp    1178 <mx_strskipwhitespaces+0x68>
jmp    1167 <mx_strskipwhitespaces+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112d <mx_strskipwhitespaces+0x1d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_strskipwhitespaces>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
add    $0xffffffffffffffff,%rbx
nopl   (%rax)
cmpb   $0x20,0x1(%rbx)
lea    0x1(%rbx),%rbx
je     1120 <mx_strskipwhitespaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @stopWalking() {
ret void
}
/* Variables and functions */
void *aalloc(size_t, size_t);
int posix_memalign(void **ptr, size_t align, size_t size) {
  if (!ptr)
    return 1;
  *ptr = aalloc(size, align);
  if (!*ptr)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<posix_memalign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113b <posix_memalign+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1173 <posix_memalign+0x63>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <aalloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    116c <posix_memalign+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <posix_memalign+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_memalign>:
test   %rdi,%rdi
je     1131 <posix_memalign+0x21>
push   %rbx
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <aalloc@plt>
mov    %rax,%rcx
mov    %rax,(%rbx)
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @posix_memalign(i8** writeonly %0, i64 %1, i64 %2) {
%4 = icmp eq i8** %0, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i8* @aalloc(i64 %2, i64 %1)
store i8* %6, i8** %0
%7 = icmp eq i8* %6, null
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ 1, %3 ], [ %8, %5 ]
ret i32 %10
}
void testExpression() {
  float a = 0.0f;
  float b = 222222222222L + a;
  float g = 22222222 + 22222222;
  float c = 22222222 + 22222223;
  int i = 0;
  float d = i + a;
  double e = 0.0;
  double f = i + e;
}


x86 assembly (clang, -O0):
<testExpression>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xef0(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testExpression() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca float
%7 = alloca double
%8 = alloca double
store float 0.000000e+00, float* %1
%9 = load float, float* %1
%10 = fadd float 0x4249DEBD00000000, %9
store float %10, float* %2
store float 0x41853158E0000000, float* %3
store float 0x41853158E0000000, float* %4
store i32 0, i32* %5
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to float
%13 = load float, float* %1
%14 = fadd float %12, %13
store float %14, float* %6
store double 0.000000e+00, double* %7
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to double
%17 = load double, double* %7
%18 = fadd double %16, %17
store double %18, double* %8
ret void
}

LLVM IR (-O2):
define void @testExpression() {
ret void
}
__attribute__((always_)) int clamp2047(int x) {
  if (x < 0)
    return 0;
  if (x > 2047)
    return 2047;
  return x;
}


x86 assembly (clang, -O0):
<clamp2047>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <clamp2047+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <clamp2047+0x3c>
cmpl   $0x7ff,-0x8(%rbp)
jle    1136 <clamp2047+0x36>
movl   $0x7ff,-0x4(%rbp)
jmp    113c <clamp2047+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp2047>:
cmp    $0x7ff,%edi
mov    $0x7ff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp2047(i32 %0) {
%2 = icmp slt i32 %0, 2047
%3 = select i1 %2, i32 %0, i32 2047
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
double compute_actual_reduction(double fnorm, double fnorm1) {
  double actred;
  if (0.1 * fnorm1 < fnorm) {
    double u = fnorm1 / fnorm;
    actred = 1 - u * u;
  } else {
    actred = -1;
  }
  return actred;
}


x86 assembly (clang, -O0):
<compute_actual_reduction>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1174 <compute_actual_reduction+0x74>
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeaa(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1181 <compute_actual_reduction+0x81>
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_actual_reduction>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
jbe    1127 <compute_actual_reduction+0x27>
divsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm1,%xmm0
ret
movsd  0xed9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @compute_actual_reduction(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = fmul double 1.000000e-01, %7
%9 = load double, double* %3
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fdiv double %12, %13
store double %14, double* %6
%15 = load double, double* %6
%16 = load double, double* %6
%17 = fneg double %15
%18 = call double @llvm.fmuladd.f64(double %17, double %16, double 1.000000e+00)
store double %18, double* %5
br label %20
19: ; preds = %2
store double -1.000000e+00, double* %5
br label %20
20: ; preds = %19, %11
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
define double @compute_actual_reduction(double %0, double %1) {
%3 = fmul double %1, 1.000000e-01
%4 = fcmp olt double %3, %0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = fdiv double %1, %0
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
br label %9
9: ; preds = %2, %5
%10 = phi double [ %8, %5 ], [ -1.000000e+00, %2 ]
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void SystraceAsyncEnd(const char *name, const int32_t cookie) {
  (void)name;
  (void)cookie;
}


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

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

LLVM IR (-O0):
define void @SystraceAsyncEnd(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
ret void
}

LLVM IR (-O2):
define void @SystraceAsyncEnd(i8* nocapture %0, i32 %1) {
ret void
}
unsigned xrop3_127_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_127_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_127_0_0>:
mov    %edi,%eax
and    %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_127_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_127_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %1, %0
%4 = zext i8 %3 to i32
%5 = xor i32 %4, -1
ret i32 %5
}
/* Variables and functions */
char const *VThreadBase_CurName();
const char *VThread_CurName(void) { return VThreadBase_CurName(); }


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

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

LLVM IR (-O0):
define i8* @VThread_CurName() {
%1 = call i8* (...) @VThreadBase_CurName()
ret i8* %1
}

LLVM IR (-O2):
define i8* @VThread_CurName() {
%1 = tail call i8* (...) @VThreadBase_CurName()
ret i8* %1
}
/* Variables and functions */
float equationStep3(float, float, float);
float xyz2Step3(float x, float y, float z) {
  return equationStep3(x, y, z) - equationStep3(0, 0, 0);
}


x86 assembly (clang, -O0):
<xyz2Step3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <equationStep3@plt>
movss  %xmm0,-0x10(%rbp)
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <equationStep3@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz2Step3>:
push   %rax
call   1030 <equationStep3@plt>
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <equationStep3@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xyz2Step3(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @equationStep3(float %7, float %8, float %9)
%11 = call float @equationStep3(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%12 = fsub float %10, %11
ret float %12
}

LLVM IR (-O2):
define float @xyz2Step3(float %0, float %1, float %2) {
%4 = tail call float @equationStep3(float %0, float %1, float %2)
%5 = tail call float @equationStep3(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%6 = fsub float %4, %5
ret float %6
}
/* Variables and functions */
int id2(int);
int id(int x) {
  if (x == 0)
    return 0;
  int ret = id2(x - 1) + 1;
  if (ret > 2)
    return 2;
  return ret;
}


x86 assembly (clang, -O0):
<id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <id+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115e <id+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <id2@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    1158 <id+0x48>
movl   $0x2,-0x4(%rbp)
jmp    115e <id+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id>:
test   %edi,%edi
je     1130 <id+0x20>
push   %rax
add    $0xffffffff,%edi
call   1030 <id2@plt>
lea    0x1(%rax),%ecx
cmp    $0x2,%eax
mov    $0x2,%eax
cmovl  %ecx,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @id(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %18
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @id2(i32 %10)
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %8
store i32 2, i32* %2
br label %18
16: ; preds = %8
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %15, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @id(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @id2(i32 %4)
%6 = add nsw i32 %5, 1
%7 = icmp slt i32 %5, 2
%8 = select i1 %7, i32 %6, i32 2
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 0, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htole32(int /*<<< orphan*/);
void writel(uint32_t v, void *a) {
  uint32_t *p = a;
  *p = htole32(v);
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htole32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
push   %rbx
mov    %rsi,%rbx
call   1030 <htole32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @writel(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @htole32(i32 %0)
store i32 %4, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dg_debugfs_init(int);
void l_dg_init(void) { dg_debugfs_init(1); }


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

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

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

LLVM IR (-O2):
define void @l_dg_init() {
%1 = tail call i32 @dg_debugfs_init(i32 1)
ret void
}
/* Type definitions */
struct const_Intrusive_List {
  int dummy;
};
struct Intrusive_List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destructor_IL_base(struct Intrusive_List *);
void destructor_const_IL_base(const struct const_Intrusive_List *lst) {
  destructor_IL_base((struct Intrusive_List *)lst);
}


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

x86 assembly (clang, -O2):
<destructor_const_IL_base>:
jmp    1030 <destructor_IL_base@plt>

LLVM IR (-O0):
%struct.const_Intrusive_List = type { i32 }
%struct.Intrusive_List = type { i32 }
define void @destructor_const_IL_base(%struct.const_Intrusive_List* %0) {
%2 = alloca %struct.const_Intrusive_List*
store %struct.const_Intrusive_List* %0, %struct.const_Intrusive_List** %2
%3 = load %struct.const_Intrusive_List*, %struct.const_Intrusive_List** %2
%4 = bitcast %struct.const_Intrusive_List* %3 to %struct.Intrusive_List*
%5 = call i32 @destructor_IL_base(%struct.Intrusive_List* %4)
ret void
}

LLVM IR (-O2):
%struct.const_Intrusive_List = type { i32 }
%struct.Intrusive_List = type { i32 }
define void @destructor_const_IL_base(%struct.const_Intrusive_List* %0) {
%2 = bitcast %struct.const_Intrusive_List* %0 to %struct.Intrusive_List*
%3 = tail call i32 @destructor_IL_base(%struct.Intrusive_List* %2)
ret void
}
int main(void) {
  int a[5], i;
  for (i = 0; i < 5; i++) {
    printf("Direccion de a[%d]: %u\n", i, &a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    115e <main+0x4e>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xee4(%rip),%rbx
mov    %rsp,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Direccion de a[%d]: %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8, i32* %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Direccion de a[%d]: %u\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0, i32* %3)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32* %5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2, i32* %7)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 3, i32* %9)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4, i32* %11)
ret i32 0
}
void irq_get_status() {}


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

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

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

LLVM IR (-O2):
define void @irq_get_status() {
ret void
}