xunge/DecIR huggingface dataset:
void startPrefixMapping(char *prefix, char *uri) {
  if (prefix == (void *)0)
    prefix = "@@@@ BAD NULL";
  if (uri == (void *)0)
    uri = "NULL";
  printf("startPrefixMapping...prefix=%s uri=%s\n", prefix, uri);
}


x86 assembly (clang, -O0):
<startPrefixMapping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1136 <startPrefixMapping+0x26>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114c <startPrefixMapping+0x3c>
lea    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startPrefixMapping>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmovne %rdi,%rax
test   %rsi,%rsi
lea    0xee1(%rip),%rdx
cmovne %rsi,%rdx
lea    0xedb(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"@@@@ BAD NULL\00"
@.str.1 = [5 x i8] c"NULL\00"
@.str.2 = [39 x i8] c"startPrefixMapping...prefix=%s uri=%s\0A\00"
define void @startPrefixMapping(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 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %3
br label %8
8: ; preds = %7, %2
%9 = load i8*, i8** %4
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %8
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"@@@@ BAD NULL\00"
@.str.1 = [5 x i8] c"NULL\00"
@.str.2 = [39 x i8] c"startPrefixMapping...prefix=%s uri=%s\0A\00"
define void @startPrefixMapping(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((noreturn)) void format(void) {
  fprintf(stderr, "Usage: scripts/extract-cert <source> <dest>\n");
  exit(2);
}


x86 assembly (clang, -O0):
<format>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<format>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: scripts/extract-cert <source> <dest>\0A\00"
define void @format() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: scripts/extract-cert <source> <dest>\0A\00"
define void @format() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
struct trace_seq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ trace_seq_printf(struct trace_seq *, char *,
                                    unsigned long long);
unsigned long long process_jiffies_to_msecs(struct trace_seq *s,
                                            unsigned long long *args) {
  unsigned long long jiffies = args[0];
  trace_seq_printf(s, "%lld", jiffies);
  return jiffies;
}


x86 assembly (clang, -O0):
<process_jiffies_to_msecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xec6(%rip),%rsi
call   1030 <trace_seq_printf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_jiffies_to_msecs>:
push   %rbx
mov    (%rsi),%rbx
lea    0xee5(%rip),%rsi
mov    %rbx,%rdx
call   1030 <trace_seq_printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
@.str = [5 x i8] c"%lld\00"
define i64 @process_jiffies_to_msecs(%struct.trace_seq* %0, i64* %1) {
%3 = alloca %struct.trace_seq*
%4 = alloca i64*
%5 = alloca i64
store %struct.trace_seq* %0, %struct.trace_seq** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
store i64 %8, i64* %5
%9 = load %struct.trace_seq*, %struct.trace_seq** %3
%10 = load i64, i64* %5
%11 = call i32 @trace_seq_printf(%struct.trace_seq* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
@.str = [5 x i8] c"%lld\00"
define i64 @process_jiffies_to_msecs(%struct.trace_seq* %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = tail call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  struct _A {
    int i;
    int j;
  } a;
  printf("%d %d\n", a.i, a.j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xecd(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef)
ret i32 0
}
void rop3_70_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T & *D;
  stk2 = S | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_70_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_70_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = and i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %6
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %4
store i8 %54, i8* %55
ret void
}

LLVM IR (-O2):
define void @rop3_70_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Type definitions */
struct inhalt {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ sizeofinhalt();
struct inhalt *init_inhalt(void) {
  return (struct inhalt *)malloc(sizeofinhalt());
}


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

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

LLVM IR (-O0):
%struct.inhalt = type { i32 }
define %struct.inhalt* @init_inhalt() {
%1 = call i32 (...) @sizeofinhalt()
%2 = call i64 @malloc(i32 %1)
%3 = inttoptr i64 %2 to %struct.inhalt*
ret %struct.inhalt* %3
}

LLVM IR (-O2):
%struct.inhalt = type { i32 }
define %struct.inhalt* @init_inhalt() {
%1 = tail call i32 (...) @sizeofinhalt()
%2 = tail call i64 @malloc(i32 %1)
%3 = inttoptr i64 %2 to %struct.inhalt*
ret %struct.inhalt* %3
}
adrx0indreg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((((int *)10000000)[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jg     113c <adrx0indreg1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <adrx0indreg1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0indreg1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %13
%19 = load i32, i32* %18
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @adrx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = icmp sle i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int gmx_trjcat(int, char **);
int main(int argc, char *argv[]) { return gmx_trjcat(argc, argv); }


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),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_trjcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gmx_trjcat@plt>

LLVM IR (-O0):
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 = load i8**, i8*** %5
%8 = call i32 @gmx_trjcat(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_trjcat(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
char tolower(char);
void tolower_string(char **s) {
  for (char *p = *s; *p; p++)
    *p = tolower(*p);
}


x86 assembly (clang, -O0):
<tolower_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <tolower_string+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <tolower_string+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower_string>:
push   %rbx
mov    (%rdi),%rbx
mov    (%rbx),%al
test   %al,%al
je     1136 <tolower_string+0x26>
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tolower_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @tolower_string(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
store i8* %5, i8** %3
br label %6
6: ; preds = %15, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call signext i8 @tolower(i8 signext %12)
%14 = load i8*, i8** %3
store i8 %13, i8* %14
br label %15
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @tolower_string(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %1
ret void
6: ; preds = %1, %6
%7 = phi i8 [ %11, %6 ], [ %3, %1 ]
%8 = phi i8* [ %10, %6 ], [ %2, %1 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %5, label %6
}
void strcpy2(char *s, char *t) {
  int i;
  i = 0;
  while ((*s = *t) != '\0') {
    s++;
    t++;
  }
}


x86 assembly (clang, -O0):
<strcpy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <strcpy2+0x48>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <strcpy2+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy2>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     111f <strcpy2+0x1f>
mov    $0x1,%eax
nopl   (%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy2+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy2(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %0, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int fcntl(int, int, int);
int fcntl_int_int(int fd, int cmd, int arg) { return fcntl(fd, cmd, arg); }


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

x86 assembly (clang, -O2):
<fcntl_int_int>:
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
define i32 @fcntl_int_int(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @fcntl(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fcntl_int_int(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ h_errno;
char *hstrerror(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void herror(const char *msg) {
  fprintf(stderr, "%s: %s\n", msg, hstrerror(h_errno));
}


x86 assembly (clang, -O0):
<herror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <hstrerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<herror>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%ebp
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <hstrerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@h_errno = global i32 0
define void @herror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @h_errno
%6 = call i8* @hstrerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@h_errno = global i32 0
define void @herror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @h_errno
%4 = tail call i8* @hstrerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
/* Variables and functions */
unsigned long pq_FNV1a(char *);
unsigned long pq_index_hash(char *key, unsigned long size) {
  unsigned long index;
  unsigned long hval;
  hval = pq_FNV1a(key);
  index = hval % size;
  return index;
}


x86 assembly (clang, -O0):
<pq_index_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pq_FNV1a@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pq_index_hash>:
push   %rbx
mov    %rsi,%rbx
call   1030 <pq_FNV1a@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     112f <pq_index_hash+0x1f>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @pq_index_hash(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = call i64 @pq_FNV1a(i8* %7)
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = load i64, i64* %4
%11 = urem i64 %9, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @pq_index_hash(i8* %0, i64 %1) {
%3 = tail call i64 @pq_FNV1a(i8* %0)
%4 = urem i64 %3, %1
ret i64 %4
}
int test_imm_31int32_mem(int *val) {
  return ((*val) & (0x31 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_31int32_mem>:
testb  $0x31,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_31int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 49
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int iso_8859_1_write(uint32_t code_point, char *string) {
  if (code_point <= 0xFF) {
    string[0] = (char)code_point;
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<iso_8859_1_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     112f <iso_8859_1_write+0x2f>
mov    -0x8(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1136 <iso_8859_1_write+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_8859_1_write>:
xor    %eax,%eax
cmp    $0xff,%edi
jg     1112 <iso_8859_1_write+0x12>
mov    %dil,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @iso_8859_1_write(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 256
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = trunc i32 %0 to i8
store i8 %5, i8* %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stdin;
int main() {
  int c;
  while ((c = fgetc(stdin)) != '\n')
    putchar(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <fgetc@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1156 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1040 <fgetc@plt>
cmp    $0xa,%eax
je     1145 <main+0x25>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* @stdin
%5 = call i32 @fgetc(i32 %4)
store i32 %5, i32* %2
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgetc(i32 %1)
%3 = icmp eq i32 %2, 10
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %2, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = load i32, i32* @stdin
%8 = tail call i32 @fgetc(i32 %7)
%9 = icmp eq i32 %8, 10
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
void McASPRxEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x44)))) |= (0x00000008u);
  while (((*((volatile unsigned int *)(baseAddr + (0x44)))) & (0x00000008u)) !=
         (0x00000008u))
    ;
  (*((volatile unsigned int *)(baseAddr + (0x44)))) |= (0x00000010u);
  while (((*((volatile unsigned int *)(baseAddr + (0x44)))) & (0x00000010u)) !=
         (0x00000010u))
    ;
}


x86 assembly (clang, -O0):
<McASPRxEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x8,%eax
je     1131 <McASPRxEnable+0x31>
jmp    1116 <McASPRxEnable+0x16>
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x10,%eax
je     115b <McASPRxEnable+0x5b>
jmp    1140 <McASPRxEnable+0x40>
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxEnable>:
add    $0x44,%edi
orl    $0x8,(%rdi)
cs nopw 0x0(%rax,%rax,1)
testl  $0x8,(%rdi)
je     1110 <McASPRxEnable+0x10>
orl    $0x10,(%rdi)
nopl   0x0(%rax,%rax,1)
testl  $0x10,(%rdi)
je     1120 <McASPRxEnable+0x20>
ret

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

LLVM IR (-O2):
define void @McASPRxEnable(i32 %0) {
%2 = add i32 %0, 68
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 8
store volatile i32 %6, i32* %4
br label %7
7: ; preds = %7, %1
%8 = load volatile i32, i32* %4
%9 = and i32 %8, 8
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = load volatile i32, i32* %4
%13 = or i32 %12, 16
store volatile i32 %13, i32* %4
br label %14
14: ; preds = %14, %11
%15 = load volatile i32, i32* %4
%16 = and i32 %15, 16
%17 = icmp eq i32 %16, 0
br i1 %17, label %14, label %18
18: ; preds = %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ breakpt();
int /*<<< orphan*/ spacer();
int main() {
  spacer();
  breakpt();
  spacer();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @spacer()
%2 = tail call i32 (...) @breakpt()
%3 = tail call i32 (...) @spacer()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ sg_put_unaligned_be64(scalar_t__, void *);
void sg_nz_put_unaligned_be64(uint64_t val, void *p) {
  if (val)
    sg_put_unaligned_be64(val, p);
}


x86 assembly (clang, -O0):
<sg_nz_put_unaligned_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <sg_nz_put_unaligned_be64+0x28>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sg_put_unaligned_be64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_nz_put_unaligned_be64>:
test   %rdi,%rdi
je     111a <sg_nz_put_unaligned_be64+0xa>
jmp    1030 <sg_put_unaligned_be64@plt>
ret

LLVM IR (-O0):
define void @sg_nz_put_unaligned_be64(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i64, i64* %3
%9 = load i8*, i8** %4
%10 = call i32 @sg_put_unaligned_be64(i64 %8, i8* %9)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @sg_nz_put_unaligned_be64(i64 %0, i8* %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @sg_put_unaligned_be64(i64 %0, i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int bcdToDec(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 97;
  int res = 0;
  for (;;) {
    i++;
    res = bcdToDec(i);
    printf("RES: %d\n", res);
    printf("VAL: %d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x61,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <bcdToDec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x62,%ebx
lea    0xecf(%rip),%r14
lea    0xed1(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <bcdToDec@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [9 x i8] c"RES: %d\0A\00"
@.str.1 = [9 x i8] c"VAL: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 97, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %4, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @bcdToDec(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"RES: %d\0A\00"
@.str.1 = [9 x i8] c"VAL: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 97, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @bcdToDec(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("MT7620 app\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"MT7620 app\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"MT7620 app\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double LN(statlink, x)
int *statlink;
double x;
{ return (_log(x)); }


x86 assembly (clang, -O0):
<LN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <_log@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LN>:
push   %rax
mov    $0x1,%al
call   1030 <_log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @LN(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
store i32* %0, i32** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call i32 (double, ...) bitcast (i32 (...)* @_log to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @LN(i32* nocapture readnone %0, double %1) {
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @_log to i32 (double, ...)*)(double %1)
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void supcon_puts(unsigned char *c) { fputs((const char *)c, stdout); }


x86 assembly (clang, -O0):
<supcon_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supcon_puts>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @supcon_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @supcon_puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_subl_ops();
int /*<<< orphan*/ get_subl_ops_len();
int /*<<< orphan*/ write_bytes(char *, unsigned char *, unsigned int,
                               unsigned int *, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void output_subtract(unsigned char *buf, unsigned int buf_size,
                     unsigned int *bytes_written) {
  write_bytes("subtract", buf, buf_size, bytes_written, get_subl_ops(),
              get_subl_ops_len());
}


x86 assembly (clang, -O0):
<output_subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <get_subl_ops@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <get_subl_ops_len@plt>
mov    -0x38(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    %eax,%r9d
lea    0xe7d(%rip),%rdi
call   1030 <write_bytes@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_subtract>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <get_subl_ops@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <get_subl_ops_len@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
mov    %ebp,%r8d
mov    %eax,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <write_bytes@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"subtract\00"
define void @output_subtract(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 (...) @get_subl_ops()
%11 = call i32 (...) @get_subl_ops_len()
%12 = call i32 @write_bytes(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i32* %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"subtract\00"
define void @output_subtract(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 (...) @get_subl_ops()
%5 = tail call i32 (...) @get_subl_ops_len()
%6 = tail call i32 @write_bytes(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32* %2, i32 %4, i32 %5)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ Sendto(int, char *, unsigned int, int /*<<< orphan*/,
                          struct sockaddr const *, int /*<<< orphan*/);
int /*<<< orphan*/ pack_uint32(long, char *, unsigned int *);
void metaserver_terminate(int sockfd, const struct sockaddr *servaddr,
                          socklen_t servlen) {
  char mesg[4096];
  unsigned int packet_size = 0;
  pack_uint32((long)6, mesg, &packet_size);
  Sendto(sockfd, mesg, packet_size, 0, servaddr, servlen);
}


x86 assembly (clang, -O0):
<metaserver_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1024(%rbp)
lea    -0x1020(%rbp),%rsi
mov    $0x6,%edi
lea    -0x1024(%rbp),%rdx
call   1030 <pack_uint32@plt>
mov    -0x4(%rbp),%edi
lea    -0x1020(%rbp),%rsi
mov    -0x1024(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
xor    %ecx,%ecx
call   1040 <Sendto@plt>
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metaserver_terminate>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1018,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%rdx
mov    $0x6,%edi
mov    %r15,%rsi
call   1030 <pack_uint32@plt>
mov    0xc(%rsp),%edx
mov    %ebp,%edi
mov    %r15,%rsi
xor    %ecx,%ecx
mov    %rbx,%r8
mov    %r14d,%r9d
call   1040 <Sendto@plt>
add    $0x1018,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define void @metaserver_terminate(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca [4096 x i8]
%8 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
store i32 0, i32* %8
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%10 = call i32 @pack_uint32(i64 6, i8* %9, i32* %8)
%11 = load i32, i32* %4
%12 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%13 = load i32, i32* %8
%14 = load %struct.sockaddr*, %struct.sockaddr** %5
%15 = load i32, i32* %6
%16 = call i32 @Sendto(i32 %11, i8* %12, i32 %13, i32 0, %struct.sockaddr* %14, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define void @metaserver_terminate(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca [4096 x i8]
%5 = alloca i32
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%7 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%8 = call i32 @pack_uint32(i64 6, i8* %6, i32* %5)
%9 = load i32, i32* %5
%10 = call i32 @Sendto(i32 %0, i8* %6, i32 %9, i32 0, %struct.sockaddr* %1, i32 %2)
ret void
}
unsigned modnn(unsigned x) {
  while (x >= 255) {
    x -= 255;
    x = (x >> 8) + (x & 255);
  }
  return x;
}


x86 assembly (clang, -O0):
<modnn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jb     1138 <modnn+0x38>
mov    -0x4(%rbp),%eax
sub    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <modnn+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modnn>:
mov    %edi,%eax
cmp    $0xff,%edi
jb     1126 <modnn+0x26>
nopw   0x0(%rax,%rax,1)
add    $0xffffff01,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
movzbl %al,%eax
add    %ecx,%eax
cmp    $0xfe,%eax
ja     1110 <modnn+0x10>
ret

LLVM IR (-O0):
define i32 @modnn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp uge i32 %4, 255
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sub i32 %7, 255
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = lshr i32 %9, 8
%11 = load i32, i32* %2
%12 = and i32 %11, 255
%13 = add i32 %10, %12
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @modnn(i32 %0) {
%2 = icmp ugt i32 %0, 254
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = add i32 %4, -255
%6 = lshr i32 %5, 8
%7 = and i32 %5, 255
%8 = add nuw nsw i32 %6, %7
%9 = icmp ugt i32 %8, 254
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ %0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Found A\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Found A\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 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Found A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("\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>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @usage() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pdump(int);
int /*<<< orphan*/ printf(char *);
extern void preferred_key_server(int len) {
  printf("\t\tURL - ");
  pdump(len);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<preferred_key_server>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <pdump@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\09\09URL - \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @preferred_key_server(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @pdump(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\09\09URL - \00"
define void @preferred_key_server(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pdump(i32 %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1(int **);
int /*<<< orphan*/ f2(int *);
int /*<<< orphan*/ free(int *);
int main(void) {
  int *p;
  f1(&p);
  *p = 4;
  f2(p);
  free(p);
  f2(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1050 <f1@plt>
mov    -0x10(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <f2@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <f2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1050 <f1@plt>
mov    (%rsp),%rdi
movl   $0x4,(%rdi)
call   1030 <f2@plt>
mov    (%rsp),%rdi
call   1040 <free@plt>
mov    (%rsp),%rdi
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 @f1(i32** %2)
%4 = load i32*, i32** %2
store i32 4, i32* %4
%5 = load i32*, i32** %2
%6 = call i32 @f2(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @free(i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @f2(i32* %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @f1(i32** %1)
%4 = load i32*, i32** %1
store i32 4, i32* %4
%5 = call i32 @f2(i32* %4)
%6 = load i32*, i32** %1
%7 = call i32 @free(i32* %6)
%8 = load i32*, i32** %1
%9 = call i32 @f2(i32* %8)
ret i32 0
}