xunge/DecIR huggingface dataset:
double Mul(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<Mul>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mul>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Mul(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Mul(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int check_magic(int **);
int /*<<< orphan*/ printf(char *);
int main() {
  int square[3][3] = {{2, 7, 6}, {9, 5, 1}, {4, 3, 8}};
  int is_magic = check_magic(square);
  if (is_magic)
    printf("Square is magic!\n");
  else
    printf("Square is not magic.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1050 <check_magic@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     117b <main+0x4b>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <main+0x57>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <check_magic@plt>
test   %eax,%eax
lea    0xece(%rip),%rax
lea    0xedc(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.square = [3 x [3 x i32]] [[3 x i32] [i32 2, i32 7, i32 6], [3 x i32] [i32 9, i32 5, i32 1], [3 x i32] [i32 4, i32 3, i32 8]]
@.str = [18 x i8] c"Square is magic!\0A\00"
@.str.1 = [22 x i8] c"Square is not magic.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [3 x i32]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x [3 x i32]]* %2 to i8*
%5 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %2, i64 0, i64 0
%6 = bitcast [3 x i32]* %5 to i32**
%7 = call i32 @check_magic(i32** %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@__const.main.square = [3 x [3 x i32]] [[3 x i32] [i32 2, i32 7, i32 6], [3 x i32] [i32 9, i32 5, i32 1], [3 x i32] [i32 4, i32 3, i32 8]]
@str = [21 x i8] c"Square is not magic.\00"
@str.2 = [17 x i8] c"Square is magic!\00"
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @check_magic(i32** %3)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ConfigDump();
int /*<<< orphan*/ ProfilesDump();
int /*<<< orphan*/ UsersDump();
void ConfigDumpTimer(void *pData) {
  ConfigDump();
  UsersDump();
  ProfilesDump();
  return;
  pData = 0;
}


x86 assembly (clang, -O0):
<ConfigDumpTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <ConfigDump@plt>
mov    $0x0,%al
call   1030 <UsersDump@plt>
mov    $0x0,%al
call   1040 <ProfilesDump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigDumpTimer>:
push   %rax
xor    %eax,%eax
call   1050 <ConfigDump@plt>
xor    %eax,%eax
call   1030 <UsersDump@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ProfilesDump@plt>

LLVM IR (-O0):
define void @ConfigDumpTimer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @ConfigDump()
%4 = call i32 (...) @UsersDump()
%5 = call i32 (...) @ProfilesDump()
ret void
}

LLVM IR (-O2):
define void @ConfigDumpTimer(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @ConfigDump()
%3 = tail call i32 (...) @UsersDump()
%4 = tail call i32 (...) @ProfilesDump()
ret void
}
__typeof__(strndup(1, "")) test_strndup_162(void) { return strndup(1, ""); }


x86 assembly (clang, -O0):
<test_strndup_162>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <strndup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strndup_162>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <strndup@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test_strndup_162() {
%1 = call i8* @strndup(i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define noalias i8* @test_strndup_162() {
%1 = tail call i8* @strndup(i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* %1
}
int __nanolibc_strlen(char *s) {
  char *p = s;
  for (; *p; p++)
    ;
  return p - s;
}


x86 assembly (clang, -O0):
<__nanolibc_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <__nanolibc_strlen+0x33>
jmp    1122 <__nanolibc_strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <__nanolibc_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__nanolibc_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <__nanolibc_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @__nanolibc_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ busy_wait(int);
int main(void) {
  *(volatile unsigned int *)0x3F200004 = (1 << (18));
  while (1) {
    *(volatile unsigned int *)0x3F20001C = (1 << 16);
    busy_wait(3000000);
    *(volatile unsigned int *)0x3F200028 = (1 << 16);
    busy_wait(3000000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3f200004,%eax
movl   $0x40000,(%rax)
mov    $0x3f20001c,%eax
movl   $0x10000,(%rax)
mov    $0x2dc6c0,%edi
call   1030 <busy_wait@plt>
mov    $0x3f200028,%eax
movl   $0x10000,(%rax)
mov    $0x2dc6c0,%edi
call   1030 <busy_wait@plt>
jmp    112a <main+0x1a>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x40000,0x3f200004
nopl   0x0(%rax)
movl   $0x10000,0x3f20001c
mov    $0x2dc6c0,%edi
call   1030 <busy_wait@plt>
movl   $0x10000,0x3f200028
mov    $0x2dc6c0,%edi
call   1030 <busy_wait@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store volatile i32 262144, i32* inttoptr (i64 1059061764 to i32*)
br label %2
2: ; preds = %0, %2
store volatile i32 65536, i32* inttoptr (i64 1059061788 to i32*)
%3 = call i32 @busy_wait(i32 3000000)
store volatile i32 65536, i32* inttoptr (i64 1059061800 to i32*)
%4 = call i32 @busy_wait(i32 3000000)
br label %2
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 262144, i32* inttoptr (i64 1059061764 to i32*)
br label %1
1: ; preds = %0, %1
store volatile i32 65536, i32* inttoptr (i64 1059061788 to i32*)
%2 = tail call i32 @busy_wait(i32 3000000)
store volatile i32 65536, i32* inttoptr (i64 1059061800 to i32*)
%3 = tail call i32 @busy_wait(i32 3000000)
br label %1
}
/* Variables and functions */
int *realloc(int *, int);
int *DynamicArrayAppend(int *ary, int size) {
  int *ptr_ary = realloc(ary, size * sizeof *ptr_ary);
  return ptr_ary;
}


x86 assembly (clang, -O0):
<DynamicArrayAppend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DynamicArrayAppend>:
shl    $0x2,%esi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i32* @DynamicArrayAppend(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i32* @realloc(i32* %6, i32 %10)
store i32* %11, i32** %5
%12 = load i32*, i32** %5
ret i32* %12
}

LLVM IR (-O2):
define i32* @DynamicArrayAppend(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @realloc(i32* %0, i32 %3)
ret i32* %4
}
int biosig_blockwrite_digital_samples(int handle, int *buf) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @biosig_blockwrite_digital_samples(i32 %0, i32* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcoll(int /*<<< orphan*/, int /*<<< orphan*/);
int alphasort(const struct dirent **d1, const struct dirent **d2) {
  return strcoll((*d1)->d_name, (*d2)->d_name);
}


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

x86 assembly (clang, -O2):
<alphasort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcoll@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @alphasort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %4
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcoll(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @alphasort(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %0
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %1
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcoll(i32 %5, i32 %8)
ret i32 %9
}
extern unsigned int __inb(unsigned long addr) {
  long result =
      *(volatile int *)((addr << 7) + ((0xfffffc0000000000UL) + 0x300000000UL) +
                        0x00);
  result >>= (addr & 3) * 8;
  return 0xffUL & result;
}


x86 assembly (clang, -O0):
<__inb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x7,%rax
movabs $0xfffffc0300000000,%rcx
fc ff ff
add    %rcx,%rax
mov    (%rax),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x3,%rcx
shl    $0x3,%rcx
mov    -0x10(%rbp),%rax
sar    %cl,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inb>:
lea    0x0(,%rdi,8),%ecx
shl    $0x7,%rdi
movabs $0xfffffc0300000000,%rax
fc ff ff
movslq (%rdi,%rax,1),%rax
and    $0x18,%cl
sar    %cl,%rax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @__inb(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = shl i64 %4, 7
%6 = add i64 %5, -4385161609216
%7 = add i64 %6, 0
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = and i64 %11, 3
%13 = mul i64 %12, 8
%14 = load i64, i64* %3
%15 = ashr i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
%17 = and i64 255, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @__inb(i64 %0) {
%2 = shl i64 %0, 7
%3 = add i64 %2, -4385161609216
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = sext i32 %5 to i64
%7 = shl i64 %0, 3
%8 = and i64 %7, 24
%9 = ashr i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 255
ret i32 %11
}
/* Variables and functions */
char tolower(char);
void allLower(char *str) {
  for (int i = 0; str[i]; ++i) {
    str[i] = tolower(str[i]);
  }
}


x86 assembly (clang, -O0):
<allLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1161 <allLower+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <allLower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @allLower(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %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 = icmp ne i8 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call signext i8 @tolower(i8 signext %16)
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
br label %22
22: ; preds = %11
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @allLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8 [ %12, %5 ], [ %2, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int asn1_bio_write(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int asn1_bio_puts(BIO *b, const char *str) {
  return asn1_bio_write(b, str, strlen(str));
}


x86 assembly (clang, -O0):
<asn1_bio_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <asn1_bio_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_bio_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <asn1_bio_write@plt>

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

LLVM IR (-O2):
define i32 @asn1_bio_puts(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @asn1_bio_write(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBHostRequestINClear(uint32_t ui32Base, uint32_t ui32Endpoint) {
  uint32_t ui32Register;
  ;

  ;
  if (ui32Endpoint == 0x00000000) {
    ui32Register = 0x00000102;
  } else {
    ui32Register = 0x00000116 + (ui32Endpoint - 0x10);
  }
  (*((volatile unsigned char *)(ui32Base + ui32Register))) &= ~0x00000020;
}


x86 assembly (clang, -O0):
<USBHostRequestINClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1120 <USBHostRequestINClear+0x20>
movl   $0x102,-0xc(%rbp)
jmp    112e <USBHostRequestINClear+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x10,%eax
add    $0x116,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
mov    (%rax),%cl
movzbl %cl,%ecx
and    $0xffffffdf,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostRequestINClear>:
lea    0x106(%rsi),%eax
test   %esi,%esi
mov    $0x102,%ecx
cmovne %eax,%ecx
movslq %ecx,%rax
movslq %edi,%rcx
andb   $0xdf,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @USBHostRequestINClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 258, i32* %5
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 16
%12 = add nsw i32 278, %11
store i32 %12, i32* %5
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = load volatile i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %20, -33
%22 = trunc i32 %21 to i8
store volatile i8 %22, i8* %18
ret void
}

LLVM IR (-O2):
define void @USBHostRequestINClear(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add nsw i32 %1, 262
%5 = select i1 %3, i32 258, i32 %4
%6 = add nsw i32 %5, %0
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load volatile i8, i8* %8
%10 = and i8 %9, -33
store volatile i8 %10, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void data_segment_gdata(void) { output_line("\t.data"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\09.data\00"
define void @data_segment_gdata() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\09.data\00"
define void @data_segment_gdata() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void call4a(struct stag *stp) { stp = 0; }


x86 assembly (clang, -O0):
<call4a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stag = type opaque
define void @call4a(%struct.stag* %0) {
%2 = alloca %struct.stag*
store %struct.stag* %0, %struct.stag** %2
store %struct.stag* null, %struct.stag** %2
ret void
}

LLVM IR (-O2):
%struct.stag = type opaque
define void @call4a(%struct.stag* nocapture %0) {
ret void
}
void test4_TestExports_pollen__run__E() {}


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

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

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

LLVM IR (-O2):
define void @test4_TestExports_pollen__run__E() {
ret void
}
/* Variables and functions */
int herc_main(int, char **);
int main(int argc, char **argv) { return herc_main(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <herc_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @herc_main(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
bool is_pow2(uint32_t value) {
  uint8_t num_ones = 0;
  while (value != 0) {
    if (value & 0x1) {
      num_ones++;
      if (num_ones > 1) {
        return false;
      }
    }
    value = (value >> 1) & 0x7FFFFFFF;
  }
  return true;
}


x86 assembly (clang, -O0):
<is_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115e <is_pow2+0x5e>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114b <is_pow2+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1146 <is_pow2+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1165 <is_pow2+0x65>
jmp    114b <is_pow2+0x4b>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <is_pow2+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pow2>:
mov    $0x1,%eax
test   %edi,%edi
je     112c <is_pow2+0x2c>
xor    %ecx,%ecx
jmp    111b <is_pow2+0x1b>
nopl   (%rax)
mov    %edi,%edx
shr    %edx
cmp    $0x1,%edi
mov    %edx,%edi
jbe    112c <is_pow2+0x2c>
test   $0x1,%dil
je     1110 <is_pow2+0x10>
test   %ecx,%ecx
mov    $0x1,%ecx
jle    1110 <is_pow2+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_pow2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %10
%4 = phi i32 [ %11, %10 ], [ 0, %1 ]
%5 = phi i32 [ %12, %10 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = icmp sgt i32 %4, 0
br i1 %9, label %14, label %10
10: ; preds = %8, %3
%11 = phi i32 [ 1, %8 ], [ %4, %3 ]
%12 = lshr i32 %5, 1
%13 = icmp ult i32 %5, 2
br i1 %13, label %14, label %3
14: ; preds = %8, %10, %1
%15 = phi i32 [ 1, %1 ], [ 1, %10 ], [ 0, %8 ]
ret i32 %15
}
void gdk_display_supports_clipboard_persistence() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_supports_clipboard_persistence() {
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t sub_int16_t(int16_t a, int16_t b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i64 @sub_int16_t(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int f493(int *);
int f494(int *p) { return f493(p); }


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

x86 assembly (clang, -O2):
<f494>:
jmp    1030 <f493@plt>

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

LLVM IR (-O2):
define i32 @f494(i32* %0) {
%2 = tail call i32 @f493(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char flag = 0x5;
  printf("%x\n", flag & 0x3);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 1)
ret i32 0
}
void in_def_free(void *drv_data) {}


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

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

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

LLVM IR (-O2):
define void @in_def_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alias2();
int loop3_constant(int k) {
  for (int i = k; i < k + 15; i++) {
    alias2();
  }
  return 0;
}


x86 assembly (clang, -O0):
<loop3_constant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0xf,%ecx
cmp    %ecx,%eax
jge    1147 <loop3_constant+0x37>
mov    $0x0,%al
call   1030 <alias2@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <loop3_constant+0x11>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop3_constant>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xe(%rbx),%ebp
add    $0xffffffff,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <alias2@plt>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     1120 <loop3_constant+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @loop3_constant(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 15
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = call i32 (...) @alias2()
br label %12
12: ; preds = %10
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @loop3_constant(i32 %0) {
%2 = add nsw i32 %0, 14
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %1, %4
%5 = phi i32 [ %0, %1 ], [ %7, %4 ]
%6 = tail call i32 (...) @alias2()
%7 = add nsw i32 %5, 1
%8 = icmp slt i32 %5, %2
br i1 %8, label %4, label %3
}
/* Variables and functions */
int /*<<< orphan*/ Cross_f(float *, float *, float *);
float Dot_f(float *, float *, int);
float ScalarTriple_f(float *x, float *y, float *z) {
  float tmp[3];
  float stp;
  Cross_f(y, z, tmp);
  stp = Dot_f(x, tmp, 3);
  return stp;
}


x86 assembly (clang, -O0):
<ScalarTriple_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1040 <Cross_f@plt>
mov    -0x8(%rbp),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x3,%edx
call   1030 <Dot_f@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScalarTriple_f>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %r14,%rdx
call   1040 <Cross_f@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <Dot_f@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @ScalarTriple_f(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca [3 x float]
%8 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%9 = load float*, float** %5
%10 = load float*, float** %6
%11 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%12 = call i32 @Cross_f(float* %9, float* %10, float* %11)
%13 = load float*, float** %4
%14 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%15 = call float @Dot_f(float* %13, float* %14, i32 3)
store float %15, float* %8
%16 = load float, float* %8
ret float %16
}

LLVM IR (-O2):
define float @ScalarTriple_f(float* %0, float* %1, float* %2) {
%4 = alloca [3 x float]
%5 = bitcast [3 x float]* %4 to i8*
%6 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
%7 = call i32 @Cross_f(float* %1, float* %2, float* %6)
%8 = call float @Dot_f(float* %0, float* %6, i32 3)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ xyz2llh(double const *, double *);
void xyz2llh_decimal(const double *xyz, double *llh) {
  xyz2llh(xyz, llh);
  llh[0] = llh[0] * 57.2957795131;
  llh[1] = llh[1] * 57.2957795131;
}


x86 assembly (clang, -O0):
<xyz2llh_decimal>:
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 <xyz2llh@plt>
mov    -0x10(%rbp),%rax
movsd  0xec7(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xeaf(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz2llh_decimal>:
push   %rbx
mov    %rsi,%rbx
call   1030 <xyz2llh@plt>
movupd (%rbx),%xmm0
mulpd  0xedb(%rip),%xmm0
movupd %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @xyz2llh_decimal(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @xyz2llh(double* %5, double* %6)
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fmul double %10, 0x404CA5DC1A63CBB0
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %16, 0x404CA5DC1A63CBB0
%18 = load double*, double** %4
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
ret void
}

LLVM IR (-O2):
define void @xyz2llh_decimal(double* %0, double* %1) {
%3 = tail call i32 @xyz2llh(double* %0, double* %1)
%4 = bitcast double* %1 to <2 x double>*
%5 = load <2 x double>, <2 x double>* %4
%6 = fmul <2 x double> %5, <double 0x404CA5DC1A63CBB0, double 0x404CA5DC1A63CBB0>
%7 = bitcast double* %1 to <2 x double>*
store <2 x double> %6, <2 x double>* %7
ret void
}
/* Variables and functions */
size_t my_strlen(char const *str) {
  size_t i = 0;
  while (str[i] != '\0') {
    i = i + 1;
  }
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <my_strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int test_imm_63uint8_reg(unsigned char val) {
  return ((val) & (-0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_63uint8_reg>:
test   $0x9d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_63uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -99
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
void f1() {
  int size = 12;
  char src[12] = "helloworld";
  char dest[12];
  memmove(dest, src, size);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xc,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
sub    $0x18,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
mov    $0xc,%edx
call   1030 <memmove@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f1.src = [12 x i8] c"helloworld\00\00"
define void @f1() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
store i32 12, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* %1
%8 = call i32 @memmove(i8* %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@__const.f1.src = [12 x i8] c"helloworld\00\00"
define void @f1() {
%1 = alloca [12 x i8]
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @memmove(i8* %4, i8* %3, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_function();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello form c file\n");
  c_function();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Hello form c file\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @c_function()
ret i32 0
}
/* Variables and functions */
char putchar(char c) { return c; }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @putchar(i8 returned signext %0) {
ret i8 %0
}
void UninitI420toRGB444v565() {}


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

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

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

LLVM IR (-O2):
define void @UninitI420toRGB444v565() {
ret void
}
/* Variables and functions */
char *CreateLongString();
int /*<<< orphan*/ free(char *);
size_t strlen(char *);
size_t GetLongStringLength(void) {
  char *pStr = CreateLongString();
  size_t length = strlen(pStr);
  free(pStr);
  pStr = NULL;
  return length;
}


x86 assembly (clang, -O0):
<GetLongStringLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <CreateLongString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLongStringLength>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <CreateLongString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @GetLongStringLength() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i8* (...) @CreateLongString()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %2
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
store i8* null, i8** %1
%8 = load i64, i64* %2
ret i64 %8
}

LLVM IR (-O2):
define i64 @GetLongStringLength() {
%1 = tail call i8* (...) @CreateLongString()
%2 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%3 = tail call i32 @free(i8* %1)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeFan(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeFan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeFan>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeFan(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_max() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_max"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_cvolume_max\00"
define i32 @pa_cvolume_max() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int f3(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f3() {
ret i32 0
}
char *dhcid_human(struct rr *rrv) { return "..."; }


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

x86 assembly (clang, -O2):
<dhcid_human>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.rr = type opaque
@.str = [4 x i8] c"...\00"
define i8* @dhcid_human(%struct.rr* %0) {
%2 = alloca %struct.rr*
store %struct.rr* %0, %struct.rr** %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.rr = type opaque
@.str = [4 x i8] c"...\00"
define i8* @dhcid_human(%struct.rr* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr, "Usage: %s [-w <saved position path>] <socket directory>\n",
          name);
  exit(255);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: %s [-w <saved position path>] <socket directory>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: %s [-w <saved position path>] <socket directory>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 255)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ parse_int_easy_test();
int main() {
  parse_int_easy_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @parse_int_easy_test()
ret i32 0
}