xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int sum = 0;
  for (int i = 0; i <= 100; i++) {
    sum += i;
  }
  printf("Anwser: %d\n", sum);
  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)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x64,-0x18(%rbp)
jg     1155 <main+0x45>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Anwser: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %15, %2
%9 = load i32, i32* %7
%10 = icmp sle i32 %9, 100
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = add nsw i32 %13, %12
store i32 %14, i32* %6
br label %15
15: ; preds = %11
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
br label %8
18: ; preds = %8
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Anwser: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Variables and functions */
int lseek(int, unsigned int, unsigned int);
int my_lseek(int I_iFd, unsigned int I_uiOffset, unsigned int I_uiOrigin) {
  int iRet;
  iRet = lseek(I_iFd, I_uiOffset, I_uiOrigin);
  return iRet;
}


x86 assembly (clang, -O0):
<my_lseek>:
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 <lseek@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_lseek>:
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define i32 @my_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nHello Test!\n\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 = [15 x i8] c"\0AHello Test!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"\0AHello Test!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *compareVer(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int main(int argc, char *argv[]) {
  char *v1 = "321.10.9.1";
  char *v2 = "321.10.1.0";
  printf("%s is %s than %s", v1, compareVer(v1, v2), v2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <compareVer@plt>
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
mov    -0x20(%rbp),%rcx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed9(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <compareVer@plt>
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %r14,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"321.10.9.1\00"
@.str.1 = [11 x i8] c"321.10.1.0\00"
@.str.2 = [17 x i8] c"%s is %s than %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @compareVer(i8* %8, i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %10, i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"321.10.9.1\00"
@.str.1 = [11 x i8] c"321.10.1.0\00"
@.str.2 = [17 x i8] c"%s is %s than %s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @compareVer(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mtspr(int, int /*<<< orphan*/);
void int_clear_all_pending(void) { mtspr(((9 << (11)) + 2), 0); }


x86 assembly (clang, -O0):
<int_clear_all_pending>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4802,%edi
xor    %esi,%esi
call   1030 <mtspr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_clear_all_pending>:
mov    $0x4802,%edi
xor    %esi,%esi
jmp    1030 <mtspr@plt>

LLVM IR (-O0):
define void @int_clear_all_pending() {
%1 = call i32 @mtspr(i32 18434, i32 0)
ret void
}

LLVM IR (-O2):
define void @int_clear_all_pending() {
%1 = tail call i32 @mtspr(i32 18434, i32 0)
ret void
}
/* Variables and functions */
int toi(int /*<<< orphan*/);
int /*<<< orphan*/ tolower(unsigned char const);
int hextoi(const unsigned char *s) {
  return (toi(tolower(s[0])) << 4) | toi(tolower(s[1]));
}


x86 assembly (clang, -O0):
<hextoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %eax,%edi
call   1040 <toi@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <tolower@plt>
mov    %eax,%edi
call   1040 <toi@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hextoi>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movzbl (%rdi),%edi
call   1030 <tolower@plt>
mov    %eax,%edi
call   1040 <toi@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movzbl 0x1(%rbx),%edi
call   1030 <tolower@plt>
mov    %eax,%edi
call   1040 <toi@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hextoi(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 = call i32 @tolower(i8 zeroext %5)
%7 = call i32 @toi(i32 %6)
%8 = shl i32 %7, 4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = call i32 @tolower(i8 zeroext %11)
%13 = call i32 @toi(i32 %12)
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @hextoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @tolower(i8 zeroext %2)
%4 = tail call i32 @toi(i32 %3)
%5 = shl i32 %4, 4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = tail call i32 @tolower(i8 zeroext %7)
%9 = tail call i32 @toi(i32 %8)
%10 = or i32 %9, %5
ret i32 %10
}
long fun_si64(long a, long b) { return a; }


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

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

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

LLVM IR (-O2):
define i64 @fun_si64(i64 returned %0, i64 %1) {
ret i64 %0
}
int main(void) {
  int i, j;
  i = 1;
  j = 1;
  i += i + (j += i + j);
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
add    -0xc(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
add    %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
char *timespec_str(struct timespec a) {
  char *buf = malloc(64);
  assert(buf);
  snprintf(buf, 64, "%lu.%09ld", a.tv_sec, a.tv_nsec);
  return buf;
}


x86 assembly (clang, -O0):
<timespec_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x40,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x40,%esi
lea    0xe96(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %rdi,%r15
shr    $0x20,%r15
mov    $0x40,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
lea    0xea5(%rip),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@.str = [10 x i8] c"%lu.%09ld\00"
define i8* @timespec_str(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i8*
%4 = bitcast %struct.timespec* %2 to i64*
store i64 %0, i64* %4
%5 = call i8* @malloc(i32 64)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @snprintf(i8* %8, i32 64, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"%lu.%09ld\00"
define i8* @timespec_str(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i64 %0, 32
%4 = trunc i64 %3 to i32
%5 = tail call dereferenceable_or_null(64) i8* @malloc(i32 64)
%6 = tail call i32 @assert(i8* %5)
%7 = tail call i32 @snprintf(i8* %5, i32 64, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %2)
ret i8* %5
}
int func(void) {
  int n = 3;
  int m = 5;
  n + m;
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
int SDL_imageFilterMultDivby4MMX(unsigned char *Src1, unsigned char *Src2,
                                 unsigned char *Dest, unsigned int SrcLength) {
  return (-1);
}


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

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

LLVM IR (-O0):
define i32 @SDL_imageFilterMultDivby4MMX(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterMultDivby4MMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
void left_trim_serial_number(char *serial_number, int desired_digits) {
  serial_number[desired_digits] = '\0';
}


x86 assembly (clang, -O0):
<left_trim_serial_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_trim_serial_number>:
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @left_trim_serial_number(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @left_trim_serial_number(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
char lower(char c) { return (c >= 65 && c <= 90) ? c += 32 : c; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1139 <lower+0x39>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1139 <lower+0x39>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <lower+0x40>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
%15 = sext i8 %14 to i32
br label %19
16: ; preds = %6, %1
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
br label %19
19: ; preds = %16, %10
%20 = phi i32 [ %15, %10 ], [ %18, %16 ]
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void nand(void) { printf("In the nand\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"In the nand\00"
define void @nand() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void cvmx_pko_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @cvmx_pko_disable() {
ret void
}
void check_float(float *x, float *y, char *ret) {
  *ret = ((char *)y) - ((char *)x) == sizeof(*x) ? 't' : 'f';
}


x86 assembly (clang, -O0):
<check_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
sub    %rax,%rdx
mov    $0x66,%eax
mov    $0x74,%ecx
cmp    $0x4,%rdx
cmove  %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_float>:
sub    %rdi,%rsi
cmp    $0x4,%rsi
mov    $0x74,%eax
mov    $0x66,%ecx
cmove  %eax,%ecx
mov    %cl,(%rdx)
ret

LLVM IR (-O0):
define void @check_float(float* %0, float* %1, i8* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i8*
store float* %0, float** %4
store float* %1, float** %5
store i8* %2, i8** %6
%7 = load float*, float** %5
%8 = bitcast float* %7 to i8*
%9 = load float*, float** %4
%10 = bitcast float* %9 to i8*
%11 = ptrtoint i8* %8 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
%14 = icmp eq i64 %13, 4
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 116, i32 102
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %6
store i8 %17, i8* %18
ret void
}

LLVM IR (-O2):
define void @check_float(float* %0, float* %1, i8* nocapture writeonly %2) {
%4 = ptrtoint float* %1 to i64
%5 = ptrtoint float* %0 to i64
%6 = sub i64 %4, %5
%7 = icmp eq i64 %6, 4
%8 = select i1 %7, i8 116, i8 102
store i8 %8, i8* %2
ret void
}
int _dup(d) { return __xdup(d, 0); }


x86 assembly (clang, -O0):
<_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <__xdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dup>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <__xdup@plt>

LLVM IR (-O0):
define i32 @_dup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__xdup to i32 (i32, i32, ...)*)(i32 %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @_dup(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__xdup to i32 (i32, i32, ...)*)(i32 %0, i32 0)
ret i32 %2
}
void for_exit2() { printf("%s [%s]\n", __func__, "atexit"); }


x86 assembly (clang, -O0):
<for_exit2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xeea(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<for_exit2>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xeee(%rip),%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%s [%s]\0A\00"
@__func__.for_exit2 = [10 x i8] c"for_exit2\00"
@.str.1 = [7 x i8] c"atexit\00"
define void @for_exit2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.for_exit2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void or (struct forth_instance * fi) { st_push(fi, st_pop(fi) | st_pop(fi)); }


x86 assembly (clang, -O0):
<or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <st_pop@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <st_pop@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdi
or     %eax,%esi
mov    $0x0,%al
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <st_pop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <st_pop@plt>
or     %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type opaque
define void @or(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i32 (%struct.forth_instance*, ...) bitcast (i32 (...)* @st_pop to i32 (%struct.forth_instance*, ...)*)(%struct.forth_instance* %4)
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = call i32 (%struct.forth_instance*, ...) bitcast (i32 (...)* @st_pop to i32 (%struct.forth_instance*, ...)*)(%struct.forth_instance* %6)
%8 = or i32 %5, %7
%9 = call i32 (%struct.forth_instance*, i32, ...) bitcast (i32 (...)* @st_push to i32 (%struct.forth_instance*, i32, ...)*)(%struct.forth_instance* %3, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type opaque
define void @or(%struct.forth_instance* %0) {
%2 = tail call i32 (%struct.forth_instance*, ...) bitcast (i32 (...)* @st_pop to i32 (%struct.forth_instance*, ...)*)(%struct.forth_instance* %0)
%3 = tail call i32 (%struct.forth_instance*, ...) bitcast (i32 (...)* @st_pop to i32 (%struct.forth_instance*, ...)*)(%struct.forth_instance* %0)
%4 = or i32 %3, %2
%5 = tail call i32 (%struct.forth_instance*, i32, ...) bitcast (i32 (...)* @st_push to i32 (%struct.forth_instance*, i32, ...)*)(%struct.forth_instance* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move_current(int /*<<< orphan*/);
int /*<<< orphan*/ to_point(int, int /*<<< orphan*/);
int move_right() {
  move_current(to_point(1, 0));
  return 1;
}


x86 assembly (clang, -O0):
<move_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <to_point@plt>
mov    %eax,%edi
call   1040 <move_current@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_right>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <to_point@plt>
mov    %eax,%edi
call   1040 <move_current@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @move_right() {
%1 = call i32 @to_point(i32 1, i32 0)
%2 = call i32 @move_current(i32 %1)
ret i32 1
}

LLVM IR (-O2):
define i32 @move_right() {
%1 = tail call i32 @to_point(i32 1, i32 0)
%2 = tail call i32 @move_current(i32 %1)
ret i32 1
}
double MAP_MTENT(double x_n, int iteration) {
  if (x_n < 0.7)
    return (x_n / 0.7);
  else
    return ((10.0 / 3.0) * (1.0 - x_n));
}


x86 assembly (clang, -O0):
<MAP_MTENT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  0xeec(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113a <MAP_MTENT+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1158 <MAP_MTENT+0x58>
movsd  0xece(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAP_MTENT>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1117 <MAP_MTENT+0x17>
divsd  0xeea(%rip),%xmm0
ret
movsd  0xee9(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xee5(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @MAP_MTENT(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load double, double* %4
%7 = fcmp olt double %6, 0x3FE6666666666666
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double, double* %4
%10 = fdiv double %9, 0x3FE6666666666666
store double %10, double* %3
br label %15
11: ; preds = %2
%12 = load double, double* %4
%13 = fsub double 1.000000e+00, %12
%14 = fmul double 0x400AAAAAAAAAAAAB, %13
store double %14, double* %3
br label %15
15: ; preds = %11, %8
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @MAP_MTENT(double %0, i32 %1) {
%3 = fcmp olt double %0, 0x3FE6666666666666
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = fdiv double %0, 0x3FE6666666666666
br label %9
6: ; preds = %2
%7 = fsub double 1.000000e+00, %0
%8 = fmul double %7, 0x400AAAAAAAAAAAAB
br label %9
9: ; preds = %6, %4
%10 = phi double [ %5, %4 ], [ %8, %6 ]
ret double %10
}
int do_683() { return 683; }


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

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

LLVM IR (-O0):
define i32 @do_683() {
ret i32 683
}

LLVM IR (-O2):
define i32 @do_683() {
ret i32 683
}
int test_imm_90uint8_mem(unsigned char *val) {
  return ((*val) & (-0x90 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_90uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 112
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void GB_InterruptsEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @GB_InterruptsEnd() {
ret void
}
int my_strlen(char const *str) {
  int i = 0;
  while (str[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen+0x32>
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>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
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 = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ mcfetch(int /*<<< orphan*/);
int /*<<< orphan*/ mpop();
int /*<<< orphan*/ mpush(int /*<<< orphan*/);
void cat() { mpush(mcfetch(mpop())); }


x86 assembly (clang, -O0):
<cat>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mpop@plt>
mov    %eax,%edi
call   1050 <mcfetch@plt>
mov    %eax,%edi
call   1040 <mpush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat>:
push   %rax
xor    %eax,%eax
call   1030 <mpop@plt>
mov    %eax,%edi
call   1050 <mcfetch@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <mpush@plt>

LLVM IR (-O0):
define void @cat() {
%1 = call i32 (...) @mpop()
%2 = call i32 @mcfetch(i32 %1)
%3 = call i32 @mpush(i32 %2)
ret void
}

LLVM IR (-O2):
define void @cat() {
%1 = tail call i32 (...) @mpop()
%2 = tail call i32 @mcfetch(i32 %1)
%3 = tail call i32 @mpush(i32 %2)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_read_dobldobl_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(550, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_read_dobldobl_Laurent_system>:
mov    $0x226,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @syscon_read_dobldobl_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 550, i32* undef, i32* undef, double* undef)
ret i32 %1
}
history() {}


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

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

LLVM IR (-O0):
define i32 @history() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @history() {
ret i32 undef
}
void do_nothing(int k, int i, int j) {
  (void)i;
  (void)j;
  (void)k;
}


x86 assembly (clang, -O0):
<do_nothing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_nothing(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadByte(int /*<<< orphan*/, int);
uint8_t wiznetGetSocketTXBufferSize(uint8_t socket) {
  return wiznetRegReadByte(socket, (0x0000 + 0x001F));
}


x86 assembly (clang, -O0):
<wiznetGetSocketTXBufferSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1f,%esi
call   1030 <wiznetRegReadByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiznetGetSocketTXBufferSize>:
mov    $0x1f,%esi
jmp    1030 <wiznetRegReadByte@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketTXBufferSize(i32 %0) {
%2 = tail call i32 @wiznetRegReadByte(i32 %0, i32 31)
ret i32 %2
}
int base7() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @base7() {
ret i32 0
}
/* Type definitions */
struct azt_Play_msf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printk(char *, char *);
int sendAztCmd(int, struct azt_Play_msf *);
int aztPlay(struct azt_Play_msf *arg) {
  int tmp;
  {
    tmp = sendAztCmd(144, arg);
    if (tmp < 0) {
      printk("aztcd: Warning: %s failed\n", "aztPlay");
      return (-1);
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<aztPlay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x90,%edi
call   1040 <sendAztCmd@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1166 <aztPlay+0x46>
lea    0xeb2(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1030 <printk@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <aztPlay+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aztPlay>:
push   %rax
mov    %rdi,%rsi
mov    $0x90,%edi
call   1040 <sendAztCmd@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     1138 <aztPlay+0x18>
pop    %rcx
ret
lea    0xec1(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <printk@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.azt_Play_msf = type { i32 }
@.str = [27 x i8] c"aztcd: Warning: %s failed\0A\00"
@.str.1 = [8 x i8] c"aztPlay\00"
define i32 @aztPlay(%struct.azt_Play_msf* %0) {
%2 = alloca i32
%3 = alloca %struct.azt_Play_msf*
%4 = alloca i32
store %struct.azt_Play_msf* %0, %struct.azt_Play_msf** %3
%5 = load %struct.azt_Play_msf*, %struct.azt_Play_msf** %3
%6 = call i32 @sendAztCmd(i32 144, %struct.azt_Play_msf* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.azt_Play_msf = type { i32 }
@.str = [27 x i8] c"aztcd: Warning: %s failed\0A\00"
@.str.1 = [8 x i8] c"aztPlay\00"
define i32 @aztPlay(%struct.azt_Play_msf* %0) {
%2 = tail call i32 @sendAztCmd(i32 144, %struct.azt_Play_msf* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int add(char *);
bool add_test_two_numbers() {
  if (add("5,7") == 12)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<add_test_two_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <add@plt>
cmp    $0xc,%eax
jne    1139 <add_test_two_numbers+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <add_test_two_numbers+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_test_two_numbers>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0xc,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"5,7\00"
define i32 @add_test_two_numbers() {
%1 = tail call i32 @add(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
ret i32 %3
}
void palPcd(double disco, double *x, double *y) {
  double f;
  f = 1.0 + disco * ((*x) * (*x) + (*y) * (*y));
  *x *= f;
  *y *= f;
}


x86 assembly (clang, -O0):
<palPcd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<palPcd>:
movsd  (%rdi),%xmm1
movsd  (%rsi),%xmm2
mulsd  %xmm2,%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
addsd  0xedc(%rip),%xmm3
mulsd  %xmm3,%xmm1
movsd  %xmm1,(%rdi)
mulsd  (%rsi),%xmm3
movsd  %xmm3,(%rsi)
ret

LLVM IR (-O0):
define void @palPcd(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double, double* %4
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = load double*, double** %6
%16 = load double, double* %15
%17 = fmul double %14, %16
%18 = call double @llvm.fmuladd.f64(double %10, double %12, double %17)
%19 = call double @llvm.fmuladd.f64(double %8, double %18, double 1.000000e+00)
store double %19, double* %7
%20 = load double, double* %7
%21 = load double*, double** %5
%22 = load double, double* %21
%23 = fmul double %22, %20
store double %23, double* %21
%24 = load double, double* %7
%25 = load double*, double** %6
%26 = load double, double* %25
%27 = fmul double %26, %24
store double %27, double* %25
ret void
}

LLVM IR (-O2):
define void @palPcd(double %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fmul double %5, %5
%7 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %0, double %7, double 1.000000e+00)
%9 = fmul double %4, %8
store double %9, double* %1
%10 = load double, double* %2
%11 = fmul double %10, %8
store double %11, double* %2
ret void
}
int test_imm_0Cint64_lowword_mem(long long *val) {
  return ((*val) & (0x0C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Cint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 12
%6 = icmp ne i64 %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_0Cint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strxfrm(char *, char *, size_t);
void uninitvar_strxfrm(void) {
  char *ds;
  char *ss;
  size_t n;
  (void)strxfrm(ds, ss, n);
}


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

x86 assembly (clang, -O2):
<uninitvar_strxfrm>:
jmp    1030 <strxfrm@plt>

LLVM IR (-O0):
define void @uninitvar_strxfrm() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i64
%4 = load i8*, i8** %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = call i32 @strxfrm(i8* %4, i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strxfrm() {
%1 = tail call i32 @strxfrm(i8* undef, i8* undef, i64 undef)
ret void
}
int do_482() { return 482; }


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

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

LLVM IR (-O0):
define i32 @do_482() {
ret i32 482
}

LLVM IR (-O2):
define i32 @do_482() {
ret i32 482
}
int calculate_pad(width)
long width;
{}


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

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

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

LLVM IR (-O2):
define i32 @calculate_pad(i64 %0) {
ret i32 undef
}
unsigned int hash(sym)
char *sym;
{
  register unsigned int s;
  register char *str;
  for (str = sym, s = 0; *str != '\0'; s += *str++)
    ;
  return (s);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <hash+0x49>
jmp    112c <hash+0x2c>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <hash+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add i32 %7, %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errno;
scalar_t__ fclose(int /*<<< orphan*/ *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void aslc_fclose(FILE *const fd, const char *const filename) {
  if (fclose(fd) != 0) {
    fprintf(stderr, "[W] Cannot close file `%s': %s\n", filename,
            strerror(errno));
  }
}


x86 assembly (clang, -O0):
<aslc_fclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     118b <aslc_fclose+0x5b>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aslc_fclose>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <fclose@plt>
test   %rax,%rax
je     1171 <aslc_fclose+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%ebp
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea2(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"[W] Cannot close file `%s': %s\0A\00"
@errno = global i32 0
define void @aslc_fclose(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i64 @fclose(i32* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"[W] Cannot close file `%s': %s\0A\00"
@errno = global i32 0
define void @aslc_fclose(i32* nocapture %0, i8* %1) {
%3 = tail call i64 @fclose(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %8)
br label %10
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_current_date();
int main() {
  print_current_date();
  print_current_date();
  print_current_date();
  print_current_date();
  print_current_date();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_current_date()
%2 = tail call i32 (...) @print_current_date()
%3 = tail call i32 (...) @print_current_date()
%4 = tail call i32 (...) @print_current_date()
%5 = tail call i32 (...) @print_current_date()
ret i32 0
}