xunge/DecIR huggingface dataset:
/* Variables and functions */
void ft_bzero(void *s, size_t n) {
  size_t i;
  char *ptr;
  ptr = (char *)s;
  i = 0;
  while (i < n) {
    ptr[i] = '\0';
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1147 <ft_bzero+0x47>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <ft_bzero+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_bzero>:
test   %rsi,%rsi
je     1124 <ft_bzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @ft_bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Variables and functions */
int ref1();
int ref2(void) { return ref1(); }


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

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

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

LLVM IR (-O2):
define i32 @ref2() {
%1 = tail call i32 (...) @ref1()
ret i32 %1
}
/* Variables and functions */
int __builtin_arm_crc32d(int, long long);
int crc32d(int a, long long b) { return __builtin_arm_crc32d(a, b); }


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

x86 assembly (clang, -O2):
<crc32d>:
jmp    1030 <__builtin_arm_crc32d@plt>

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

LLVM IR (-O2):
define i32 @crc32d(i32 %0, i64 %1) {
%3 = tail call i32 @__builtin_arm_crc32d(i32 %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void jx_term_flush(void) { fflush(stdout); }


x86 assembly (clang, -O0):
<jx_term_flush>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jx_term_flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @jx_term_flush() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @jx_term_flush() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Variables and functions */
double calc_linear_factor(double, double);
double sqrt(double);
double calc_sphere_decreasing_factor(double middle, double z) {
  z = calc_linear_factor(middle, z);
  return 1.0 - sqrt(1.0 - z * z);
}


x86 assembly (clang, -O0):
<calc_sphere_decreasing_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <calc_linear_factor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe8d(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe79(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_sphere_decreasing_factor>:
push   %rax
call   1040 <calc_linear_factor@plt>
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm2
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     114e <calc_sphere_decreasing_factor+0x2e>
sqrtsd %xmm0,%xmm0
jmp    115b <calc_sphere_decreasing_factor+0x3b>
call   1030 <sqrt@plt>
movsd  0xea5(%rip),%xmm2
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @calc_sphere_decreasing_factor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @calc_linear_factor(double %5, double %6)
store double %7, double* %4
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fneg double %8
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double 1.000000e+00)
%12 = call double @sqrt(double %11)
%13 = fsub double 1.000000e+00, %12
ret double %13
}

LLVM IR (-O2):
define double @calc_sphere_decreasing_factor(double %0, double %1) {
%3 = tail call double @calc_linear_factor(double %0, double %1)
%4 = fneg double %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double 1.000000e+00)
%6 = tail call double @sqrt(double %5)
%7 = fsub double 1.000000e+00, %6
ret double %7
}
void do_something(int sig) {}


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

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

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

LLVM IR (-O2):
define void @do_something(i32 %0) {
ret void
}
__attribute__((swiftcall)) void
context_error_1(__attribute__((swift_context)) int *self,
                __attribute__((swift_error_result)) float **error) {}


x86 assembly (clang, -O0):
<context_error_1>:
push   %rbp
mov    %rsp,%rbp
mov    %r12,-0x8(%rbp)
mov    %r13,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%r12
pop    %rbp
ret

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

LLVM IR (-O0):
define swiftcc void @context_error_1(i32* swiftself %0, float** swifterror %1) {
%3 = alloca float*
%4 = alloca i32*
%5 = alloca float**
%6 = load float*, float** %1
store float* %6, float** %3
store i32* %0, i32** %4
store float** %3, float*** %5
%7 = load float*, float** %3
store float* %7, float** %1
ret void
}

LLVM IR (-O2):
define swiftcc void @context_error_1(i32* nocapture swiftself %0, float** nocapture swifterror %1) {
ret void
}
char is_channel(const char *name) { return name[0] == '#' || name[0] == '&'; }


x86 assembly (clang, -O0):
<is_channel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x23,%ecx
mov    %al,-0x9(%rbp)
je     112d <is_channel+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x26,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_channel>:
mov    (%rdi),%al
cmp    $0x23,%al
sete   %cl
cmp    $0x26,%al
sete   %al
or     %cl,%al
ret

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

LLVM IR (-O2):
define signext i8 @is_channel(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
%4 = icmp eq i8 %2, 38
%5 = or i1 %3, %4
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ pinpoint_message(char *);
int /*<<< orphan*/ sprintf(char *, char const *, char const *);
void format_pinpoint_message(const char msg[], const char arg[]) {
  char errmsg[2048];
  (void)sprintf(errmsg, msg, arg);
  pinpoint_message(errmsg);
}


x86 assembly (clang, -O0):
<format_pinpoint_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
call   1030 <pinpoint_message@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_pinpoint_message>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <pinpoint_message@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @format_pinpoint_message(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 @pinpoint_message(i8* %10)
ret void
}

LLVM IR (-O2):
define void @format_pinpoint_message(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 @pinpoint_message(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int processOtherCommands(char *execute) {
  printf("executing command %s\n", execute);
  return -1;
}


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

x86 assembly (clang, -O2):
<processOtherCommands>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"executing command %s\0A\00"
define i32 @processOtherCommands(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
__attribute__((__no__)) void
do_nothing_small_hole_runtime_all(struct test_small_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_small_hole_runtime_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_small_hole_runtime_all+0x1b>
jmp    1120 <do_nothing_small_hole_runtime_all+0x20>
jmp    1120 <do_nothing_small_hole_runtime_all+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_runtime_all(%struct.test_small_hole* %0) {
%2 = alloca %struct.test_small_hole*
store %struct.test_small_hole* %0, %struct.test_small_hole** %2
%3 = load %struct.test_small_hole*, %struct.test_small_hole** %2
%4 = ptrtoint %struct.test_small_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_small_hole = type opaque
define void @do_nothing_small_hole_runtime_all(%struct.test_small_hole* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ prime(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Enter a number\n");
  scanf("%d", &n);
  if (prime(n) == 0) {
    printf("The number is a prime number\n");
  } else {
    printf("The number is not a prime number\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <prime@plt>
cmp    $0x0,%rax
jne    117e <main+0x4e>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <main+0x5a>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <prime@plt>
test   %rax,%rax
lea    0xed2(%rip),%rax
lea    0xeaa(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"The number is a prime number\0A\00"
@.str.3 = [34 x i8] c"The number is not a prime number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i64 @prime(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [15 x i8] c"Enter a number\00"
@str.4 = [33 x i8] c"The number is not a prime number\00"
@str.5 = [29 x i8] c"The number is a prime number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @prime(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Type definitions */
struct crypt_data {
  int dummy;
};

/* Variables and functions */
char *__crypt_r(char const *, char const *, struct crypt_data *);
char *crypt(const char *key, const char *salt) {
  static char buf[128];
  return __crypt_r(key, salt, (struct crypt_data *)buf);
}


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

x86 assembly (clang, -O2):
<crypt>:
lea    0x2f29(%rip),%rdx
jmp    1030 <__crypt_r@plt>

LLVM IR (-O0):
%struct.crypt_data = type { i32 }
@crypt.buf = internal global [128 x i8] zeroinitializer
define i8* @crypt(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 = load i8*, i8** %4
%7 = call i8* @__crypt_r(i8* %5, i8* %6, %struct.crypt_data* bitcast ([128 x i8]* @crypt.buf to %struct.crypt_data*))
ret i8* %7
}

LLVM IR (-O2):
%struct.crypt_data = type { i32 }
@crypt.buf = internal global [128 x i8] zeroinitializer
define i8* @crypt(i8* %0, i8* %1) {
%3 = tail call i8* @__crypt_r(i8* %0, i8* %1, %struct.crypt_data* bitcast ([128 x i8]* @crypt.buf to %struct.crypt_data*))
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int iswalpha(int /*<<< orphan*/);
int /*<<< orphan*/ mbtowc(int /*<<< orphan*/ *, char const *, int);
bool alphacheck(char const *cur, void *_) {
  wchar_t wc;
  mbtowc(&wc, cur, 4);
  return iswalpha(wc);
}


x86 assembly (clang, -O0):
<alphacheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1030 <mbtowc@plt>
mov    -0x14(%rbp),%edi
call   1040 <iswalpha@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphacheck>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <mbtowc@plt>
mov    0x4(%rsp),%edi
call   1040 <iswalpha@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @alphacheck(i8* %0, i8* nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @mbtowc(i32* %3, i8* %0, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @iswalpha(i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int send_command_expect_ok(int /*<<< orphan*/, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int netplot_set_grid(int rows, int cols) {
  char buffer[256];
  memset(buffer, 0, 256);
  snprintf(buffer, 256, "set grid=%d,%d\n", rows, cols);
  return send_command_expect_ok(0, buffer);
}


x86 assembly (clang, -O0):
<netplot_set_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x100,%esi
lea    0xe92(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rsi
xor    %edi,%edi
call   1050 <send_command_expect_ok@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netplot_set_grid>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    0xea8(%rip),%rdx
mov    %r14,%rdi
mov    $0x100,%esi
mov    %ebp,%ecx
mov    %ebx,%r8d
call   1030 <snprintf@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <send_command_expect_ok@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"set grid=%d,%d\0A\00"
define i32 @netplot_set_grid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 256)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @snprintf(i8* %8, i32 256, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%13 = call i32 @send_command_expect_ok(i32 0, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"set grid=%d,%d\0A\00"
define i32 @netplot_set_grid(i32 %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%7 = call i32 @send_command_expect_ok(i32 0, i8* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clean_exit(int /*<<< orphan*/);
void exit_handler(int sig) { clean_exit(0); }


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

x86 assembly (clang, -O2):
<exit_handler>:
xor    %edi,%edi
jmp    1030 <clean_exit@plt>

LLVM IR (-O0):
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @clean_exit(i32 0)
ret void
}

LLVM IR (-O2):
define void @exit_handler(i32 %0) {
%2 = tail call i32 @clean_exit(i32 0)
ret void
}
/* Variables and functions */
int local_ns_name_skip(unsigned char const **, unsigned char const *);
int local_ns_dn_skipname(const unsigned char *ptr, const unsigned char *eom) {
  const unsigned char *saveptr = ptr;
  if (local_ns_name_skip(&ptr, eom) == -1)
    return -1;
  return ptr - saveptr;
}


x86 assembly (clang, -O0):
<local_ns_dn_skipname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1030 <local_ns_name_skip@plt>
cmp    $0xffffffff,%eax
jne    114a <local_ns_dn_skipname+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <local_ns_dn_skipname+0x48>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_ns_dn_skipname>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <local_ns_name_skip@plt>
mov    0x8(%rsp),%ecx
sub    %ebx,%ecx
cmp    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @local_ns_dn_skipname(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @local_ns_name_skip(i8** %3, i8* %1)
%5 = icmp eq i32 %4, -1
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = select i1 %5, i32 -1, i32 %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t bnep_event_channel_timeout_get_destination_uuid(const uint8_t *event) {
  return little_endian_read_16(event, 6);
}


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

x86 assembly (clang, -O2):
<bnep_event_channel_timeout_get_destination_uuid>:
mov    $0x6,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @bnep_event_channel_timeout_get_destination_uuid(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 6)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ReadFromFile();
int /*<<< orphan*/ WriteToFile(char *, char *);
Action() {
  WriteToFile(
      "C:\\OpenSSL-Win32\\bin\\openssl.exe",
      " dgst -sha1 -hmac C:\\temp\\EncryptThis.txt C:\\temp\\SharedSecret.txt");
  ReadFromFile();
  return 0;
}


x86 assembly (clang, -O0):
<Action>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeef(%rip),%rsi
call   1030 <WriteToFile@plt>
mov    $0x0,%al
call   1040 <ReadFromFile@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Action>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef2(%rip),%rsi
call   1030 <WriteToFile@plt>
xor    %eax,%eax
call   1040 <ReadFromFile@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"C:\\OpenSSL-Win32\\bin\\openssl.exe\00"
@.str.1 = [67 x i8] c" dgst -sha1 -hmac C:\\temp\\EncryptThis.txt C:\\temp\\SharedSecret.txt\00"
define i32 @Action() {
%1 = call i32 @WriteToFile(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @ReadFromFile()
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"C:\\OpenSSL-Win32\\bin\\openssl.exe\00"
@.str.1 = [67 x i8] c" dgst -sha1 -hmac C:\\temp\\EncryptThis.txt C:\\temp\\SharedSecret.txt\00"
define i32 @Action() {
%1 = tail call i32 @WriteToFile(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @ReadFromFile()
ret i32 0
}
int compound_assign_3() {
  int x;
  x *= 0;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @compound_assign_3() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo05();
void bar05() { foo05(); }


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

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

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

LLVM IR (-O2):
define void @bar05() {
%1 = tail call i32 (...) @foo05()
ret void
}
void __null_canonize(char *s) {}


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

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

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

LLVM IR (-O2):
define void @__null_canonize(i8* nocapture %0) {
ret void
}
double baz(double x, double y) {
  return __builtin_pow(x, 3.0) * __builtin_pow(y, 4.0);
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xed3(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @baz(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @pow(double %5, double 3.000000e+00)
%7 = load double, double* %4
%8 = call double @pow(double %7, double 4.000000e+00)
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @baz(double %0, double %1) {
%3 = tail call double @pow(double %0, double 3.000000e+00)
%4 = tail call double @pow(double %1, double 4.000000e+00)
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
float glmComputeVectorLength4f(float *);
int /*<<< orphan*/ glmMakeVector4f(float *, float const *, float const *);
float glmComputeDistance4f(const float p1[4], const float p2[4]) {
  float d[4];
  glmMakeVector4f(d, p1, p2);
  return glmComputeVectorLength4f(d);
}


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

x86 assembly (clang, -O2):
<glmComputeDistance4f>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <glmMakeVector4f@plt>
mov    %rbx,%rdi
call   1040 <glmComputeVectorLength4f@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @glmComputeDistance4f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [4 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = getelementptr inbounds [4 x float], [4 x float]* %5, i64 0, i64 0
%7 = load float*, float** %3
%8 = load float*, float** %4
%9 = call i32 @glmMakeVector4f(float* %6, float* %7, float* %8)
%10 = getelementptr inbounds [4 x float], [4 x float]* %5, i64 0, i64 0
%11 = call float @glmComputeVectorLength4f(float* %10)
ret float %11
}

LLVM IR (-O2):
define float @glmComputeDistance4f(float* %0, float* %1) {
%3 = alloca [4 x float]
%4 = bitcast [4 x float]* %3 to i8*
%5 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%6 = call i32 @glmMakeVector4f(float* %5, float* %0, float* %1)
%7 = call float @glmComputeVectorLength4f(float* %5)
ret float %7
}
/* Variables and functions */
int strcmp(char *, char *);
int wordcmp(void const *w1, void const *w2) {
  return strcmp(*(char **)w1, *(char **)w2);
}


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

x86 assembly (clang, -O2):
<wordcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @wordcmp(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 i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @wordcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
void *get_XCirculateEvent_display(void *_p) {
  return (void *)((XCirculateEvent *)_p)->display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XCirculateEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XCirculateEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
char *k_strcat(char *dest, const char *src) {
  char *org = dest;
  while (*dest)
    ++dest;
  while ((*dest++ = *src++))
    ;
  return org;
}


x86 assembly (clang, -O0):
<k_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <k_strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <k_strcat+0x14>
jmp    1137 <k_strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <k_strcat+0x66>
jmp    1137 <k_strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <k_strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <k_strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @k_strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int cpuid_ecx(int op) {
  int eax, ecx, edx;
  __asm__("pushq %%rbx\n\tcpuid\n\tpopq %%rbx"
          : "=a"(eax), "=c"(ecx), "=d"(edx)
          : "a"(op));
  return ecx;
}


x86 assembly (clang, -O0):
<cpuid_ecx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
push   %rbx
cpuid
pop    %rbx
mov    %eax,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ecx>:
mov    %edi,%eax
push   %rbx
cpuid
pop    %rbx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cpuid_ecx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call { i32, i32, i32 } asm "pushq %rbx\0A\09cpuid\0A\09popq %rbx", "={ax},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %6)
%8 = extractvalue { i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32 } %7, 2
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @cpuid_ecx(i32 %0) {
%2 = tail call { i32, i32, i32 } asm "pushq %rbx\0A\09cpuid\0A\09popq %rbx", "={ax},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32, i32 } %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(unsigned short, int /*<<< orphan*/ *);
int fputc2LowHigh(unsigned short d, FILE *s) {
  putc(d & 0xFF, s);
  return putc(d >> 8, s);
}


x86 assembly (clang, -O0):
<fputc2LowHigh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc2LowHigh>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movzbl %bpl,%edi
call   1030 <putc@plt>
shr    $0x8,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putc@plt>

LLVM IR (-O0):
define i32 @fputc2LowHigh(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i16
%9 = load i32*, i32** %4
%10 = call i32 @putc(i16 zeroext %8, i32* %9)
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i16
%15 = load i32*, i32** %4
%16 = call i32 @putc(i16 zeroext %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @fputc2LowHigh(i16 zeroext %0, i32* nocapture %1) {
%3 = and i16 %0, 255
%4 = tail call i32 @putc(i16 zeroext %3, i32* %1)
%5 = lshr i16 %0, 8
%6 = tail call i32 @putc(i16 zeroext %5, i32* %1)
ret i32 %6
}
int iceil(int x, int y) { return (x + y - 1) / y; }


x86 assembly (clang, -O0):
<iceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<iceil>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @iceil(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
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @iceil(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
struct s3c24x0_clock_power *s3c24x0_get_base_clock_power(void) {
  return (struct s3c24x0_clock_power *)0x4C000000;
}


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

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

LLVM IR (-O0):
%struct.s3c24x0_clock_power = type opaque
define %struct.s3c24x0_clock_power* @s3c24x0_get_base_clock_power() {
ret %struct.s3c24x0_clock_power* inttoptr (i64 1275068416 to %struct.s3c24x0_clock_power*)
}

LLVM IR (-O2):
%struct.s3c24x0_clock_power = type opaque
define %struct.s3c24x0_clock_power* @s3c24x0_get_base_clock_power() {
ret %struct.s3c24x0_clock_power* inttoptr (i64 1275068416 to %struct.s3c24x0_clock_power*)
}
unsigned xrop3_82_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & D;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_82_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_82_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
mov    %eax,%edx
or     %edi,%edx
xor    $0xff,%edx
or     %ecx,%eax
not    %eax
and    %edx,%eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_82_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_82_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %3
%8 = xor i32 %7, 255
%9 = or i32 %6, %4
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = or i8 %1, %0
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_T61STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_T61STRING_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, const unsigned char **in,
                                   long len) {
  return (ASN1_T61STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                         &ASN1_T61STRING_it);
}


x86 assembly (clang, -O0):
<d2i_ASN1_T61STRING>:
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    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_ASN1_T61STRING>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_T61STRING_it = global i32 0
define i32* @d2i_ASN1_T61STRING(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_T61STRING_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_T61STRING_it = global i32 0
define i32* @d2i_ASN1_T61STRING(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_T61STRING_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int plus(int x, int y) { return x + y; }


x86 assembly (clang, -O0):
<plus>:
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):
<plus>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @plus(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 @plus(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int);
off_t txc_libc_lseek(int fildes, off_t offset, int whence) {
  return lseek(fildes, offset, whence);
}


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

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

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

LLVM IR (-O2):
define i32 @txc_libc_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freep(void *ptr) {
  void **mem = (void **)ptr;
  if (*mem) {
    free(*mem);
    *mem = NULL;
  }
}


x86 assembly (clang, -O0):
<freep>:
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     1149 <freep+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freep>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <freep+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @freep(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
store i8* null, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}
int regularFunctionSum(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<regularFunctionSum>:
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):
<regularFunctionSum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @regularFunctionSum(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 @regularFunctionSum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}