xunge/DecIR huggingface dataset:
int power(int x, int n) {
  int y = 1;
  while (n > 0) {
    if (n % 2 != 0)
      y = y * x;
    x = x * x;
    n = n / 2;
  }
  return y;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1156 <power+0x56>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1139 <power+0x39>
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1111 <power+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %esi,%esi
jle    113a <power+0x3a>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
imul   %edi,%edi
shr    %edx
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <power+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %13, %4 ], [ %1, %2 ]
%7 = phi i32 [ %12, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul nsw i32 %10, %5
%12 = mul nsw i32 %7, %7
%13 = lshr i32 %6, 1
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ var_type_specifier();
void var_declaration() { var_type_specifier(); }


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

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

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

LLVM IR (-O2):
define void @var_declaration() {
%1 = tail call i32 (...) @var_type_specifier()
ret void
}
void w15(void *x, double y) { *(double *)(x + 32753) = y; }


x86 assembly (clang, -O0):
<w15>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x7ff1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w15>:
movsd  %xmm0,0x7ff1(%rdi)
ret

LLVM IR (-O0):
define void @w15(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32753
%8 = bitcast i8* %7 to double*
store double %5, double* %8
ret void
}

LLVM IR (-O2):
define void @w15(i8* nocapture writeonly %0, double %1) {
%3 = getelementptr i8, i8* %0, i64 32753
%4 = bitcast i8* %3 to double*
store double %1, double* %4
ret void
}
void reverse(int a[], int start, int end) {
  int temp;
  while (start < end) {
    temp = a[start];
    a[start] = a[end];
    a[end] = temp;
    start++;
    end--;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <reverse+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <reverse+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    112e <reverse+0x2e>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
mov    -0x4(%rdi,%rax,4),%edx
mov    (%rdi,%rcx,4),%esi
mov    %esi,-0x4(%rdi,%rax,4)
mov    %edx,(%rdi,%rcx,4)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 %9
%14 = load i32, i32* %13
store i32 %14, i32* %11
store i32 %12, i32* %13
%15 = add nsw i64 %10, 1
%16 = add nsw i64 %9, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ mtrand_init(unsigned int);
void mtrand_init_default() {
  struct timeval tv;
  (void)gettimeofday(&tv, NULL);
  mtrand_init((unsigned)tv.tv_sec ^ (unsigned)tv.tv_usec ^ (unsigned)getpid());
}


x86 assembly (clang, -O0):
<mtrand_init_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x14(%rbp),%edi
xor    %eax,%edi
call   1050 <mtrand_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtrand_init_default>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%ebx
xor    0x8(%rsp),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
xor    %eax,%ebx
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <mtrand_init@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @mtrand_init_default() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = xor i32 %5, %8
%10 = call i64 (...) @getpid()
%11 = trunc i64 %10 to i32
%12 = xor i32 %9, %11
%13 = call i32 @mtrand_init(i32 %12)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @mtrand_init_default() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = xor i64 %7, %5
%9 = tail call i64 (...) @getpid()
%10 = xor i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = tail call i32 @mtrand_init(i32 %11)
ret void
}
int execute_symlinkat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_symlinkat() {
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int bind(int, struct sockaddr const *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void std_bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) {
  if (bind(sockfd, my_addr, addrlen) == -1) {
    perror("bind");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bind@plt>
cmp    $0xffffffff,%eax
jne    1170 <std_bind+0x40>
lea    0xe9f(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_bind>:
push   %rax
call   1030 <bind@plt>
cmp    $0xffffffff,%eax
je     113d <std_bind+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [5 x i8] c"bind\00"
define void @std_bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
int from_hex(int c) {
  if ('a' <= c && c <= 'f')
    return c - 'a' + 10;
  else if ('A' <= c && c <= 'F')
    return c - 'A' + 10;
  else if ('0' <= c && c <= '9')
    return c - '0';
  else
    return -1;
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     1130 <from_hex+0x30>
cmpl   $0x66,-0x8(%rbp)
jg     1130 <from_hex+0x30>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <from_hex+0x86>
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     1159 <from_hex+0x59>
cmpl   $0x46,-0x8(%rbp)
jg     1159 <from_hex+0x59>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <from_hex+0x86>
mov    $0x30,%eax
cmp    -0x8(%rbp),%eax
jg     117f <from_hex+0x7f>
cmpl   $0x39,-0x8(%rbp)
jg     117f <from_hex+0x7f>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <from_hex+0x86>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x5,%ecx
ja     110e <from_hex+0xe>
add    $0xffffffa9,%eax
ret
lea    -0x41(%rax),%ecx
cmp    $0x5,%ecx
ja     111a <from_hex+0x1a>
add    $0xffffffc9,%eax
ret
add    $0xffffffd0,%eax
cmp    $0xa,%eax
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @from_hex(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %0, -87
br label %15
6: ; preds = %1
%7 = add i32 %0, -65
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = add nsw i32 %0, -55
br label %15
11: ; preds = %6
%12 = add i32 %0, -48
%13 = icmp ult i32 %12, 10
%14 = select i1 %13, i32 %12, i32 -1
br label %15
15: ; preds = %11, %9, %4
%16 = phi i32 [ %5, %4 ], [ %10, %9 ], [ %14, %11 ]
ret i32 %16
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int _inb(int);
int /*<<< orphan*/ _outb(int, int);
void stop_speaker() {
  uint8_t tmp = _inb(0x61);
  tmp = tmp | 252;
  _outb(tmp, 0x61);
}


x86 assembly (clang, -O0):
<stop_speaker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x61,%edi
call   1040 <_inb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0xfc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x61,%esi
call   1030 <_outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_speaker>:
push   %rax
mov    $0x61,%edi
call   1040 <_inb@plt>
or     $0xfc,%eax
mov    %eax,%edi
mov    $0x61,%esi
pop    %rax
jmp    1030 <_outb@plt>

LLVM IR (-O0):
define void @stop_speaker() {
%1 = alloca i32
%2 = call i32 @_inb(i32 97)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 252
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @_outb(i32 %5, i32 97)
ret void
}

LLVM IR (-O2):
define void @stop_speaker() {
%1 = tail call i32 @_inb(i32 97)
%2 = or i32 %1, 252
%3 = tail call i32 @_outb(i32 %2, i32 97)
ret void
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_readv;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, struct iovec const *, int);
__attribute__((always_)) ssize_t _syscall_readv(int fd, const struct iovec *iov,
                                                int iovcnt) {
  return syscall(__NR_readv, fd, iov, iovcnt);
}


x86 assembly (clang, -O0):
<_syscall_readv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_readv>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
@__NR_readv = global i32 0
define i32 @_syscall_readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_readv
%8 = load i32, i32* %4
%9 = load %struct.iovec*, %struct.iovec** %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, %struct.iovec* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
@__NR_readv = global i32 0
define i32 @_syscall_readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = load i32, i32* @__NR_readv
%5 = tail call i32 @syscall(i32 %4, i32 %0, %struct.iovec* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
float __builtin_arm_vcvtr_f(float, int /*<<< orphan*/);
float test_vcvtrf0(float f) { return __builtin_arm_vcvtr_f(f, 0); }


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

x86 assembly (clang, -O2):
<test_vcvtrf0>:
xor    %edi,%edi
jmp    1030 <__builtin_arm_vcvtr_f@plt>

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

LLVM IR (-O2):
define float @test_vcvtrf0(float %0) {
%2 = tail call float @__builtin_arm_vcvtr_f(float %0, i32 0)
ret float %2
}
void PDMR3QueryLun(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMR3QueryLun() {
ret void
}
unsigned addval_351(unsigned x) { return x + 3263295750U; }


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

x86 assembly (clang, -O2):
<addval_351>:
lea    -0x3d7e0efa(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_351(i32 %0) {
%2 = add i32 %0, -1031671546
ret i32 %2
}
void printchar(char n) {}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @printchar(i8 signext %0) {
ret void
}
/* Variables and functions */
int findSmallest(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, int);
main() {
  int a[] = {1, 3, 15, 11, 2};
  int b[] = {23, 127, 235, 19, 9, 200};
  int s;
  s = findSmallest(a, 5, b, 6);
  printf("smallest=%d\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xecc(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rdx
mov    $0x5,%esi
mov    $0x6,%ecx
call   1030 <findSmallest@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0xef0(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rdx
mov    $0x5,%esi
mov    $0x6,%ecx
call   1030 <findSmallest@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 1, i32 3, i32 15, i32 11, i32 2]
@__const.main.b = [6 x i32] [i32 23, i32 127, i32 235, i32 19, i32 9, i32 200]
@.str = [13 x i8] c"smallest=%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast [6 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%8 = call i32 @findSmallest(i32* %6, i32 5, i32* %7, i32 6)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 1, i32 3, i32 15, i32 11, i32 2]
@__const.main.b = [6 x i32] [i32 23, i32 127, i32 235, i32 19, i32 9, i32 200]
@.str = [13 x i8] c"smallest=%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32 @findSmallest(i32* %5, i32 5, i32* %6, i32 6)
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void ft_putendl_fd(char *str, int fd) {
  char endl;
  endl = '\n';
  write(fd, str, ft_strlen(str));
  write(fd, &endl, 1);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0xa,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movb   $0xa,0x7(%rsp)
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0x7(%rsp),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = alloca i8
store i8 10, i8* %3
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 %1, i8* %0, i32 %4)
%6 = call i32 @write(i32 %1, i8* %3, i32 1)
ret void
}
float sub8(float f, float g, long l) { return !l ? f : g; }


x86 assembly (clang, -O0):
<sub8>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112c <sub8+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1136 <sub8+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub8>:
test   %rdi,%rdi
je     1108 <sub8+0x8>
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sub8(float %0, float %1, i64 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i64
store float %0, float* %4
store float %1, float* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp ne i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = load float, float* %4
br label %13
11: ; preds = %3
%12 = load float, float* %5
br label %13
13: ; preds = %11, %9
%14 = phi float [ %10, %9 ], [ %12, %11 ]
ret float %14
}

LLVM IR (-O2):
define float @sub8(float %0, float %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = select i1 %4, float %0, float %1
ret float %5
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
unsigned int vector_index_of_sorted(struct vector *, void *);
void *vector_take_at(struct vector *, unsigned int);
void *vector_take_sorted(struct vector *__restrict vec, void *data) {
  unsigned int index;
  index = vector_index_of_sorted(vec, data);
  if (index == (unsigned int)-1)
    return NULL;
  return vector_take_at(vec, index);
}


x86 assembly (clang, -O0):
<vector_take_sorted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vector_index_of_sorted@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1157 <vector_take_sorted+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1167 <vector_take_sorted+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <vector_take_at@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_take_sorted>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vector_index_of_sorted@plt>
cmp    $0xffffffff,%eax
je     1139 <vector_take_sorted+0x19>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <vector_take_at@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vector = type { i32 }
define i8* @vector_take_sorted(%struct.vector* noalias %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.vector*
%5 = alloca i8*
%6 = alloca i32
store %struct.vector* %0, %struct.vector** %4
store i8* %1, i8** %5
%7 = load %struct.vector*, %struct.vector** %4
%8 = load i8*, i8** %5
%9 = call i32 @vector_index_of_sorted(%struct.vector* %7, i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %2
store i8* null, i8** %3
br label %17
13: ; preds = %2
%14 = load %struct.vector*, %struct.vector** %4
%15 = load i32, i32* %6
%16 = call i8* @vector_take_at(%struct.vector* %14, i32 %15)
store i8* %16, i8** %3
br label %17
17: ; preds = %13, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define i8* @vector_take_sorted(%struct.vector* noalias %0, i8* %1) {
%3 = tail call i32 @vector_index_of_sorted(%struct.vector* %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @vector_take_at(%struct.vector* %0, i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
/* Type definitions */
typedef char const uint8_t;

/* Variables and functions */
int memchar(const char *str, int len, uint8_t token) {
  const char *pstr = str;
  int tpos;
  for (tpos = 0; tpos < len; tpos++, pstr++)
    if (*pstr == token)
      break;
  return tpos;
}


x86 assembly (clang, -O0):
<memchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <memchar+0x62>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
jne    1143 <memchar+0x43>
jmp    1162 <memchar+0x62>
jmp    1148 <memchar+0x48>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111f <memchar+0x1f>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchar>:
test   %esi,%esi
jle    111e <memchar+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %dl,(%rdi,%rcx,1)
je     1121 <memchar+0x21>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <memchar+0x10>
ret
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @memchar(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %10
%6 = phi i32 [ %11, %10 ], [ 0, %3 ]
%7 = phi i8* [ %12, %10 ], [ %0, %3 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %2
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = add nuw nsw i32 %6, 1
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = icmp eq i32 %11, %1
br i1 %13, label %14, label %5
14: ; preds = %10, %5, %3
%15 = phi i32 [ 0, %3 ], [ %6, %5 ], [ %1, %10 ]
ret i32 %15
}
/* Variables and functions */
int sck_sendf(int, char *, char const *);
int irc_pong(int s, const char *data) {
  return sck_sendf(s, "PONG :%s\r\n", data);
}


x86 assembly (clang, -O0):
<irc_pong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <sck_sendf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_pong>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sck_sendf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"PONG :%s\0D\0A\00"
define i32 @irc_pong(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 = load i8*, i8** %4
%7 = call i32 @sck_sendf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"PONG :%s\0D\0A\00"
define i32 @irc_pong(i32 %0, i8* %1) {
%3 = tail call i32 @sck_sendf(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void ComparatorRefSet(uint32_t ui32Base, uint32_t ui32Ref) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) = ui32Ref;
}


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

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

LLVM IR (-O0):
define void @ComparatorRefSet(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 = add nsw i64 %6, 16
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @ComparatorRefSet(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 16
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s <-+=><flags> <file> [<file2> <file3 ...]\n",
          progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [52 x i8] c"Usage: %s <-+=><flags> <file> [<file2> <file3 ...]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [52 x i8] c"Usage: %s <-+=><flags> <file> [<file2> <file3 ...]\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ e_1_12();
int main(void) {
  e_1_12();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @e_1_12()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ SUB_HOST_REG_IMM(int, int /*<<< orphan*/);
int /*<<< orphan*/ addbyte(int);
int CMP_HOST_REG_IMM_L(int host_reg, uint32_t imm) {
  if (host_reg & 8) {
    addbyte(0x44);
    addbyte(0x89);
    addbyte(0xc0 | ((host_reg & 7) << 3) | 2);
    host_reg = 2;
  }
  SUB_HOST_REG_IMM(host_reg, imm);
  return host_reg;
}


x86 assembly (clang, -O0):
<CMP_HOST_REG_IMM_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     116f <CMP_HOST_REG_IMM_L+0x4f>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     $0x2,%edi
call   1030 <addbyte@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <SUB_HOST_REG_IMM@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMP_HOST_REG_IMM_L>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   $0x8,%bpl
je     1158 <CMP_HOST_REG_IMM_L+0x38>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     $0xc2,%ebp
movzbl %bpl,%edi
call   1030 <addbyte@plt>
mov    $0x2,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <SUB_HOST_REG_IMM@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CMP_HOST_REG_IMM_L(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = call i32 @addbyte(i32 68)
%10 = call i32 @addbyte(i32 137)
%11 = load i32, i32* %3
%12 = and i32 %11, 7
%13 = shl i32 %12, 3
%14 = or i32 192, %13
%15 = or i32 %14, 2
%16 = call i32 @addbyte(i32 %15)
store i32 2, i32* %3
br label %17
17: ; preds = %8, %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @SUB_HOST_REG_IMM(i32 %18, i32 %19)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @CMP_HOST_REG_IMM_L(i32 %0, i32 %1) {
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @addbyte(i32 68)
%7 = tail call i32 @addbyte(i32 137)
%8 = shl i32 %0, 3
%9 = and i32 %8, 56
%10 = or i32 %9, 194
%11 = tail call i32 @addbyte(i32 %10)
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 2, %5 ], [ %0, %2 ]
%14 = tail call i32 @SUB_HOST_REG_IMM(i32 %13, i32 %1)
ret i32 %13
}
/* Variables and functions */
int swe_houses_armc_ex2(double, double, double, int, double *, double *,
                        int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/ *);
int swe_houses_armc(double armc, double geolat, double eps, int hsys,
                    double *cusp, double *ascmc) {
  return swe_houses_armc_ex2(armc, geolat, eps, hsys, cusp, ascmc, NULL, NULL,
                             NULL);
}


x86 assembly (clang, -O0):
<swe_houses_armc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <swe_houses_armc_ex2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swe_houses_armc>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <swe_houses_armc_ex2@plt>

LLVM IR (-O0):
define i32 @swe_houses_armc(double %0, double %1, double %2, i32 %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store i32 %3, i32* %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load i32, i32* %10
%17 = load double*, double** %11
%18 = load double*, double** %12
%19 = call i32 @swe_houses_armc_ex2(double %13, double %14, double %15, i32 %16, double* %17, double* %18, i32* null, i32* null, i32* null)
ret i32 %19
}

LLVM IR (-O2):
define i32 @swe_houses_armc(double %0, double %1, double %2, i32 %3, double* %4, double* %5) {
%7 = tail call i32 @swe_houses_armc_ex2(double %0, double %1, double %2, i32 %3, double* %4, double* %5, i32* null, i32* null, i32* null)
ret i32 %7
}
void ARGBExtractAlpha() {}


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

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

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

LLVM IR (-O2):
define void @ARGBExtractAlpha() {
ret void
}
char d(char s) { return s - '1'; }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x31,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
lea    -0x31(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @d(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 49
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @d(i8 signext %0) {
%2 = add i8 %0, -49
ret i8 %2
}
char funny_call2(int a, short b, char c, int d, short e) {
  return (int)(a + b + c + d + e);
}


x86 assembly (clang, -O0):
<funny_call2>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %edi,-0x4(%rbp)
mov    %si,-0x6(%rbp)
mov    %dl,-0x7(%rbp)
mov    %ecx,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
add    %ecx,%eax
movsbl -0x7(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
movswl -0xe(%rbp),%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funny_call2>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
add    %r8d,%eax
ret

LLVM IR (-O0):
define signext i8 @funny_call2(i32 %0, i16 signext %1, i8 signext %2, i32 %3, i16 signext %4) {
%6 = alloca i32
%7 = alloca i16
%8 = alloca i8
%9 = alloca i32
%10 = alloca i16
store i32 %0, i32* %6
store i16 %1, i16* %7
store i8 %2, i8* %8
store i32 %3, i32* %9
store i16 %4, i16* %10
%11 = load i32, i32* %6
%12 = load i16, i16* %7
%13 = sext i16 %12 to i32
%14 = add nsw i32 %11, %13
%15 = load i8, i8* %8
%16 = sext i8 %15 to i32
%17 = add nsw i32 %14, %16
%18 = load i32, i32* %9
%19 = add nsw i32 %17, %18
%20 = load i16, i16* %10
%21 = sext i16 %20 to i32
%22 = add nsw i32 %19, %21
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @funny_call2(i32 %0, i16 signext %1, i8 signext %2, i32 %3, i16 signext %4) {
%6 = zext i16 %1 to i32
%7 = add i32 %6, %0
%8 = zext i8 %2 to i32
%9 = add i32 %7, %8
%10 = add i32 %9, %3
%11 = zext i16 %4 to i32
%12 = add i32 %10, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}
void Delay(unsigned int nDelay) {
  unsigned int i, j, k;
  for (i = 0; i < nDelay; i++)
    for (j = 0; j < 6144; j++)
      k++;
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1158 <Delay+0x58>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1800,-0xc(%rbp)
jae    1145 <Delay+0x45>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <Delay+0x21>
jmp    114a <Delay+0x4a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_err(char *);
void call_out(void) { pr_err("CALLED OUT!\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"CALLED OUT!\0A\00"
define void @call_out() {
%1 = call i32 @pr_err(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"CALLED OUT!\0A\00"
define void @call_out() {
%1 = tail call i32 @pr_err(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local2;
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      local2 = 0UL;
      while (local2 < (unsigned short)0) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 371143069UL - (unsigned short)23309;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x16(%rbp)
movzwl -0x16(%rbp),%eax
cmp    $0x0,%eax
jge    1164 <RandomFunc+0x64>
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1153 <RandomFunc+0x53>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1135 <RandomFunc+0x35>
movzwl -0x16(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x16(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
imul   $0x161f319d,%rax,%rax
sub    $0x5b0d,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
imul   $0x319d,%eax,%eax
add    $0xffffc344,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
%7 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%8 = load i16*, i16** %3
%9 = getelementptr inbounds i16, i16* %8, i64 0
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 2885
%13 = trunc i32 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %7
br label %15
15: ; preds = %29, %2
%16 = load i16, i16* %7
%17 = zext i16 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %34
19: ; preds = %15
store i16 0, i16* %6
br label %20
20: ; preds = %24, %19
%21 = load i16, i16* %6
%22 = zext i16 %21 to i32
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i16, i16* %6
%26 = zext i16 %25 to i64
%27 = add i64 %26, 2
%28 = trunc i64 %27 to i16
store i16 %28, i16* %6
br label %20
29: ; preds = %20
%30 = load i16, i16* %7
%31 = zext i16 %30 to i64
%32 = add i64 %31, 2
%33 = trunc i64 %32 to i16
store i16 %33, i16* %7
br label %15
34: ; preds = %15
%35 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%36 = load i16, i16* %35
%37 = zext i16 %36 to i64
%38 = mul i64 %37, 371143069
%39 = sub i64 %38, 23309
%40 = trunc i64 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = mul i16 %3, 12701
%5 = add i16 %4, -15548
store i16 %5, i16* %1
ret void
}
void show_struct_list() {}


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

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

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

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