xunge/DecIR huggingface dataset:
/* Variables and functions */
char EOF;
char getch();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ ungetch(char);
int main(void) {
  ungetch('a');
  ungetch(EOF);
  putchar(getch());
  putchar(getch());
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1040 <ungetch@plt>
mov    0x2e98(%rip),%rax
movsbl (%rax),%edi
call   1040 <ungetch@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1040 <ungetch@plt>
mov    0x2ea6(%rip),%rax
movsbl (%rax),%edi
call   1040 <ungetch@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ungetch(i8 signext 97)
%3 = load i8, i8* @EOF
%4 = call i32 @ungetch(i8 signext %3)
%5 = call signext i8 (...) @getch()
%6 = call i32 @putchar(i8 signext %5)
%7 = call signext i8 (...) @getch()
%8 = call i32 @putchar(i8 signext %7)
%9 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call i32 @ungetch(i8 signext 97)
%2 = load i8, i8* @EOF
%3 = tail call i32 @ungetch(i8 signext %2)
%4 = tail call signext i8 (...) @getch()
%5 = tail call i32 @putchar(i8 signext %4)
%6 = tail call signext i8 (...) @getch()
%7 = tail call i32 @putchar(i8 signext %6)
%8 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
int kvm_getloadavg(void *kd, double loadagv[], int nelem) { return (-1); }


x86 assembly (clang, -O0):
<kvm_getloadavg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @kvm_getloadavg(i8* nocapture readnone %0, double* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_PALETTE_swap(char *, int);
void U_WMRCREATEPALETTE_swap(char *record, int torev) {
  U_WMRCORE_PALETTE_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRCREATEPALETTE_swap>:
jmp    1030 <U_WMRCORE_PALETTE_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRCREATEPALETTE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_PALETTE_swap(i8* %0, i32 %1)
ret void
}
void start_timer(void) {
  *(volatile int *)(((0x10000000 + 0xA100000) + 0x3000) + 0x04) = 0x1;
}


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

x86 assembly (clang, -O2):
<start_timer>:
movl   $0x1,0x1a103004
ret

LLVM IR (-O0):
define void @start_timer() {
store volatile i32 1, i32* inttoptr (i64 437268484 to i32*)
ret void
}

LLVM IR (-O2):
define void @start_timer() {
store volatile i32 1, i32* inttoptr (i64 437268484 to i32*)
ret void
}
/* Variables and functions */
extern void e_wsfe(void) { ; }


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

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

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

LLVM IR (-O2):
define void @e_wsfe() {
ret void
}
/* Type definitions */
struct sockaddr_storage {
  scalar_t__ ss_family;
};

/* Variables and functions */
scalar_t__ AF_INET;
scalar_t__ AF_INET6;
int ip_version(struct sockaddr_storage *address) {
  if (address->ss_family == AF_INET) {
    return 4;
  } else if (address->ss_family == AF_INET6) {
    return 6;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<ip_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%rax
jne    112b <ip_version+0x2b>
movl   $0x4,-0x4(%rbp)
jmp    1155 <ip_version+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%rax
jne    114e <ip_version+0x4e>
movl   $0x6,-0x4(%rbp)
jmp    1155 <ip_version+0x55>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_version>:
mov    (%rdi),%rax
mov    0x2ede(%rip),%rcx
mov    0x2ecf(%rip),%rdx
cmp    (%rdx),%rax
mov    $0x6,%edx
mov    $0xffffffff,%esi
cmove  %edx,%esi
cmp    (%rcx),%rax
mov    $0x4,%eax
cmovne %esi,%eax
ret

LLVM IR (-O0):
%struct.sockaddr_storage = type { i64 }
@AF_INET = global i64 0
@AF_INET6 = global i64 0
define i32 @ip_version(%struct.sockaddr_storage* %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_storage*
store %struct.sockaddr_storage* %0, %struct.sockaddr_storage** %3
%4 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%5 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @AF_INET
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 4, i32* %2
br label %18
10: ; preds = %1
%11 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%12 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = load i64, i64* @AF_INET6
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 6, i32* %2
br label %18
17: ; preds = %10
store i32 -1, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i64 }
@AF_INET = global i64 0
@AF_INET6 = global i64 0
define i32 @ip_version(%struct.sockaddr_storage* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @AF_INET
%5 = icmp eq i64 %3, %4
%6 = load i64, i64* @AF_INET6
%7 = icmp eq i64 %3, %6
%8 = select i1 %7, i32 6, i32 -1
%9 = select i1 %5, i32 4, i32 %8
ret i32 %9
}
/* Variables and functions */
int sq2_size_impl();
int sq2_size() { return sq2_size_impl(); }


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

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

LLVM IR (-O0):
define i32 @sq2_size() {
%1 = call i32 (...) @sq2_size_impl()
ret i32 %1
}

LLVM IR (-O2):
define i32 @sq2_size() {
%1 = tail call i32 (...) @sq2_size_impl()
ret i32 %1
}
/* Variables and functions */
unsigned isspace(char c) {
  return (c == ' ' || c == '\t' || c == '\v' || c == '\n' || c == '\r' ||
          c == '\f');
}


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

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

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

LLVM IR (-O2):
define i32 @isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 11, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 12
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ st_comb_ln(unsigned int, unsigned int);
double st_comb(unsigned int n, unsigned int r) {
  if (r > n)
    return 0;
  if (n == 0 || r == 0 || n == r)
    return 1;
  return exp(st_comb_ln(n, r));
}


x86 assembly (clang, -O0):
<st_comb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1147 <st_comb+0x27>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <st_comb+0x70>
cmpl   $0x0,-0xc(%rbp)
je     1167 <st_comb+0x47>
cmpl   $0x0,-0x10(%rbp)
je     1167 <st_comb+0x47>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1179 <st_comb+0x59>
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1190 <st_comb+0x70>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <st_comb_ln@plt>
mov    %eax,%edi
call   1040 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_comb>:
push   %rax
xorps  %xmm0,%xmm0
cmp    %edi,%esi
jbe    112a <st_comb+0xa>
pop    %rax
ret
movsd  0xece(%rip),%xmm0
je     1128 <st_comb+0x8>
test   %edi,%edi
je     1128 <st_comb+0x8>
test   %esi,%esi
je     1128 <st_comb+0x8>
call   1030 <st_comb_ln@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <exp@plt>

LLVM IR (-O0):
define double @st_comb(i32 %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store double 0.000000e+00, double* %3
br label %26
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16, %13, %10
store double 1.000000e+00, double* %3
br label %26
21: ; preds = %16
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = call i32 @st_comb_ln(i32 %22, i32 %23)
%25 = call double @exp(i32 %24)
store double %25, double* %3
br label %26
26: ; preds = %21, %20, %9
%27 = load double, double* %3
ret double %27
}

LLVM IR (-O2):
define double @st_comb(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, %0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 0
%6 = icmp eq i32 %1, 0
%7 = or i1 %5, %6
%8 = icmp eq i32 %0, %1
%9 = or i1 %8, %7
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @st_comb_ln(i32 %0, i32 %1)
%12 = tail call double @exp(i32 %11)
br label %13
13: ; preds = %4, %2, %10
%14 = phi double [ %12, %10 ], [ 0.000000e+00, %2 ], [ 1.000000e+00, %4 ]
ret double %14
}
/* Variables and functions */
int __brute_force(char *, char *);
int string_match(char *t, char *p) { return __brute_force(t, p); }


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

x86 assembly (clang, -O2):
<string_match>:
jmp    1030 <__brute_force@plt>

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

LLVM IR (-O2):
define i32 @string_match(i8* %0, i8* %1) {
%3 = tail call i32 @__brute_force(i8* %0, i8* %1)
ret i32 %3
}
int f_blg_rr1(float a1, float a2) { return (__builtin_islessgreater(a1, a2)); }


x86 assembly (clang, -O0):
<f_blg_rr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blg_rr1>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setne  %al
ret

LLVM IR (-O0):
define i32 @f_blg_rr1(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp one float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f_blg_rr1(float %0, float %1) {
%3 = fcmp one float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void abs_init() {}


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

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

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

LLVM IR (-O2):
define void @abs_init() {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("Sum = %d\n", (atoi(argv[1]) + atoi(argv[2])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x14(%rbp),%esi
add    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
add    %eax,%ebp
lea    0xebd(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Sum = %d\0A\00"
define i32 @main(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 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @atoi(i8* %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 2
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = add nsw i32 %8, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Sum = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = add nsw i32 %8, %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_event_all(int, int /*<<< orphan*/ *);
void ctime_change() { add_event_all(0x02, NULL); }


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

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

LLVM IR (-O0):
define void @ctime_change() {
%1 = call i32 @add_event_all(i32 2, i32* null)
ret void
}

LLVM IR (-O2):
define void @ctime_change() {
%1 = tail call i32 @add_event_all(i32 2, i32* null)
ret void
}
signed int getlogin_r(char *__buf, unsigned long int __buflen) {
  signed int return_value___getlogin_r_chk$1;
  signed int return_value___getlogin_r_chk_warn$2;
  signed int return_value___getlogin_r_alias$3;
  return_value___getlogin_r_alias$3 = __getlogin_r_alias(__buf, __buflen);
  return return_value___getlogin_r_alias$3;
}


x86 assembly (clang, -O0):
<getlogin_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <__getlogin_r_alias@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getlogin_r(i8* %0, i64 %1) {
%3 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @__getlogin_r_alias to i32 (i8*, i64, ...)*)(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *module_libc_memcpy(void *dest, const void *src, size_t n) {
  return memcpy(dest, src, n);
}


x86 assembly (clang, -O0):
<module_libc_memcpy>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_libc_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @module_libc_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int hexdigit(char);
int /*<<< orphan*/ printf(char *, int, int);
void charhexout(char c) {
  printf("%c%c ", hexdigit((c >> 4) & 0x0F), hexdigit(c & 0x0F));
}


x86 assembly (clang, -O0):
<charhexout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movsbl %al,%edi
call   1040 <hexdigit@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movsbl %al,%edi
call   1040 <hexdigit@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charhexout>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1040 <hexdigit@plt>
mov    %eax,%ebp
and    $0xf,%ebx
mov    %ebx,%edi
call   1040 <hexdigit@plt>
lea    0xebb(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%c%c \00"
define void @charhexout(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
%8 = call i32 @hexdigit(i8 signext %7)
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = and i32 %10, 15
%12 = trunc i32 %11 to i8
%13 = call i32 @hexdigit(i8 signext %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c%c \00"
define void @charhexout(i8 signext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @hexdigit(i8 signext %2)
%4 = and i8 %0, 15
%5 = tail call i32 @hexdigit(i8 signext %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("oscbridge [options] <server>\n"); }


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

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

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

LLVM IR (-O2):
@str = [29 x i8] c"oscbridge [options] <server>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
long *suche_0(long *addr) {
  while (*addr != 0) {
    addr = addr + 1;
    printf("addr = %x \n", &addr);
  }
  return addr;
}


x86 assembly (clang, -O0):
<suche_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114d <suche_0+0x3d>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111c <suche_0+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suche_0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rax
cmpq   $0x0,(%rdi)
je     114f <suche_0+0x3f>
lea    0xedc(%rip),%r14
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
add    $0x8,%rax
mov    %rax,(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rax
cmpq   $0x0,(%rax)
jne    1130 <suche_0+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"addr = %x \0A\00"
define i64* @suche_0(i64* %0) {
%2 = alloca i64*
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i64* [ %9, %5 ], [ %0, %1 ]
%7 = getelementptr inbounds i64, i64* %6, i64 1
store i64* %7, i64** %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64** %2)
%9 = load i64*, i64** %2
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i64* [ %0, %1 ], [ %9, %5 ]
ret i64* %13
}
int bah(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @bah(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a[] = {1, 2, 3};
  int *pa;
  pa = a;
  pa++;
  printf("*pa = %i\n", *pa);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"*pa = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int ez_net_unix_connect_ex(char const *, int /*<<< orphan*/);
int ez_net_unix_connect(const char *path) {
  return ez_net_unix_connect_ex(path, 0);
}


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

x86 assembly (clang, -O2):
<ez_net_unix_connect>:
xor    %esi,%esi
jmp    1030 <ez_net_unix_connect_ex@plt>

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

LLVM IR (-O2):
define i32 @ez_net_unix_connect(i8* %0) {
%2 = tail call i32 @ez_net_unix_connect_ex(i8* %0, i32 0)
ret i32 %2
}
void lars_delay() {
  int i;
  for (i = 0; i < 640000; i++)
    ;
  for (i = 0; i < 640000; i++)
    ;
  for (i = 0; i < 640000; i++)
    ;
}


x86 assembly (clang, -O0):
<lars_delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x9c400,-0x4(%rbp)
jge    112b <lars_delay+0x2b>
jmp    111d <lars_delay+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <lars_delay+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x9c400,-0x4(%rbp)
jge    1152 <lars_delay+0x52>
jmp    1144 <lars_delay+0x44>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <lars_delay+0x32>
movl   $0x0,-0x4(%rbp)
cmpl   $0x9c400,-0x4(%rbp)
jge    1179 <lars_delay+0x79>
jmp    116b <lars_delay+0x6b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <lars_delay+0x59>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lars_delay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char __attribute__((unused)) * argv[]) {
  printf("%d\n", argc - 1);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef size_t ptrdiff_t;

/* Variables and functions */
int max(const int *row, ptrdiff_t col) {
  return row[col + (row[col] < row[col + 1])];
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    (%rdx,%rsi,4),%edx
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
cmp    0x4(%rsi,%rdi,4),%edx
setl   %dl
and    $0x1,%dl
movzbl %dl,%edx
movslq %edx,%rdx
add    %rdx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    (%rdi,%rsi,4),%eax
xor    %ecx,%ecx
cmp    0x4(%rdi,%rsi,4),%eax
setl   %cl
add    %rsi,%rcx
mov    (%rdi,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @max(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = load i32*, i32** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = icmp slt i32 %10, %15
%17 = zext i1 %16 to i32
%18 = sext i32 %17 to i64
%19 = add i64 %6, %18
%20 = getelementptr inbounds i32, i32* %5, i64 %19
%21 = load i32, i32* %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @max(i32* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 %1
%4 = load i32, i32* %3
%5 = add i64 %1, 1
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp slt i32 %4, %7
%9 = zext i1 %8 to i64
%10 = add i64 %9, %1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
ret i32 %12
}
int cow_str_count(const char *str, char c) {
  int count = 0;
  for (char *p = (char *)str; *p != '\0'; ++p) {
    if (*p == c)
      ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<cow_str_count>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <cow_str_count+0x5f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <cow_str_count+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <cow_str_count+0x4e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <cow_str_count+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cow_str_count>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <cow_str_count+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <cow_str_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cow_str_count(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = phi i32 [ 0, %2 ], [ %13, %7 ]
ret i32 %6
7: ; preds = %2, %7
%8 = phi i8 [ %15, %7 ], [ %3, %2 ]
%9 = phi i8* [ %14, %7 ], [ %0, %2 ]
%10 = phi i32 [ %13, %7 ], [ 0, %2 ]
%11 = icmp eq i8 %8, %1
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %10, %12
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %5, label %7
}
int dpi_init(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @dpi_init(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *__cxa_demangle(char const *, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
char *demangle_symbol_name(const char *name) {
  return __cxa_demangle(name, 0, 0, 0);
}


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

x86 assembly (clang, -O2):
<demangle_symbol_name>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <__cxa_demangle@plt>

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

LLVM IR (-O2):
define i8* @demangle_symbol_name(i8* %0) {
%2 = tail call i8* @__cxa_demangle(i8* %0, i32 0, i32 0, i32 0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ Check_forchange(int);
int difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void Checktimer() {
  static time_t Lasttime;
  static time_t Currenttime;
  Currenttime = time(NULL);
  if (difftime(Currenttime, Lasttime) < 60)
    return;
  else {
    Check_forchange(-1);
    Lasttime = Currenttime;
  }
}


x86 assembly (clang, -O0):
<Checktimer>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,0x2efd(%rip)
mov    0x2ef7(%rip),%edi
mov    0x2eed(%rip),%esi
call   1030 <difftime@plt>
cmp    $0x3c,%eax
jge    1162 <Checktimer+0x32>
jmp    1178 <Checktimer+0x48>
mov    $0xffffffff,%edi
call   1040 <Check_forchange@plt>
mov    0x2ece(%rip),%eax
mov    %eax,0x2ec4(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Checktimer>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x2f02(%rip)
mov    0x2ef8(%rip),%esi
mov    %eax,%edi
call   1030 <difftime@plt>
cmp    $0x3c,%eax
jl     1166 <Checktimer+0x36>
mov    $0xffffffff,%edi
call   1040 <Check_forchange@plt>
mov    0x2ee0(%rip),%eax
mov    %eax,0x2ed6(%rip)
pop    %rax
ret

LLVM IR (-O0):
@Checktimer.Lasttime = internal global i32 0
@Checktimer.Currenttime = internal global i32 0
define void @Checktimer() {
%1 = call i32 @time(i32* null)
store i32 %1, i32* @Checktimer.Currenttime
%2 = load i32, i32* @Checktimer.Currenttime
%3 = load i32, i32* @Checktimer.Lasttime
%4 = call i32 @difftime(i32 %2, i32 %3)
%5 = icmp slt i32 %4, 60
br i1 %5, label %6, label %7
6: ; preds = %0
br label %10
7: ; preds = %0
%8 = call i32 @Check_forchange(i32 -1)
%9 = load i32, i32* @Checktimer.Currenttime
store i32 %9, i32* @Checktimer.Lasttime
br label %10
10: ; preds = %6, %7
ret void
}

LLVM IR (-O2):
@Checktimer.Lasttime = internal unnamed_addr global i32 0
@Checktimer.Currenttime = internal unnamed_addr global i32 0
define void @Checktimer() {
%1 = tail call i32 @time(i32* null)
store i32 %1, i32* @Checktimer.Currenttime
%2 = load i32, i32* @Checktimer.Lasttime
%3 = tail call i32 @difftime(i32 %1, i32 %2)
%4 = icmp slt i32 %3, 60
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 @Check_forchange(i32 -1)
%7 = load i32, i32* @Checktimer.Currenttime
store i32 %7, i32* @Checktimer.Lasttime
br label %8
8: ; preds = %0, %5
ret void
}
unsigned int _uiGetPosType(void) { return (0x0100); }


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

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

LLVM IR (-O0):
define i32 @_uiGetPosType() {
ret i32 256
}

LLVM IR (-O2):
define i32 @_uiGetPosType() {
ret i32 256
}
/* Variables and functions */
int lps(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  printf("Enter value of n : ");
  int n, l;
  scanf("%d", &n);
  l = lps(n);
  printf("Last Person Standing = %d", l);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <lps@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter value of n : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Last Person Standing = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @lps(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter value of n : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"Last Person Standing = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @lps(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
float cf(float x, float y) { return __builtin_copysignf(x, y); }


x86 assembly (clang, -O0):
<cf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @cf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.copysign.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @cf(float %0, float %1) {
%3 = tail call float @llvm.copysign.f32(float %0, float %1)
ret float %3
}
float bar3(float x, float y, float z) { return x + (-y * x * -z); }


x86 assembly (clang, -O0):
<bar3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar3>:
mulss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @bar3(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 = fneg float %8
%10 = load float, float* %4
%11 = fmul float %9, %10
%12 = load float, float* %6
%13 = fneg float %12
%14 = call float @llvm.fmuladd.f32(float %11, float %13, float %7)
ret float %14
}

LLVM IR (-O2):
define float @bar3(float %0, float %1, float %2) {
%4 = fneg float %1
%5 = fmul float %4, %0
%6 = fneg float %2
%7 = tail call float @llvm.fmuladd.f32(float %5, float %6, float %0)
ret float %7
}
int is_flag_character(int c) {
  return c == '#' || c == '0' || c == '-' || c == ' ' || c == '+';
}


x86 assembly (clang, -O0):
<is_flag_character>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x23,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <is_flag_character+0x4d>
mov    $0x1,%al
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <is_flag_character+0x4d>
mov    $0x1,%al
cmpl   $0x2d,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <is_flag_character+0x4d>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114d <is_flag_character+0x4d>
cmpl   $0x2b,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_flag_character>:
cmp    $0x30,%edi
ja     111d <is_flag_character+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x1200900000000,%rdx
bt     %rcx,%rdx
jae    111d <is_flag_character+0x1d>
ret
xor    %eax,%eax
cmp    $0x2b,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_flag_character(i32 %0) {
switch i32 %0, label %2 [
i32 48, label %5
i32 45, label %5
i32 35, label %5
i32 32, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 43
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printChar(char *a, int l) {
  int i;
  for (i = 0; i < l; i++)
    printf("%c, ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printChar+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printChar+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printChar>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <printChar+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printChar+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%c, \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printChar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = 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 = [5 x i8] c"%c, \00"
define void @printChar(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}