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

/* Variables and functions */
int64_t sum_consec_int(int64_t n) { return n * (n + 1) / 2; }


x86 assembly (clang, -O0):
<sum_consec_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_consec_int>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @sum_consec_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @sum_consec_int(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void test_printer(const char *string) { printf("test_printer: %s", string); }


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

x86 assembly (clang, -O2):
<test_printer>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"test_printer: %s\00"
define void @test_printer(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *strccpy(char *s1, const char **s2, char c) {
  while (**s2 && **s2 != c)
    *s1++ = *((*s2)++);
  *s1 = 0;
  return s1;
}


x86 assembly (clang, -O0):
<strccpy>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     113f <strccpy+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    114f <strccpy+0x4f>
jmp    1178 <strccpy+0x78>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1111 <strccpy+0x11>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strccpy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsi),%rdi
movzbl (%rdi),%ecx
test   %cl,%cl
je     1130 <strccpy+0x30>
cmp    %dl,%cl
je     1130 <strccpy+0x30>
lea    0x1(%rdi),%rcx
mov    %rcx,(%rsi)
movzbl (%rdi),%ecx
mov    %cl,(%rax)
add    $0x1,%rax
jmp    1110 <strccpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strccpy(i8* writeonly %0, i8** nocapture %1, i8 signext %2) {
%4 = load i8*, i8** %1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %2
%8 = or i1 %6, %7
br i1 %8, label %20, label %9
9: ; preds = %3, %9
%10 = phi i8* [ %15, %9 ], [ %4, %3 ]
%11 = phi i8* [ %14, %9 ], [ %0, %3 ]
%12 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %12, i8** %1
%13 = load i8, i8* %10
%14 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %13, i8* %11
%15 = load i8*, i8** %1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
%18 = icmp eq i8 %16, %2
%19 = or i1 %17, %18
br i1 %19, label %20, label %9
20: ; preds = %9, %3
%21 = phi i8* [ %0, %3 ], [ %14, %9 ]
store i8 0, i8* %21
ret i8* %21
}
/* Type definitions */
typedef scalar_t__ useconds_t;

/* Variables and functions */
unsigned int usleep(scalar_t__);
int test(void) {
  useconds_t usec;
  unsigned result;
  usec = 0;
  result = usleep(usec);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <usleep@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @usleep(i64 0)
ret i32 %1
}
int charToIndex(char c) { return ((c - 'A') & 31) * 2 + ((c - 'A') >> 5); }


x86 assembly (clang, -O0):
<charToIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
and    $0x1f,%eax
shl    $0x1,%eax
movsbl -0x1(%rbp),%ecx
sub    $0x41,%ecx
sar    $0x5,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToIndex>:
add    $0xffffffbf,%edi
mov    %edi,%eax
and    $0x1f,%eax
sar    $0x5,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @charToIndex(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, 65
%6 = and i32 %5, 31
%7 = mul nsw i32 %6, 2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 65
%11 = ashr i32 %10, 5
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @charToIndex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -65
%4 = shl nsw i32 %3, 1
%5 = and i32 %4, 62
%6 = ashr i32 %3, 5
%7 = add nsw i32 %5, %6
ret i32 %7
}
system(str) char *str;
{
  int status;
  if (fork() == 0)
    execl("/bin/sh", "sh", "-c", str, 0);
  wait(&status);
}


x86 assembly (clang, -O0):
<system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%eax
jne    116f <system+0x3f>
mov    -0x10(%rbp),%rcx
lea    0xea9(%rip),%rdi
lea    0xea7(%rip),%rsi
lea    0xea3(%rip),%rdx
xor    %r8d,%r8d
mov    $0x0,%al
call   1030 <execl@plt>
lea    -0x14(%rbp),%rdi
mov    $0x0,%al
call   1040 <wait@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
test   %eax,%eax
jne    1165 <system+0x35>
lea    0xeb6(%rip),%rdi
lea    0xeb4(%rip),%rsi
lea    0xeb0(%rip),%rdx
mov    %rbx,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <execl@plt>
lea    0xc(%rsp),%rdi
xor    %eax,%eax
call   1040 <wait@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
@.str.2 = [3 x i8] c"-c\00"
define i32 @system(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 (...) @fork()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 (i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @execl to i32 (i8*, i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8, i32 0)
br label %10
10: ; preds = %7, %1
%11 = call i32 (i32*, ...) bitcast (i32 (...)* @wait to i32 (i32*, ...)*)(i32* %4)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
@.str.2 = [3 x i8] c"-c\00"
define i32 @system(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (...) @fork()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @execl to i32 (i8*, i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 0)
br label %8
8: ; preds = %6, %1
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @wait to i32 (i32*, ...)*)(i32* %2)
ret i32 undef
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ xmlescape_real(char const *, char *, int *, int);
char *xmlescape(const char *str, int attribute) {
  int len;
  char *out;
  xmlescape_real(str, NULL, &len, attribute);
  out = (char *)malloc(len + 1);
  xmlescape_real(str, out, NULL, attribute);
  return out;
}


x86 assembly (clang, -O0):
<xmlescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%esi
lea    -0x10(%rbp),%rdx
call   1030 <xmlescape_real@plt>
mov    -0x10(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <xmlescape_real@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlescape>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xc(%rsp),%rdx
xor    %esi,%esi
mov    %r14d,%ecx
call   1030 <xmlescape_real@plt>
mov    0xc(%rsp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %r14d,%ecx
call   1030 <xmlescape_real@plt>
mov    %rbp,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @xmlescape(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @xmlescape_real(i8* %7, i8* null, i32* %5, i32 %8)
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %6
%14 = load i8*, i8** %3
%15 = load i8*, i8** %6
%16 = load i32, i32* %4
%17 = call i32 @xmlescape_real(i8* %14, i8* %15, i32* null, i32 %16)
%18 = load i8*, i8** %6
ret i8* %18
}

LLVM IR (-O2):
define i8* @xmlescape(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xmlescape_real(i8* %0, i8* null, i32* %3, i32 %1)
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = call i32 @xmlescape_real(i8* %0, i8* %9, i32* null, i32 %1)
ret i8* %9
}
unsigned int get_new_capacity(int need) {
  unsigned int new_capacity;
  new_capacity = (need >> 6) + (need < 9 ? 3 : 6);
  new_capacity += need;
  return new_capacity;
}


x86 assembly (clang, -O0):
<get_new_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
mov    -0x4(%rbp),%esi
mov    $0x6,%ecx
mov    $0x3,%edx
cmp    $0x9,%esi
cmovl  %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_new_capacity>:
mov    %edi,%eax
sar    $0x6,%eax
xor    %ecx,%ecx
cmp    $0x9,%edi
setge  %cl
lea    (%rcx,%rcx,2),%ecx
add    %edi,%eax
add    %ecx,%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @get_new_capacity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 6
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 9
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 3, i32 6
%10 = add nsw i32 %5, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = add i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_new_capacity(i32 %0) {
%2 = ashr i32 %0, 6
%3 = icmp slt i32 %0, 9
%4 = select i1 %3, i32 3, i32 6
%5 = add i32 %2, %0
%6 = add i32 %5, %4
ret i32 %6
}
int test_imm_B9int8_mem(signed char *val) {
  return ((*val) & (-0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff47,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B9int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff47,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B9int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -185
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B9int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -185
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ buildK33();
int /*<<< orphan*/ createMatching();
int /*<<< orphan*/ initialSubdivision();
int /*<<< orphan*/ subdivideK33_first(int);
void subdivideK33(int times) {
  buildK33();
  initialSubdivision();
  if (times == 0) {
    createMatching();
  } else {
    subdivideK33_first(times);
  }
}


x86 assembly (clang, -O0):
<subdivideK33>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <buildK33@plt>
mov    $0x0,%al
call   1050 <initialSubdivision@plt>
cmpl   $0x0,-0x4(%rbp)
jne    116f <subdivideK33+0x2f>
mov    $0x0,%al
call   1030 <createMatching@plt>
jmp    1177 <subdivideK33+0x37>
mov    -0x4(%rbp),%edi
call   1060 <subdivideK33_first@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subdivideK33>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <buildK33@plt>
xor    %eax,%eax
call   1050 <initialSubdivision@plt>
test   %ebx,%ebx
je     115d <subdivideK33+0x1d>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <subdivideK33_first@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <createMatching@plt>

LLVM IR (-O0):
define void @subdivideK33(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @buildK33()
%4 = call i32 (...) @initialSubdivision()
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @createMatching()
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @subdivideK33_first(i32 %10)
br label %12
12: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
define void @subdivideK33(i32 %0) {
%2 = tail call i32 (...) @buildK33()
%3 = tail call i32 (...) @initialSubdivision()
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @createMatching()
br label %9
7: ; preds = %1
%8 = tail call i32 @subdivideK33_first(i32 %0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
struct stat {
  int st_mtime;
};

/* Variables and functions */
int stat(char *, struct stat *);
int Sys_FileTime(char *path) {
  struct stat buf;
  if (stat(path, &buf) == -1)
    return -1;
  return buf.st_mtime;
}


x86 assembly (clang, -O0):
<Sys_FileTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <Sys_FileTime+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <Sys_FileTime+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_FileTime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1121 <Sys_FileTime+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @Sys_FileTime(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @Sys_FileTime(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void *work(void *param) {
  printf("I'm PID: %d\n", getpid());
  for (int i = 0; i < 10; i++) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    117a <work+0x4a>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <work+0x28>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <sleep@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"I'm PID: %d\0A\00"
define noalias i8* @work(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @sleep(i32 1)
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 @sleep(i32 1)
%9 = tail call i32 @sleep(i32 1)
%10 = tail call i32 @sleep(i32 1)
%11 = tail call i32 @sleep(i32 1)
%12 = tail call i32 @sleep(i32 1)
%13 = tail call i32 @sleep(i32 1)
ret i8* undef
}
int kerberosCheck(username, password)
char *username;
char *password;
{ return -1; }


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

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

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

LLVM IR (-O2):
define i32 @kerberosCheck(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
int vax_gshort(char *msgp) {
  register unsigned char *p = (unsigned char *)msgp;
  register int i;
  if ((i = (p[1] << 8) | p[0]) & 0x8000)
    return (i | ~0xFFFF);
  return (i);
}


x86 assembly (clang, -O0):
<vax_gshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x1c(%rbp)
and    $0x8000,%eax
cmp    $0x0,%eax
je     1145 <vax_gshort+0x45>
mov    -0x1c(%rbp),%eax
or     $0xffff0000,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <vax_gshort+0x4b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vax_gshort>:
movzbl 0x1(%rdi),%eax
mov    %eax,%ecx
shl    $0x8,%ecx
movzbl (%rdi),%edx
lea    (%rcx,%rdx,1),%esi
test   $0x80,%al
lea    -0x10000(%rcx,%rdx,1),%eax
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @vax_gshort(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = or i32 %11, %15
store i32 %16, i32* %5
%17 = and i32 %16, 32768
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %1
%20 = load i32, i32* %5
%21 = or i32 %20, -65536
store i32 %21, i32* %2
br label %24
22: ; preds = %1
%23 = load i32, i32* %5
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %19
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @vax_gshort(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = or i32 %5, %7
%9 = and i32 %4, 128
%10 = icmp eq i32 %9, 0
%11 = or i32 %8, -65536
%12 = select i1 %10, i32 %8, i32 %11
ret i32 %12
}
char *ext(char *ins) { return ins; }


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

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

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

LLVM IR (-O2):
define i8* @ext(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *init_log(char *filename) {
  FILE *fd;
  fd = fopen(filename, "a+");
  if (fd == NULL) {
    fprintf(stderr, "can't open log file `%s'\n", filename);
    return NULL;
  }
  return fd;
}


x86 assembly (clang, -O0):
<init_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1171 <init_log+0x51>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1179 <init_log+0x59>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_log>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <init_log+0x33>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"a+\00"
@stderr = global i32 0
@.str.1 = [26 x i8] c"can't open log file `%s'\0A\00"
define i32* @init_log(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %11)
store i32* null, i32** %2
br label %15
13: ; preds = %1
%14 = load i32*, i32** %4
store i32* %14, i32** %2
br label %15
15: ; preds = %13, %9
%16 = load i32*, i32** %2
ret i32* %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"a+\00"
@stderr = global i32 0
@.str.1 = [26 x i8] c"can't open log file `%s'\0A\00"
define noalias i32* @init_log(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %1, %4
ret i32* %2
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBHostRequestStatus(uint32_t ui32Base) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x00000102))) = 0x00000020 | 0x00000040;
}


x86 assembly (clang, -O0):
<USBHostRequestStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x60,0x102(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostRequestStatus>:
movl   $0x60,0x102(%rdi)
ret

LLVM IR (-O0):
define void @USBHostRequestStatus(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 258
%5 = inttoptr i64 %4 to i32*
store volatile i32 96, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBHostRequestStatus(i64 %0) {
%2 = add nsw i64 %0, 258
%3 = inttoptr i64 %2 to i32*
store volatile i32 96, i32* %3
ret void
}
unsigned long TimerLoadGet(unsigned long ulBase, unsigned long ulTimer) {
  ;
  ;
  return ((ulTimer == 0x000000ff)
              ? (*((volatile unsigned long *)(ulBase + 0x00000028)))
              : (*((volatile unsigned long *)(ulBase + 0x0000002C))));
}


x86 assembly (clang, -O0):
<TimerLoadGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xff,-0x10(%rbp)
jne    112b <TimerLoadGet+0x2b>
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <TimerLoadGet+0x37>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerLoadGet>:
xor    %eax,%eax
cmp    $0xff,%rsi
setne  %al
mov    0x28(%rdi,%rax,4),%rax
ret

LLVM IR (-O0):
define i64 @TimerLoadGet(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 = icmp eq i64 %5, 255
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add i64 %8, 40
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
br label %17
12: ; preds = %2
%13 = load i64, i64* %3
%14 = add i64 %13, 44
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
br label %17
17: ; preds = %12, %7
%18 = phi i64 [ %11, %7 ], [ %16, %12 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @TimerLoadGet(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 255
%4 = select i1 %3, i64 40, i64 44
%5 = add i64 %4, %0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int clear_varbprec_tracker(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(519, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_varbprec_tracker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x207,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_varbprec_tracker>:
mov    $0x207,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @clear_varbprec_tracker() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 519, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_varbprec_tracker() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 519, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int is_prime(int n) {
  int i;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114d <is_prime+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113a <is_prime+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <is_prime+0x54>
jmp    113f <is_prime+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x4,%edi
jl     1125 <is_prime+0x25>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1128 <is_prime+0x28>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp sgt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 2, %1 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %12
}
int fun773() { return 773; }


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

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

LLVM IR (-O0):
define i32 @fun773() {
ret i32 773
}

LLVM IR (-O2):
define i32 @fun773() {
ret i32 773
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int read_quaddobl_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(241, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_quaddobl_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf1,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_quaddobl_target_system>:
mov    $0xf1,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @read_quaddobl_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 241, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_quaddobl_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 241, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void foo(char *s, int l) { write(1, s, l); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @foo(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 @write(i32 1, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @write(i32 1, i8* %0, i32 %1)
ret void
}
void CINTdset0(const int n, double *x) {
  int i;
  for (i = 0; i < n; i++) {
    x[i] = 0;
  }
}


x86 assembly (clang, -O0):
<CINTdset0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113c <CINTdset0+0x3c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <CINTdset0+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CINTdset0>:
test   %edi,%edi
jle    1129 <CINTdset0+0x19>
push   %rax
mov    %edi,%edx
shl    $0x3,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @CINTdset0(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @CINTdset0(i32 %0, double* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %1 to i8*
%6 = zext i32 %0 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void trmode_() {
  fflush(stdout);
  putc('\030', stdout);
}


x86 assembly (clang, -O0):
<trmode_>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    $0x18,%edi
call   1030 <putc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trmode_>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    (%rbx),%esi
mov    $0x18,%edi
pop    %rbx
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @trmode_() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @putc(i8 signext 24, i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @trmode_() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @putc(i8 signext 24, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ complete_group_name(char const *);
int complete_group(const char str[], void *arg) {
  complete_group_name(str);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @complete_group(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 = call i32 @complete_group_name(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @complete_group(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @complete_group_name(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void small_num(unsigned int a_num) { printf("not 1337 enough: %u\n", a_num); }


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

x86 assembly (clang, -O2):
<small_num>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"not 1337 enough: %u\0A\00"
define void @small_num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"not 1337 enough: %u\0A\00"
define void @small_num(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void _Jv_JNIFunctions(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_JNIFunctions() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
unsigned int le16put(void *p, uint16_t v) {
  uint8_t *a;
  a = p;
  a[0] = v;
  a[1] = v >> 8;
  return 2;
}


x86 assembly (clang, -O0):
<le16put>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le16put>:
mov    %esi,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @le16put(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 i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret i32 2
}

LLVM IR (-O2):
define i32 @le16put(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
%4 = ashr i32 %1, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %6
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ RRD(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x67(void) {
  RRD(4, 11);
  T_WAIT_UNTIL(14);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x67>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0xb,%esi
call   1040 <RRD@plt>
mov    $0xe,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x67>:
push   %rax
mov    $0x4,%edi
mov    $0xb,%esi
call   1040 <RRD@plt>
mov    $0xe,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x67() {
%1 = call i32 @RRD(i32 4, i32 11)
%2 = call i32 @T_WAIT_UNTIL(i32 14)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x67() {
%1 = tail call i32 @RRD(i32 4, i32 11)
%2 = tail call i32 @T_WAIT_UNTIL(i32 14)
ret void
}
int equal_int(void *ip, void *jp) {
  if (*(int *)ip == *(int *)jp)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    112a <equal_int+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <equal_int+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ display(struct node *);
int /*<<< orphan*/ duplicacy(struct node *);
int /*<<< orphan*/ insert(struct node **, int);
int main(void) {
  struct node *head = NULL;
  insert(&head, 5);
  insert(&head, 10);
  insert(&head, 15);
  insert(&head, 5);
  insert(&head, 25);
  display(head);
  duplicacy(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0xf,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
mov    $0x19,%esi
call   1040 <insert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <display@plt>
mov    -0x10(%rbp),%rdi
call   1050 <duplicacy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <insert@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
call   1040 <insert@plt>
mov    0x8(%rsp),%rdi
call   1030 <display@plt>
mov    0x8(%rsp),%rdi
call   1050 <duplicacy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%3 = call i32 @insert(%struct.node** %2, i32 5)
%4 = call i32 @insert(%struct.node** %2, i32 10)
%5 = call i32 @insert(%struct.node** %2, i32 15)
%6 = call i32 @insert(%struct.node** %2, i32 5)
%7 = call i32 @insert(%struct.node** %2, i32 25)
%8 = load %struct.node*, %struct.node** %2
%9 = call i32 @display(%struct.node* %8)
%10 = load %struct.node*, %struct.node** %2
%11 = call i32 @duplicacy(%struct.node* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
store %struct.node* null, %struct.node** %1
%3 = call i32 @insert(%struct.node** %1, i32 5)
%4 = call i32 @insert(%struct.node** %1, i32 10)
%5 = call i32 @insert(%struct.node** %1, i32 15)
%6 = call i32 @insert(%struct.node** %1, i32 5)
%7 = call i32 @insert(%struct.node** %1, i32 25)
%8 = load %struct.node*, %struct.node** %1
%9 = call i32 @display(%struct.node* %8)
%10 = load %struct.node*, %struct.node** %1
%11 = call i32 @duplicacy(%struct.node* %10)
ret i32 0
}
int ZEXT(int value, int topbit) { return value << (32 - topbit); }


x86 assembly (clang, -O0):
<ZEXT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZEXT>:
mov    %esi,%ecx
mov    %edi,%eax
neg    %cl
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ZEXT(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 = load i32, i32* %4
%7 = sub nsw i32 32, %6
%8 = shl i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ZEXT(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = shl i32 %0, %3
ret i32 %4
}
void do_service(fd) {
  long t = time(0);
  char *s = ctime(&t);
  write(fd, s, strlen(s));
}


x86 assembly (clang, -O0):
<do_service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1060 <time@plt>
cltq
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <ctime@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_service>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %edi,%edi
xor    %eax,%eax
call   1060 <time@plt>
cltq
mov    %rax,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <ctime@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @do_service(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
store i32 %0, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = call i32 (i64*, ...) bitcast (i32 (...)* @ctime to i32 (i64*, ...)*)(i64* %3)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i32, i32* %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %4
%13 = call i64 @strlen(i8* %12)
%14 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %10, i8* %11, i64 %13)
ret void
}

LLVM IR (-O2):
define void @do_service(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
%5 = sext i32 %4 to i64
store i64 %5, i64* %2
%6 = call i32 (i64*, ...) bitcast (i32 (...)* @ctime to i32 (i64*, ...)*)(i64* %2)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i64 @strlen(i8* dereferenceable(1) %8)
%10 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %8, i64 %9)
ret void
}