xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, int);
void *malloc(int);
void *cmalloc(int size) {
  void *t;
  t = malloc(size);
  bzero(t, size);
  return t;
}


x86 assembly (clang, -O0):
<cmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @cmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @bzero(i8* %6, i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @cmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @bzero(i8* %2, i32 %0)
ret i8* %2
}
/* Type definitions */
struct kdtree {
  int dummy;
};
struct kdres {
  int dummy;
};

/* Variables and functions */
struct kdres *kd_nearest(struct kdtree *, float *);
struct kdres *kd_nearest3f(struct kdtree *tree, float x, float y, float z) {
  float pos[3];
  pos[0] = x;
  pos[1] = y;
  pos[2] = z;
  return kd_nearest(tree, pos);
}


x86 assembly (clang, -O0):
<kd_nearest3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <kd_nearest@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_nearest3f>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm2,0x14(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <kd_nearest@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest3f(%struct.kdtree* %0, float %1, float %2, float %3) {
%5 = alloca %struct.kdtree*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca [3 x float]
store %struct.kdtree* %0, %struct.kdtree** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = load float, float* %6
%11 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
store float %10, float* %11
%12 = load float, float* %7
%13 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 1
store float %12, float* %13
%14 = load float, float* %8
%15 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 2
store float %14, float* %15
%16 = load %struct.kdtree*, %struct.kdtree** %5
%17 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%18 = call %struct.kdres* @kd_nearest(%struct.kdtree* %16, float* %17)
ret %struct.kdres* %18
}

LLVM IR (-O2):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest3f(%struct.kdtree* %0, float %1, float %2, float %3) {
%5 = alloca [3 x float]
%6 = bitcast [3 x float]* %5 to i8*
%7 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
store float %1, float* %7
%8 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
store float %2, float* %8
%9 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
store float %3, float* %9
%10 = call %struct.kdres* @kd_nearest(%struct.kdtree* %0, float* %7)
ret %struct.kdres* %10
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
void write_to_socket(int sockfd, char buf[256]) {
  int n = write(sockfd, buf, strlen(buf));
  if (n < 0)
    error("ERROR writing to socket");
}


x86 assembly (clang, -O0):
<write_to_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    117d <write_to_socket+0x4d>
lea    0xe88(%rip),%rdi
call   1050 <error@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_socket>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %eax,%eax
js     1157 <write_to_socket+0x27>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xea2(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <error@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"ERROR writing to socket\00"
define void @write_to_socket(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @write(i32 %6, i8* %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"ERROR writing to socket\00"
define void @write_to_socket(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_04(uint64_t x) {
  __asm__("rolq $4, %0" : "=r"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<ROL64_04>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
rol    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL64_04>:
mov    %rdi,%rax
rol    $0x4,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_04(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$4, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_04(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$4, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int Operand_mw_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~0x3) != 0;
  return error;
}


x86 assembly (clang, -O0):
<Operand_mw_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffffc,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_mw_encode>:
xor    %eax,%eax
cmpl   $0x4,(%rdi)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @Operand_mw_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ugt i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t atomic_sub_size_t(size_t *, int);
size_t atomic_dec_size_t(size_t *var) { return atomic_sub_size_t(var, 1); }


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

x86 assembly (clang, -O2):
<atomic_dec_size_t>:
mov    $0x1,%esi
jmp    1030 <atomic_sub_size_t@plt>

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

LLVM IR (-O2):
define i64 @atomic_dec_size_t(i64* %0) {
%2 = tail call i64 @atomic_sub_size_t(i64* %0, i32 1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int statinc();
int main() {
  int i, j;
  int x = 0;
  i = 0;
  i = statinc();
  assert(i == 1);
  assert(x == 0);
  i = statinc();
  assert(i == 2);
  assert(x == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <statinc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <statinc@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <statinc@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <statinc@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %2
%5 = call i32 (...) @statinc()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 (...) @statinc()
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 2
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @statinc()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 (...) @statinc()
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int mkostemp(char *, int);
void resourceLeak_mkostemp(char *template, int flags) {
  int fp = mkostemp(template, flags);
}


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

x86 assembly (clang, -O2):
<resourceLeak_mkostemp>:
jmp    1030 <mkostemp@plt>

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

LLVM IR (-O2):
define void @resourceLeak_mkostemp(i8* %0, i32 %1) {
%3 = tail call i32 @mkostemp(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void qfits_err_display_stderr(char *s) { fprintf(stderr, "qfits: %s\n", s); }


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

x86 assembly (clang, -O2):
<qfits_err_display_stderr>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"qfits: %s\0A\00"
define void @qfits_err_display_stderr(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 ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"qfits: %s\0A\00"
define void @qfits_err_display_stderr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void coll_default_unduper(void *item, const void *xtra) { free(item); }


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

x86 assembly (clang, -O2):
<coll_default_unduper>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @coll_default_unduper(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
char *find(char *p, char c) {
  while (*p && *p != c && *p != ' ' && *p != '\t')
    p++;
  return p;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1160 <find+0x60>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
je     1160 <find+0x60>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1160 <find+0x60>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1170 <find+0x70>
jmp    1181 <find+0x81>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <find+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    %rdi,%rax
mov    (%rdi),%dl
cmp    %sil,%dl
je     113b <find+0x3b>
movabs $0x100000201,%rcx
jmp    112d <find+0x2d>
cs nopw 0x0(%rax,%rax,1)
movzbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %sil,%dl
je     113b <find+0x3b>
cmp    $0x20,%dl
ja     1120 <find+0x20>
movzbl %dl,%edx
bt     %rdx,%rcx
jae    1120 <find+0x20>
ret

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

LLVM IR (-O2):
define i8* @find(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = freeze i8 %3
%5 = icmp eq i8 %4, %1
br i1 %5, label %14, label %6
6: ; preds = %2, %9
%7 = phi i8 [ %12, %9 ], [ %4, %2 ]
%8 = phi i8* [ %10, %9 ], [ %0, %2 ]
switch i8 %7, label %9 [
i8 32, label %14
i8 9, label %14
i8 0, label %14
]
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = freeze i8 %11
%13 = icmp eq i8 %12, %1
br i1 %13, label %14, label %6
14: ; preds = %9, %6, %6, %6, %2
%15 = phi i8* [ %0, %2 ], [ %8, %6 ], [ %8, %6 ], [ %8, %6 ], [ %10, %9 ]
ret i8* %15
}
/* Variables and functions */
__attribute__((vector(vectorlength(128)))) int func2(int x, int y) {
  return (x + y);
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @func2(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @func2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int _nss_exfiles_getpwuid_r(int /*<<< orphan*/, struct passwd *, char *, size_t,
                            int *);
int /*<<< orphan*/ exfiles_trace_msg(char *);
enum nss_status _nss_exfiles_getpwbyuid_r(uid_t uid, struct passwd *pwbuf,
                                          char *buffer, size_t buflen,
                                          int *errnop) {
  exfiles_trace_msg("Entering _nss_exfiles_getpwbyuid_r");
  return _nss_exfiles_getpwuid_r(uid, pwbuf, buffer, buflen, errnop);
}


x86 assembly (clang, -O0):
<_nss_exfiles_getpwbyuid_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <exfiles_trace_msg@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <_nss_exfiles_getpwuid_r@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_exfiles_getpwbyuid_r>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec3(%rip),%rdi
call   1030 <exfiles_trace_msg@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <_nss_exfiles_getpwuid_r@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [35 x i8] c"Entering _nss_exfiles_getpwbyuid_r\00"
define i32 @_nss_exfiles_getpwbyuid_r(i32 %0, %struct.passwd* %1, i8* %2, i64 %3, i32* %4) {
%6 = alloca i32
%7 = alloca %struct.passwd*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32*
store i32 %0, i32* %6
store %struct.passwd* %1, %struct.passwd** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32* %4, i32** %10
%11 = call i32 @exfiles_trace_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %6
%13 = load %struct.passwd*, %struct.passwd** %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32*, i32** %10
%17 = call i32 @_nss_exfiles_getpwuid_r(i32 %12, %struct.passwd* %13, i8* %14, i64 %15, i32* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str = [35 x i8] c"Entering _nss_exfiles_getpwbyuid_r\00"
define i32 @_nss_exfiles_getpwbyuid_r(i32 %0, %struct.passwd* %1, i8* %2, i64 %3, i32* %4) {
%6 = tail call i32 @exfiles_trace_msg(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @_nss_exfiles_getpwuid_r(i32 %0, %struct.passwd* %1, i8* %2, i64 %3, i32* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void free_list(char **list) {
  char **cp = list;
  while (*cp)
    free(*cp++);
  free(list);
}


x86 assembly (clang, -O0):
<free_list>:
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     114e <free_list+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1124 <free_list+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_list>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_list+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_list+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_list(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 = %9, %1
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8**, i8*** %3
%11 = getelementptr inbounds i8*, i8** %10, i32 1
store i8** %11, i8*** %3
%12 = load i8*, i8** %10
%13 = bitcast i8* %12 to i8**
%14 = call i32 @free(i8** %13)
br label %5
15: ; preds = %5
%16 = load i8**, i8*** %2
%17 = call i32 @free(i8** %16)
ret void
}

LLVM IR (-O2):
define void @free_list(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = bitcast i8* %5 to i8**
%9 = tail call i32 @free(i8** %8)
%10 = load i8*, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @free(i8** %0)
ret void
}
long add_long(register long u, register long v) { return u + v; }


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

x86 assembly (clang, -O2):
<add_long>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add_long(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 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add_long(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("%s", "Hello");
  printf("%c %s\n", ',', "World!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"Hello\00"
@.str.2 = [7 x i8] c"%c %s\0A\00"
@.str.3 = [7 x i8] c"World!\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
int cgltf_unhex(char ch) {
  return (unsigned)(ch - '0') < 10  ? (ch - '0')
         : (unsigned)(ch - 'A') < 6 ? (ch - 'A') + 10
         : (unsigned)(ch - 'a') < 6 ? (ch - 'a') + 10
                                    : -1;
}


x86 assembly (clang, -O0):
<cgltf_unhex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
jae    1129 <cgltf_unhex+0x29>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1186 <cgltf_unhex+0x86>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
cmp    $0x6,%eax
jae    114b <cgltf_unhex+0x4b>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1180 <cgltf_unhex+0x80>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
cmp    $0x6,%eax
jae    116d <cgltf_unhex+0x6d>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x10(%rbp)
jmp    117a <cgltf_unhex+0x7a>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    117a <cgltf_unhex+0x7a>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgltf_unhex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <cgltf_unhex+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <cgltf_unhex+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cgltf_unhex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = add nsw i32 %2, -65
%7 = icmp ult i32 %6, 6
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = add nsw i32 %2, -55
br label %15
10: ; preds = %5
%11 = add nsw i32 %2, -97
%12 = icmp ult i32 %11, 6
%13 = add nsw i32 %2, -87
%14 = select i1 %12, i32 %13, i32 -1
br label %15
15: ; preds = %1, %8, %10
%16 = phi i32 [ %9, %8 ], [ %14, %10 ], [ %3, %1 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test38(__m64 a, __m64 b) { return _mm_adds_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test38>:
jmp    1030 <_mm_adds_pi16@plt>

LLVM IR (-O0):
define i32 @test38(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 @_mm_adds_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test38(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isdigit(char);
char tolower(char);
char from_hex(char c) { return isdigit(c) ? c - '0' : tolower(c) - 'a' + 10; }


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <from_hex+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <from_hex+0x45>
movsbl -0x1(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <from_hex+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <tolower@plt>
add    $0xa9,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @from_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @from_hex(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %9
6: ; preds = %1
%7 = tail call signext i8 @tolower(i8 signext %0)
%8 = add i8 %7, -87
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %5, %4 ], [ %8, %6 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_ap_mac_address_usage(void) {
  printf("\nUsage : sys_cfg_ap_mac_address [AP_MAC_ADDRESS]\n");
  printf("\nIf AP_MAC_ADDRESS is provided, a 'set' is performed, else a 'get' "
         "is performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_ap_mac_address_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"\0AUsage : sys_cfg_ap_mac_address [AP_MAC_ADDRESS]\0A\00"
@.str.1 = [82 x i8] c"\0AIf AP_MAC_ADDRESS is provided, a 'set' is performed, else a 'get' is performed.\0A\00"
define void @print_sys_cfg_ap_mac_address_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"\0AUsage : sys_cfg_ap_mac_address [AP_MAC_ADDRESS]\00"
@str.2 = [81 x i8] c"\0AIf AP_MAC_ADDRESS is provided, a 'set' is performed, else a 'get' is performed.\00"
define void @print_sys_cfg_ap_mac_address_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.2, i64 0, i64 0))
ret void
}
void BN_RECP_CTX_init(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_RECP_CTX_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int plugin_open_rotor(char *config) {
  printf("PrintAzimuth/Elevation plugin opened.\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"PrintAzimuth/Elevation plugin opened.\0A\00"
define i32 @plugin_open_rotor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [38 x i8] c"PrintAzimuth/Elevation plugin opened.\00"
define i32 @plugin_open_rotor(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void testDeprecatedUnusedMessage() {}


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

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

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

LLVM IR (-O2):
define void @testDeprecatedUnusedMessage() {
ret void
}
int compareInt(const void *p1, const void *p2) {
  return *(int *)p1 - *(int *)p2;
}


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

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

LLVM IR (-O0):
define i32 @compareInt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compareInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int main() {
  volatile int i = 0;
  while (1) {
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
addl   $0x1,-0x4(%rsp)
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load volatile i32, i32* %2
%5 = add nsw i32 %4, 1
store volatile i32 %5, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = add nsw i32 %4, 1
store volatile i32 %5, i32* %1
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetPixelMap_size(int /*<<< orphan*/);
GLint __glGetPixelMapfv_size(GLenum map) { return __glGetPixelMap_size(map); }


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

x86 assembly (clang, -O2):
<__glGetPixelMapfv_size>:
jmp    1030 <__glGetPixelMap_size@plt>

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

LLVM IR (-O2):
define i32 @__glGetPixelMapfv_size(i32 %0) {
%2 = tail call i32 @__glGetPixelMap_size(i32 %0)
ret i32 %2
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int char_count = 0;
  char read_character;
  while ((read_character = getchar()) != EOF) {
    char_count++;
  }
  printf("\nThe number of characters read: %d\n", char_count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1163 <main+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
mov    0x2eb8(%rip),%r14
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    (%r14),%al
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [36 x i8] c"\0AThe number of characters read: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [36 x i8] c"\0AThe number of characters read: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PR14046e();
void PR14046f() {
#pragma weak PR14046e
  PR14046e();
}


x86 assembly (clang, -O0):
<PR14046f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PR14046e@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR14046f>:
xor    %eax,%eax
jmp    1030 <PR14046e@plt>

LLVM IR (-O0):
define void @PR14046f() {
%1 = call i32 (...) @PR14046e()
ret void
}

LLVM IR (-O2):
define void @PR14046f() {
%1 = tail call i32 (...) @PR14046e()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Hello, world!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int c_fun();
int a_fun(void) { return c_fun(); }


x86 assembly (clang, -O0):
<a_fun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <c_fun@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_fun>:
xor    %eax,%eax
jmp    1030 <c_fun@plt>

LLVM IR (-O0):
define i32 @a_fun() {
%1 = call i32 (...) @c_fun()
ret i32 %1
}

LLVM IR (-O2):
define i32 @a_fun() {
%1 = tail call i32 (...) @c_fun()
ret i32 %1
}
short zig_subw_short(short lhs, short rhs, short min, short max) {
  return (short)(((unsigned short)lhs) - ((unsigned short)rhs));
}


x86 assembly (clang, -O0):
<zig_subw_short>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @zig_subw_short(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = load i16, i16* %6
%12 = zext i16 %11 to i32
%13 = sub nsw i32 %10, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @zig_subw_short(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = sub i16 %0, %1
ret i16 %5
}
/* Type definitions */
struct _tsarray_pub {
  int dummy;
};

/* Variables and functions */
void *minmax_scan(struct _tsarray_pub const *,
                  int (*)(void const *, void const *, void *), void *, int);
void *tsarray_max(const struct _tsarray_pub *tsarray,
                  int (*cmp)(const void *a, const void *b, void *arg),
                  void *arg) {
  return minmax_scan(tsarray, cmp, arg, 1);
}


x86 assembly (clang, -O0):
<tsarray_max>:
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
mov    $0x1,%ecx
call   1030 <minmax_scan@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsarray_max>:
mov    $0x1,%ecx
jmp    1030 <minmax_scan@plt>

LLVM IR (-O0):
%struct._tsarray_pub = type { i32 }
define i8* @tsarray_max(%struct._tsarray_pub* %0, i32 (i8*, i8*, i8*)* %1, i8* %2) {
%4 = alloca %struct._tsarray_pub*
%5 = alloca i32 (i8*, i8*, i8*)*
%6 = alloca i8*
store %struct._tsarray_pub* %0, %struct._tsarray_pub** %4
store i32 (i8*, i8*, i8*)* %1, i32 (i8*, i8*, i8*)** %5
store i8* %2, i8** %6
%7 = load %struct._tsarray_pub*, %struct._tsarray_pub** %4
%8 = load i32 (i8*, i8*, i8*)*, i32 (i8*, i8*, i8*)** %5
%9 = load i8*, i8** %6
%10 = call i8* @minmax_scan(%struct._tsarray_pub* %7, i32 (i8*, i8*, i8*)* %8, i8* %9, i32 1)
ret i8* %10
}

LLVM IR (-O2):
%struct._tsarray_pub = type { i32 }
define i8* @tsarray_max(%struct._tsarray_pub* %0, i32 (i8*, i8*, i8*)* %1, i8* %2) {
%4 = tail call i8* @minmax_scan(%struct._tsarray_pub* %0, i32 (i8*, i8*, i8*)* %1, i8* %2, i32 1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void serial_init() {
  outb(0x3f8 + 1, 0x00);
  outb(0x3f8 + 3, 0x80);
  outb(0x3f8 + 0, 0x03);
  outb(0x3f8 + 1, 0x00);
  outb(0x3f8 + 3, 0x03);
  outb(0x3f8 + 2, 0xC7);
  outb(0x3f8 + 4, 0x0B);
}


x86 assembly (clang, -O0):
<serial_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <outb@plt>
mov    $0x3fc,%edi
mov    $0xb,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_init>:
push   %rax
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
mov    $0x3f8,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3f9,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x3fb,%edi
mov    $0x3,%esi
call   1030 <outb@plt>
mov    $0x3fa,%edi
mov    $0xc7,%esi
call   1030 <outb@plt>
mov    $0x3fc,%edi
mov    $0xb,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_init() {
%1 = call i32 @outb(i32 1017, i32 0)
%2 = call i32 @outb(i32 1019, i32 128)
%3 = call i32 @outb(i32 1016, i32 3)
%4 = call i32 @outb(i32 1017, i32 0)
%5 = call i32 @outb(i32 1019, i32 3)
%6 = call i32 @outb(i32 1018, i32 199)
%7 = call i32 @outb(i32 1020, i32 11)
ret void
}

LLVM IR (-O2):
define void @serial_init() {
%1 = tail call i32 @outb(i32 1017, i32 0)
%2 = tail call i32 @outb(i32 1019, i32 128)
%3 = tail call i32 @outb(i32 1016, i32 3)
%4 = tail call i32 @outb(i32 1017, i32 0)
%5 = tail call i32 @outb(i32 1019, i32 3)
%6 = tail call i32 @outb(i32 1018, i32 199)
%7 = tail call i32 @outb(i32 1020, i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destroy_key(const char *e) { free((void *)e); }


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

x86 assembly (clang, -O2):
<destroy_key>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_key(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int test(int);
int run(int i) { return test(i) + test(i); }


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <test@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <test@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <test@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @run(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @test(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @test(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @run(i32 %0) {
%2 = tail call i32 @test(i32 %0)
%3 = tail call i32 @test(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}