xunge/DecIR huggingface dataset:
/* Variables and functions */
char *capitalizeInverse(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char input[1000];
  gets(input);
  printf("%s", capitalizeInverse(input));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x3f0(%rbp),%rdi
call   1050 <capitalizeInverse@plt>
mov    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1050 <capitalizeInverse@plt>
lea    0xeae(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i8* @capitalizeInverse(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i8* @capitalizeInverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
void s3c6410_default_sdhci2(void) {}


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

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

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

LLVM IR (-O2):
define void @s3c6410_default_sdhci2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%.4lf\n", fun(n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fun(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENXIO;
int /*<<< orphan*/ errno;
char *inet_ntoa(void *in) {
  errno = ENXIO;
  return NULL;
}


x86 assembly (clang, -O0):
<inet_ntoa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_ntoa>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
@errno = global i32 0
define i8* @inet_ntoa(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENXIO
store i32 %3, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENXIO = global i32 0
@errno = global i32 0
define noalias i8* @inet_ntoa(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENXIO
store i32 %2, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ skip(char *, char);
int /*<<< orphan*/ sout(char *, char *);
void parsein(char *s) {
  skip(s, '\n');
  skip(s, '\r');
  sout("%s", s);
}


x86 assembly (clang, -O0):
<parsein>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <skip@plt>
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <skip@plt>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <sout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsein>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <skip@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <skip@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <sout@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @parsein(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @skip(i8* %3, i8 signext 10)
%5 = load i8*, i8** %2
%6 = call i32 @skip(i8* %5, i8 signext 13)
%7 = load i8*, i8** %2
%8 = call i32 @sout(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @parsein(i8* %0) {
%2 = tail call i32 @skip(i8* %0, i8 signext 10)
%3 = tail call i32 @skip(i8* %0, i8 signext 13)
%4 = tail call i32 @sout(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void null_load(void) {}


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

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

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

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

/* Variables and functions */
int uisdigit(wchar_t c) { return c >= L'0' && c <= L'9'; }


x86 assembly (clang, -O0):
<uisdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <uisdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uisdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @uisdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @uisdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *getenv(char const *);
char *checkenv(const char *env) {
  char *envstr;
  if ((envstr = getenv(env)) == NULL)
    return (NULL);
  while (*envstr == ' ')
    envstr++;
  if (*envstr == '\0')
    return (NULL);
  return (envstr);
}


x86 assembly (clang, -O0):
<checkenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1140 <checkenv+0x30>
movq   $0x0,-0x8(%rbp)
jmp    118b <checkenv+0x7b>
jmp    1145 <checkenv+0x35>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1166 <checkenv+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <checkenv+0x35>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1183 <checkenv+0x73>
movq   $0x0,-0x8(%rbp)
jmp    118b <checkenv+0x7b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkenv>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     1132 <checkenv+0x22>
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
cmp    $0x20,%cl
jne    112e <checkenv+0x1e>
add    $0x1,%rax
jmp    1120 <checkenv+0x10>
test   %cl,%cl
jne    1134 <checkenv+0x24>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @checkenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %7
%5 = phi i8* [ %8, %7 ], [ %2, %1 ]
%6 = load i8, i8* %5
switch i8 %6, label %10 [
i8 32, label %7
i8 0, label %9
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
9: ; preds = %4
br label %10
10: ; preds = %4, %9, %1
%11 = phi i8* [ null, %1 ], [ null, %9 ], [ %5, %4 ]
ret i8* %11
}
/* Variables and functions */
void Reserved_Handler24(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler24>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler24+0x9>
jmp    1109 <Reserved_Handler24+0x9>

x86 assembly (clang, -O2):
<Reserved_Handler24>:
jmp    1100 <Reserved_Handler24>

LLVM IR (-O0):
define void @Reserved_Handler24() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler24() {
br label %1
1: ; preds = %0, %1
br label %1
}
int min(int a, int b, int c) {
  if (a <= b && a <= c)
    return a;
  if (b <= a && b <= c)
    return b;
  return c;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1130 <min+0x30>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1130 <min+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <min+0x59>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1153 <min+0x53>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1153 <min+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <min+0x59>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
cmp    %edx,%esi
mov    %esi,%ecx
cmovg  %edx,%ecx
cmp    %edi,%esi
cmovg  %edx,%ecx
cmp    %edx,%edi
mov    %edi,%eax
cmovg  %ecx,%eax
cmp    %esi,%edi
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = or i1 %4, %5
%7 = icmp sgt i32 %1, %0
%8 = icmp sgt i32 %1, %2
%9 = or i1 %7, %8
%10 = select i1 %9, i32 %2, i32 %1
%11 = select i1 %6, i32 %10, i32 %0
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ lua_lua2C(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ lua_tag(int /*<<< orphan*/);
void luatag(void) { lua_pushnumber(lua_tag(lua_lua2C(1))); }


x86 assembly (clang, -O0):
<luatag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <lua_lua2C@plt>
mov    %eax,%edi
call   1040 <lua_tag@plt>
mov    %eax,%edi
call   1030 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luatag>:
push   %rax
mov    $0x1,%edi
call   1050 <lua_lua2C@plt>
mov    %eax,%edi
call   1040 <lua_tag@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @luatag() {
%1 = call i32 @lua_lua2C(i32 1)
%2 = call i32 @lua_tag(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @luatag() {
%1 = tail call i32 @lua_lua2C(i32 1)
%2 = tail call i32 @lua_tag(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_nnseti(char *, int);
void nnseti_(char *pnam, int *ival) { c_nnseti(pnam, *ival); }


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

x86 assembly (clang, -O2):
<nnseti_>:
mov    (%rsi),%esi
jmp    1030 <c_nnseti@plt>

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

LLVM IR (-O2):
define void @nnseti_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @c_nnseti(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ def_prog_mode();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ reset_prog_mode();
int /*<<< orphan*/ system(char *);
void run_command(char *command) {
  def_prog_mode();
  endwin();
  system(command);
  reset_prog_mode();
}


x86 assembly (clang, -O0):
<run_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <def_prog_mode@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1040 <reset_prog_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_command>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <def_prog_mode@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <reset_prog_mode@plt>

LLVM IR (-O0):
define void @run_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @def_prog_mode()
%4 = call i32 (...) @endwin()
%5 = load i8*, i8** %2
%6 = call i32 @system(i8* %5)
%7 = call i32 (...) @reset_prog_mode()
ret void
}

LLVM IR (-O2):
define void @run_command(i8* nocapture %0) {
%2 = tail call i32 (...) @def_prog_mode()
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @system(i8* %0)
%5 = tail call i32 (...) @reset_prog_mode()
ret void
}
swap(first, second) register long *first, *second;
{
  register long tmp;
  tmp = *first;
  *first = *second;
  *second = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap(i64* %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
store i64* %0, i64** %4
store i64* %1, i64** %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
store i64 %8, i64* %6
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = load i64*, i64** %4
store i64 %10, i64* %11
%12 = load i64, i64* %6
%13 = load i64*, i64** %5
store i64 %12, i64* %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
store i64 %4, i64* %0
store i64 %3, i64* %1
ret i32 undef
}
/* Variables and functions */
size_t bitcount(unsigned long num) {
  size_t count = 0;
  while (num > 0) {
    count++;
    num &= num - 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    113c <bitcount+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <bitcount+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %rdi,%rdi
je     111d <bitcount+0x1d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
lea    -0x1(%rdi),%rcx
and    %rcx,%rdi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i64 @bitcount(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %8, %3 ], [ %0, %1 ]
%6 = add i64 %4, 1
%7 = add i64 %5, -1
%8 = and i64 %7, %5
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %11
}
int main(void) {
  int a = "test";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 ptrtoint ([5 x i8]* @.str to i32), i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_0() {
  char *x = "abc";
  char *y = "Abc";
  clang_analyzer_eval(strcasecmp(x, y) == 0);
}


x86 assembly (clang, -O0):
<strcasecmp_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp_0>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strcasecmp_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strcasecmp(i8* %3, i8* %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"Abc\00"
define void @strcasecmp_0() {
%1 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
int setup_V() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setup_V() {
ret i32 0
}
unsigned isUSR(const char *s) { return s[0] == 'c' && s[1] == ':'; }


x86 assembly (clang, -O0):
<isUSR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x63,%ecx
mov    %al,-0x9(%rbp)
jne    112e <isUSR+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUSR>:
xor    %eax,%eax
cmpb   $0x63,(%rdi)
jne    1110 <isUSR+0x10>
xor    %eax,%eax
cmpb   $0x3a,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isUSR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 99
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 58
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isUSR(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 99
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 58
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_read_next_solution(int n, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc4c(135, &n, m, sol, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_read_next_solution>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x87,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @solcon_read_next_solution(i32 %0, i32* %1, double* %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 135, i32* %4, i32* %1, double* %2, i32 0)
ret i32 %5
}
int f(_Bool x) { return (x != 0); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i1 zeroext %0) {
%2 = zext i1 %0 to i32
ret i32 %2
}
void ft_swapd(double *p1, double *p2) {
  double t;
  t = *p1;
  *p1 = *p2;
  *p2 = t;
}


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

x86 assembly (clang, -O2):
<ft_swapd>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

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

LLVM IR (-O2):
define void @ft_swapd(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
/* Variables and functions */
char const *fileinfoname(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ get_data_dirs();
const char *datafilename(const char *filename) {
  return fileinfoname(get_data_dirs(), filename);
}


x86 assembly (clang, -O0):
<datafilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_data_dirs@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <fileinfoname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<datafilename>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <get_data_dirs@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fileinfoname@plt>

LLVM IR (-O0):
define i8* @datafilename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @get_data_dirs()
%4 = load i8*, i8** %2
%5 = call i8* @fileinfoname(i32 %3, i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @datafilename(i8* %0) {
%2 = tail call i32 (...) @get_data_dirs()
%3 = tail call i8* @fileinfoname(i32 %2, i8* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: kallsyms [--all-symbols] "
                  "[--symbol-prefix=<prefix char>] "
                  "[--page-offset=<CONFIG_PAGE_OFFSET>] "
                  "[--base-relative] < in.map > out.S\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [137 x i8] c"Usage: kallsyms [--all-symbols] [--symbol-prefix=<prefix char>] [--page-offset=<CONFIG_PAGE_OFFSET>] [--base-relative] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [137 x i8] c"Usage: kallsyms [--all-symbols] [--symbol-prefix=<prefix char>] [--page-offset=<CONFIG_PAGE_OFFSET>] [--base-relative] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ munmap(void *, size_t);
int /*<<< orphan*/ perror(char *);
void free_interleaved(void *addr, size_t length) {
  if (munmap(addr, length) < 0) {
    perror("munmap");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<free_interleaved>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
cmp    $0x0,%rax
jge    116d <free_interleaved+0x3d>
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_interleaved>:
push   %rax
call   1030 <munmap@plt>
test   %rax,%rax
js     113d <free_interleaved+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"munmap\00"
define void @free_interleaved(i8* %0, i64 %1) {
%3 = tail call i64 @munmap(i8* %0, i64 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
void BN_is_prime_ex(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_is_prime_ex() {
ret void
}
/* Type definitions */
struct r_file_id {
  int dummy;
};

/* Variables and functions */
bool _dl_get_file_id(int fd __attribute__((unused)),
                     struct r_file_id *id __attribute__((unused))) {
  return true;
}


x86 assembly (clang, -O0):
<_dl_get_file_id>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.r_file_id = type { i32 }
define i32 @_dl_get_file_id(i32 %0, %struct.r_file_id* %1) {
%3 = alloca i32
%4 = alloca %struct.r_file_id*
store i32 %0, i32* %3
store %struct.r_file_id* %1, %struct.r_file_id** %4
ret i32 1
}

LLVM IR (-O2):
%struct.r_file_id = type { i32 }
define i32 @_dl_get_file_id(i32 %0, %struct.r_file_id* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void overflow() {
  char *p = (char *)malloc(4);
  strcpy(p, "hello world");
  free(p);
  printf("%s\n", p);
}


x86 assembly (clang, -O0):
<overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<overflow>:
push   %rbx
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @overflow() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @overflow() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *realloc(void *, size_t);
void *get_memory(void *prev_addr, int n, size_t size) {
  if (n == 0)
    return ((void *)NULL);
  if (prev_addr)
    return (realloc((void *)prev_addr, (size_t)(n * size)));
  else
    return (calloc((size_t)n, (size_t)size));
}


x86 assembly (clang, -O0):
<get_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114a <get_memory+0x2a>
movq   $0x0,-0x8(%rbp)
jmp    1181 <get_memory+0x61>
cmpq   $0x0,-0x10(%rbp)
je     1170 <get_memory+0x50>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1181 <get_memory+0x61>
movslq -0x14(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_memory>:
test   %esi,%esi
je     1135 <get_memory+0x15>
movslq %esi,%rsi
test   %rdi,%rdi
je     1138 <get_memory+0x18>
imul   %rdx,%rsi
jmp    1040 <realloc@plt>
xor    %eax,%eax
ret
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @get_memory(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = icmp eq i8* %0, null
%7 = sext i32 %1 to i64
br i1 %6, label %11, label %8
8: ; preds = %5
%9 = mul i64 %7, %2
%10 = tail call i8* @realloc(i8* %0, i64 %9)
br label %13
11: ; preds = %5
%12 = tail call i8* @calloc(i64 %7, i64 %2)
br label %13
13: ; preds = %3, %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ], [ null, %3 ]
ret i8* %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void I2CSlaveFIFODisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000804))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveFIFODisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x804,%eax
cltq
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveFIFODisable>:
movslq %edi,%rax
movl   $0x1,0x804(%rax)
ret

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

LLVM IR (-O2):
define void @I2CSlaveFIFODisable(i32 %0) {
%2 = add nsw i32 %0, 2052
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 1, i32* %4
ret void
}
int foo(void) {
  int a[2], b[2], c[2];
  int *ap = &a[0];
  int *bp = &b[0];
  int *cp = &c[0];
#pragma omp parallel for
  for (unsigned int idx = 0; idx < 2; idx++) {
    ap[idx] = 1;
    bp[idx] = 2;
    cp[idx] = ap[idx];
  }
  return *cp;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jae    116b <foo+0x6b>
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
movl   $0x1,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
movl   $0x2,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1123 <foo+0x23>
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 1
}
/* Variables and functions */
char *strdup(char *);
void parseARGHINTfile(char *hint, char **argfile) {
  *argfile = strdup(hint);
  return;
}


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

x86 assembly (clang, -O2):
<parseARGHINTfile>:
push   %rbx
mov    %rsi,%rbx
call   1030 <strdup@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @parseARGHINTfile(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 i8* @strdup(i8* %5)
%7 = load i8**, i8*** %4
store i8* %6, i8** %7
ret void
}

LLVM IR (-O2):
define void @parseARGHINTfile(i8* nocapture %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @strdup(i8* %0)
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
scalar_t__ trunc(double);
int TRUNC(double x) { return (int)trunc(x); }


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

x86 assembly (clang, -O2):
<TRUNC>:
jmp    1030 <trunc@plt>

LLVM IR (-O0):
define i32 @TRUNC(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @trunc(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @TRUNC(double %0) {
%2 = tail call i64 @trunc(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int my_strlen(char *str) {
  int length = 0;
  while (*str++)
    length++;
  return length;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <my_strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111c <my_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
yyErr(n, l) { yyAbort(n, "cyfront", l); }


x86 assembly (clang, -O0):
<yyErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <yyAbort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyErr>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <yyAbort@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"cyfront\00"
define i32 @yyErr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"cyfront\00"
define i32 @yyErr(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void fmtchk(char *fmt) {
  static char *sccsid = "this is a test...";
  (void)fputs(fmt, stdout);
  (void)printf(":\t`");
  (void)printf(fmt, 0x12);
  (void)printf("'\n");
}


x86 assembly (clang, -O0):
<fmtchk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x12,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmtchk>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1050 <fputs@plt>
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@fmtchk.sccsid = internal global i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i32 0, i32 0)
@.str = [18 x i8] c"this is a test...\00"
@stdout = global i32 0
@.str.1 = [4 x i8] c":\09`\00"
@.str.2 = [3 x i8] c"'\0A\00"
define void @fmtchk(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)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* %7, i32 18)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [4 x i8] c":\09`\00"
@str = [2 x i8] c"'\00"
define void @fmtchk(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 18)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void displayText(char *text) {
  printf(text);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<displayText>:
push   %rax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @displayText(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ strchr(char const *, char);
void purge_stdin(const char *s) {
  int c;
  if (!strchr(s, '\n'))
    while ((c = getchar()) != '\n')
      ;
}


x86 assembly (clang, -O0):
<purge_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
jne    1165 <purge_stdin+0x45>
jmp    1148 <purge_stdin+0x28>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1160 <purge_stdin+0x40>
jmp    1148 <purge_stdin+0x28>
jmp    1165 <purge_stdin+0x45>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<purge_stdin>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %eax,%eax
jne    113c <purge_stdin+0x1c>
nop
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1130 <purge_stdin+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @purge_stdin(i8* %0) {
%2 = tail call i32 @strchr(i8* %0, i8 signext 10)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1, %4
%5 = tail call i32 (...) @getchar()
%6 = icmp eq i32 %5, 10
br i1 %6, label %7, label %4
7: ; preds = %4, %1
ret void
}