xunge/DecIR huggingface dataset:
void test_cr8(void) {
  unsigned long src, dst;
  dst = 777;
  src = 3;
  asm volatile("mov %[src], %%cr8; mov %%cr8, %[dst]"
               : [dst] "+r"(dst), [src] "+r"(src));
  report("mov %cr8", dst == 3 && src == 3);
}


x86 assembly (clang, -O0):
<test_cr8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x309,-0x10(%rbp)
movq   $0x3,-0x8(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rax,%cr8
mov    %cr8,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x3,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    115b <test_cr8+0x4b>
cmpq   $0x3,-0x8(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cr8>:
mov    $0x309,%eax
mov    $0x3,%ecx
mov    %rcx,%cr8
mov    %cr8,%rax
xor    $0x3,%rax
xor    $0x3,%rcx
xor    %esi,%esi
or     %rax,%rcx
sete   %sil
lea    0xec6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <report@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"mov %cr8\00"
define void @test_cr8() {
%1 = alloca i64
%2 = alloca i64
store i64 777, i64* %2
store i64 3, i64* %1
%3 = load i64, i64* %2
%4 = load i64, i64* %1
%5 = call { i64, i64 } asm sideeffect "mov $1, %cr8; mov %cr8, $0", "=r,=r,0,1,~{dirflag},~{fpsr},~{flags}"(i64 %3, i64 %4)
%6 = extractvalue { i64, i64 } %5, 0
%7 = extractvalue { i64, i64 } %5, 1
store i64 %6, i64* %2
store i64 %7, i64* %1
%8 = load i64, i64* %2
%9 = icmp eq i64 %8, 3
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i64, i64* %1
%12 = icmp eq i64 %11, 3
br label %13
13: ; preds = %10, %0
%14 = phi i1 [ false, %0 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @report to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"mov %cr8\00"
define void @test_cr8() {
%1 = tail call { i64, i64 } asm sideeffect "mov $1, %cr8; mov %cr8, $0", "=r,=r,0,1,~{dirflag},~{fpsr},~{flags}"(i64 777, i64 3)
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = icmp eq i64 %2, 3
%5 = icmp eq i64 %3, 3
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
%8 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @report to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
void swap(unsigned int *hashedWords, int i, int j) {
  unsigned int t = hashedWords[i];
  hashedWords[i] = hashedWords[j];
  hashedWords[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0')
    ft_putchar(str[i++]);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
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     1158 <ft_putstr+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ft_putstr(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 %20
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @ft_putchar(i8 signext %18)
br label %4
20: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @ft_putchar(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *memory_alloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "ERROR: memory_alloc() Failed to allocate %zd bytes memory",
            size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<memory_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <memory_alloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_alloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <memory_alloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"ERROR: memory_alloc() Failed to allocate %zd bytes memory\00"
define i8* @memory_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"ERROR: memory_alloc() Failed to allocate %zd bytes memory\00"
define noalias i8* @memory_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
struct Hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hash_destroy(struct Hashtable *);
void destroy_all(struct Hashtable **tables) {
  struct Hashtable **h;
  for (h = tables; *h; ++h) {
    hash_destroy(*h);
  }
}


x86 assembly (clang, -O0):
<destroy_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <destroy_all+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <hash_destroy@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <destroy_all+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_all>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <destroy_all+0x21>
add    $0x8,%rbx
call   1030 <hash_destroy@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <destroy_all+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.Hashtable = type { i32 }
define void @destroy_all(%struct.Hashtable** %0) {
%2 = alloca %struct.Hashtable**
%3 = alloca %struct.Hashtable**
store %struct.Hashtable** %0, %struct.Hashtable*** %2
%4 = load %struct.Hashtable**, %struct.Hashtable*** %2
store %struct.Hashtable** %4, %struct.Hashtable*** %3
br label %5
5: ; preds = %13, %1
%6 = load %struct.Hashtable**, %struct.Hashtable*** %3
%7 = load %struct.Hashtable*, %struct.Hashtable** %6
%8 = icmp ne %struct.Hashtable* %7, null
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load %struct.Hashtable**, %struct.Hashtable*** %3
%11 = load %struct.Hashtable*, %struct.Hashtable** %10
%12 = call i32 @hash_destroy(%struct.Hashtable* %11)
br label %13
13: ; preds = %9
%14 = load %struct.Hashtable**, %struct.Hashtable*** %3
%15 = getelementptr inbounds %struct.Hashtable*, %struct.Hashtable** %14, i32 1
store %struct.Hashtable** %15, %struct.Hashtable*** %3
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.Hashtable = type { i32 }
define void @destroy_all(%struct.Hashtable** nocapture %0) {
%2 = load %struct.Hashtable*, %struct.Hashtable** %0
%3 = icmp eq %struct.Hashtable* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi %struct.Hashtable* [ %9, %4 ], [ %2, %1 ]
%6 = phi %struct.Hashtable** [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @hash_destroy(%struct.Hashtable* %5)
%8 = getelementptr inbounds %struct.Hashtable*, %struct.Hashtable** %6, i64 1
%9 = load %struct.Hashtable*, %struct.Hashtable** %8
%10 = icmp eq %struct.Hashtable* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _con_out(char);
void putch(char c) {
  if (c == '\n')
    _con_out('\r');
  _con_out(c);
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <putch+0x25>
mov    $0xd,%edi
call   1030 <_con_out@plt>
movsbl -0x1(%rbp),%edi
call   1030 <_con_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1122 <putch+0x12>
mov    $0xd,%edi
call   1030 <_con_out@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <_con_out@plt>

LLVM IR (-O0):
define void @putch(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @_con_out(i8 signext 13)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = call i32 @_con_out(i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @putch(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @_con_out(i8 signext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @_con_out(i8 signext %0)
ret void
}
void getBytesInt16(unsigned long i, char *out) {
  unsigned char *ia = (unsigned char *)&i;
  out[0] = ia[0];
  out[1] = ia[1];
}


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

x86 assembly (clang, -O2):
<getBytesInt16>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @getBytesInt16(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = bitcast i64* %3 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @getBytesInt16(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i8
%4 = lshr i64 %0, 8
%5 = trunc i64 %4 to i8
store i8 %3, i8* %1
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
float RoughnessToGAlpha_IBL(float roughness) { return roughness * roughness; }


x86 assembly (clang, -O0):
<RoughnessToGAlpha_IBL>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoughnessToGAlpha_IBL>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @RoughnessToGAlpha_IBL(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @RoughnessToGAlpha_IBL(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ ResetCPU();
int /*<<< orphan*/ printf(char *);
int main(void) {
  ResetCPU();
  printf("resetCPU: Failed to reset the system\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"resetCPU: Failed to reset the system\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ResetCPU()
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"resetCPU: Failed to reset the system\00"
define i32 @main() {
%1 = tail call i32 (...) @ResetCPU()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
int atoi(const char *str) { return ((int)strtol(str, (char **)0, 10)); }


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int dxl_read_byte(int, int);
int /*<<< orphan*/ printf(char *, int);
void getBaudRate(int ID) {
  int Baud;
  Baud = dxl_read_byte(ID, 4);
  PrintErrorCode();
  printf("New operational Baud Rate : %x", Baud);
}


x86 assembly (clang, -O0):
<getBaudRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1050 <dxl_read_byte@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <PrintErrorCode@plt>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBaudRate>:
push   %rbx
mov    $0x4,%esi
call   1050 <dxl_read_byte@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <PrintErrorCode@plt>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"New operational Baud Rate : %x\00"
define void @getBaudRate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dxl_read_byte(i32 %4, i32 4)
store i32 %5, i32* %3
%6 = call i32 (...) @PrintErrorCode()
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"New operational Baud Rate : %x\00"
define void @getBaudRate(i32 %0) {
%2 = tail call i32 @dxl_read_byte(i32 %0, i32 4)
%3 = tail call i32 (...) @PrintErrorCode()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_encryption_change_get_status(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<hci_event_encryption_change_get_status>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hci_event_encryption_change_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = input[0UL] + (unsigned char)69;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] - 903211243UL) - (unsigned char)207;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x45,%eax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x1,%rax
jae    1154 <RandomFunc+0x54>
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%edx
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%ecx
imul   %edx,%ecx
mov    %cl,-0x11(%rbp,%rax,1)
movzbl -0x12(%rbp),%eax
add    $0x2,%rax
mov    %al,-0x12(%rbp)
jmp    111d <RandomFunc+0x1d>
movzbl -0x11(%rbp),%eax
sub    $0x35d5e8eb,%rax
sub    $0xcf,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    $0x45,%al
mul    %al
add    $0x46,%al
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 69
%5 = mul i8 %4, %4
%6 = add i8 %5, 70
store i8 %6, i8* %1
ret void
}
/* Variables and functions */
long double __qabs(long double);
long double intr_wrap_093(long double p1) { return __qabs(p1); }


x86 assembly (clang, -O0):
<intr_wrap_093>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qabs@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_093>:
jmp    1030 <__qabs@plt>

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_093(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qabs(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int rand();
int M_Random(void) { return (rand() & 255); }


x86 assembly (clang, -O0):
<M_Random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_Random>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @M_Random() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 255
ret i32 %2
}

LLVM IR (-O2):
define i32 @M_Random() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, int, int);
int main() {
  f(1, 2, 3, 4);
  f(3, 4, 8, 9);
  f(8, 9, 3, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <f@plt>
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x8,%edx
mov    $0x9,%ecx
call   1030 <f@plt>
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <f@plt>
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x8,%edx
mov    $0x9,%ecx
call   1030 <f@plt>
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 1, i32 2, i32 3, i32 4)
%2 = call i32 @f(i32 3, i32 4, i32 8, i32 9)
%3 = call i32 @f(i32 8, i32 9, i32 3, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3, i32 4)
%2 = tail call i32 @f(i32 3, i32 4, i32 8, i32 9)
%3 = tail call i32 @f(i32 8, i32 9, i32 3, i32 4)
ret i32 0
}
char *chstr(c)
char c;
{
  static char sc[4];
  if (c < 040)
    sprintf(sc, "^%c", ((c) ^ 64));
  else
    sprintf(sc, "%c", c);
  return (sc);
}


x86 assembly (clang, -O0):
<chstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jge    114c <chstr+0x3c>
movsbl -0x1(%rbp),%edx
xor    $0x40,%edx
lea    0x2ef0(%rip),%rdi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1165 <chstr+0x55>
movsbl -0x1(%rbp),%edx
lea    0x2ed2(%rip),%rdi
lea    0xea3(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2ebd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chstr>:
push   %rax
mov    %edi,%edx
shl    $0x18,%edx
cmp    $0x1fffffff,%edx
jg     113b <chstr+0x2b>
sar    $0x18,%edx
xor    $0x40,%edx
lea    0x2efe(%rip),%rdi
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1030 <sprintf@plt>
jmp    1149 <chstr+0x39>
mov    %dil,0x2ee7(%rip)
movb   $0x0,0x2ee1(%rip)
lea    0x2ed9(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@chstr.sc = internal global [4 x i8] zeroinitializer
@.str = [4 x i8] c"^%c\00"
@.str.1 = [3 x i8] c"%c\00"
define i8* @chstr(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = xor i32 %9, 64
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @chstr.sc, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %16
12: ; preds = %1
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @chstr.sc, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %12, %7
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @chstr.sc, i64 0, i64 0)
}

LLVM IR (-O2):
@chstr.sc = internal global [4 x i8] zeroinitializer
@.str = [4 x i8] c"^%c\00"
define i8* @chstr(i32 %0) {
%2 = shl i32 %0, 24
%3 = icmp slt i32 %2, 536870912
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = ashr exact i32 %2, 24
%6 = xor i32 %5, 64
%7 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @chstr.sc, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %10
8: ; preds = %1
%9 = trunc i32 %0 to i8
store i8 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @chstr.sc, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @chstr.sc, i64 0, i64 1)
br label %10
10: ; preds = %8, %4
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @chstr.sc, i64 0, i64 0)
}
void init(int argc, char **argv) {}


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

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

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

LLVM IR (-O2):
define void @init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
char *strncpy(char *dst, const char *src, size_t num) {
  size_t idx = 0;
  while (idx < num) {
    dst[idx] = src[idx];
    if (src[idx] == '\0') {
      break;
    }
    ++idx;
  }
  return dst;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1167 <strncpy+0x67>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1156 <strncpy+0x56>
jmp    1167 <strncpy+0x67>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <strncpy+0x18>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
test   %rdx,%rdx
je     112c <strncpy+0x2c>
mov    $0x1,%edi
nopl   (%rax)
movzbl -0x1(%rsi,%rdi,1),%ecx
mov    %cl,-0x1(%rax,%rdi,1)
cmpb   $0x0,-0x1(%rsi,%rdi,1)
je     112c <strncpy+0x2c>
lea    0x1(%rdi),%rcx
cmp    %rdx,%rdi
mov    %rcx,%rdi
jb     1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %12, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %9
%10 = load i8, i8* %7
%11 = icmp ne i8 %10, 0
%12 = add nuw i64 %6, 1
%13 = icmp ult i64 %12, %2
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %5, label %15
15: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ read(int, unsigned char *, int);
void getrply(int f) {
  unsigned char e[3];
  read(f, e, 3);
}


x86 assembly (clang, -O0):
<getrply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x3,%edx
call   1030 <read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrply>:
push   %rax
lea    0x5(%rsp),%rsi
mov    $0x3,%edx
call   1030 <read@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @getrply(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%6 = call i32 @read(i32 %4, i8* %5, i32 3)
ret void
}

LLVM IR (-O2):
define void @getrply(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 3)
ret void
}
/* Variables and functions */
int myAtoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  char str[] = "-12345";
  printf("%d\n", myAtoi(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x17(%rbp),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x353433,0x3(%rsp)
movl   $0x3332312d,(%rsp)
mov    %rsp,%rdi
call   1040 <myAtoi@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.str = [7 x i8] c"-12345\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = call i32 @myAtoi(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void XMLDB_Generate_Begin_List(FILE *dest_doc) {
  fprintf(dest_doc, "%s", "<itemizedlist>");
}


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

x86 assembly (clang, -O2):
<XMLDB_Generate_Begin_List>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str.1 = [15 x i8] c"<itemizedlist>\00"
define void @XMLDB_Generate_Begin_List(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i64 14, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int main(int argc, char **argv) {
  foo(argv[0]);
  return 0;
}


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

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

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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @foo(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @foo(i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ mcp2515_spi_select();
int /*<<< orphan*/ mcp2515_spi_transfer(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ mcp2515_spi_unselect();
void mcp2515_read_rxtx_status(uint8_t *canRxTxStatus) {
  assert(canRxTxStatus != NULL);
  mcp2515_spi_select();
  mcp2515_spi_transfer(0xA0, NULL);
  mcp2515_spi_transfer(0, canRxTxStatus);
  mcp2515_spi_unselect();
}


x86 assembly (clang, -O0):
<mcp2515_read_rxtx_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <mcp2515_spi_select@plt>
mov    $0xa0,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <mcp2515_spi_transfer@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1050 <mcp2515_spi_transfer@plt>
mov    $0x0,%al
call   1060 <mcp2515_spi_unselect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcp2515_read_rxtx_status>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <mcp2515_spi_select@plt>
mov    $0xa0,%edi
xor    %esi,%esi
call   1050 <mcp2515_spi_transfer@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <mcp2515_spi_transfer@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <mcp2515_spi_unselect@plt>

LLVM IR (-O0):
define void @mcp2515_read_rxtx_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 (...) @mcp2515_spi_select()
%8 = call i32 @mcp2515_spi_transfer(i32 160, i32* null)
%9 = load i32*, i32** %2
%10 = call i32 @mcp2515_spi_transfer(i32 0, i32* %9)
%11 = call i32 (...) @mcp2515_spi_unselect()
ret void
}

LLVM IR (-O2):
define void @mcp2515_read_rxtx_status(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @mcp2515_spi_select()
%6 = tail call i32 @mcp2515_spi_transfer(i32 160, i32* null)
%7 = tail call i32 @mcp2515_spi_transfer(i32 0, i32* %0)
%8 = tail call i32 (...) @mcp2515_spi_unselect()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
long double wcstold(const wchar_t *nptr, wchar_t **endptr) {
  assert(0);
  return 0;
}


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

x86 assembly (clang, -O2):
<wcstold>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
define x86_fp80 @wcstold(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = call i32 @assert(i32 0)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
define x86_fp80 @wcstold(i32* nocapture readnone %0, i32** nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret x86_fp80 0xK00000000000000000000
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void ivory_hw_io_write_u8(uint32_t addr, uint8_t value) {
  *((volatile uint8_t *)addr) = value;
}


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

x86 assembly (clang, -O2):
<ivory_hw_io_write_u8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @ivory_hw_io_write_u8(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @ivory_hw_io_write_u8(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int find_tty(int /*<<< orphan*/);
int /*<<< orphan*/ start_tty(int);
int /*<<< orphan*/ wait(int *);
void wait_loop() {
  pid_t terminated_pid;
  int ret_status, tty_id;
  for (;;) {
    terminated_pid = wait(&ret_status);
    tty_id = find_tty(terminated_pid);
    if (tty_id == -1) {
    } else {
      start_tty(tty_id);
    }
  }
}


x86 assembly (clang, -O0):
<wait_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1050 <wait@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <find_tty@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    115e <wait_loop+0x2e>
jmp    1166 <wait_loop+0x36>
mov    -0xc(%rbp),%edi
call   1040 <start_tty@plt>
jmp    1138 <wait_loop+0x8>

x86 assembly (clang, -O2):
<wait_loop>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <wait@plt>
mov    %eax,%edi
call   1030 <find_tty@plt>
cmp    $0xffffffff,%eax
je     1140 <wait_loop+0x10>
mov    %eax,%edi
call   1040 <start_tty@plt>
jmp    1140 <wait_loop+0x10>

LLVM IR (-O0):
define void @wait_loop() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %14, %0
%5 = call i32 @wait(i32* %2)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @find_tty(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %4
br label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = call i32 @start_tty(i32 %12)
br label %14
14: ; preds = %11, %10
br label %4
}

LLVM IR (-O2):
define void @wait_loop() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %7, %0
%4 = call i32 @wait(i32* %1)
%5 = call i32 @find_tty(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %3, %8
br label %3
8: ; preds = %3
%9 = call i32 @start_tty(i32 %5)
br label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *fgets(char *, size_t, int /*<<< orphan*/ *);
char *read_stream(char *s, size_t size, void *d) {
  char *c = fgets(s, size, (FILE *)d);
  return c;
}


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

x86 assembly (clang, -O2):
<read_stream>:
jmp    1030 <fgets@plt>

LLVM IR (-O0):
define i8* @read_stream(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to i32*
%12 = call i8* @fgets(i8* %8, i64 %9, i32* %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
ret i8* %13
}

LLVM IR (-O2):
define i8* @read_stream(i8* %0, i64 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i8* @fgets(i8* %0, i64 %1, i32* %4)
ret i8* %5
}
/* Variables and functions */
size_t list_meter_double(const void *el) {
  if (el) {
  }
  return sizeof(double);
}


x86 assembly (clang, -O0):
<list_meter_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <list_meter_double+0x18>
jmp    1118 <list_meter_double+0x18>
mov    $0x8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @list_meter_double(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i64 8
}

LLVM IR (-O2):
define i64 @list_meter_double(i8* nocapture readnone %0) {
ret i64 8
}
/* Variables and functions */
int /*<<< orphan*/ rdar10308201_aux(unsigned int);
void rdar10308201(int valA, void *valB, unsigned valC) {
  unsigned actual_base, lines;
  if (valC == 0) {
    actual_base = (unsigned)valB;
    for (;;) {
      if (valA & (1 << 0))
        rdar10308201_aux(actual_base);
    }
  }
}


x86 assembly (clang, -O0):
<rdar10308201>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114f <rdar10308201+0x3f>
mov    -0x10(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114a <rdar10308201+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <rdar10308201_aux@plt>
jmp    1133 <rdar10308201+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdar10308201>:
push   %rbp
push   %rbx
push   %rax
test   %edx,%edx
je     111e <rdar10308201+0xe>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rsi,%rbx
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   $0x1,%bpl
je     1130 <rdar10308201+0x20>
mov    %ebx,%edi
call   1030 <rdar10308201_aux@plt>
jmp    1130 <rdar10308201+0x20>

LLVM IR (-O0):
define void @rdar10308201(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = ptrtoint i8* %12 to i32
store i32 %13, i32* %7
br label %14
14: ; preds = %21, %11
%15 = load i32, i32* %4
%16 = and i32 %15, 1
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %7
%20 = call i32 @rdar10308201_aux(i32 %19)
br label %21
21: ; preds = %18, %14
br label %14
22: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @rdar10308201(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = ptrtoint i8* %1 to i64
%7 = trunc i64 %6 to i32
%8 = and i32 %0, 1
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %13, %5
br i1 %9, label %13, label %11
11: ; preds = %10
%12 = tail call i32 @rdar10308201_aux(i32 %7)
br label %13
13: ; preds = %11, %10
br label %10
14: ; preds = %3
ret void
}
int blastzToWublastScore(int bzScore) { return bzScore / 19; }


x86 assembly (clang, -O0):
<blastzToWublastScore>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x13,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<blastzToWublastScore>:
movslq %edi,%rax
imul   $0x6bca1af3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @blastzToWublastScore(i32 %0) {
%2 = sdiv i32 %0, 19
ret i32 %2
}
int xmm7160_init_modemctl_device(struct modem_ctl *mc,
                                 struct modem_data *pdata) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.modem_ctl = type opaque
%struct.modem_data = type opaque
define i32 @xmm7160_init_modemctl_device(%struct.modem_ctl* nocapture readnone %0, %struct.modem_data* nocapture readnone %1) {
ret i32 0
}
int inet6_option_space(nbytes)
int nbytes;
{
  nbytes += 2;
  return (CMSG_SPACE((nbytes + 7) & ~7));
}


x86 assembly (clang, -O0):
<inet6_option_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x7,%edi
and    $0xfffffff8,%edi
mov    $0x0,%al
call   1030 <CMSG_SPACE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_option_space>:
add    $0x9,%edi
and    $0xfffffff8,%edi
xor    %eax,%eax
jmp    1030 <CMSG_SPACE@plt>

LLVM IR (-O0):
define i32 @inet6_option_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 7
%7 = and i32 %6, -8
%8 = call i32 (i32, ...) bitcast (i32 (...)* @CMSG_SPACE to i32 (i32, ...)*)(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @inet6_option_space(i32 %0) {
%2 = add nsw i32 %0, 9
%3 = and i32 %2, -8
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @CMSG_SPACE to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
/* Variables and functions */
bool nrf52_errata_2(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_2() {
ret i32 0
}