xunge/DecIR huggingface dataset:
int find_char(char c, char *s, int l) {
  int i;
  for (i = 0; i < l; i++)
    if (s[i] == c)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<find_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <find_char+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <find_char+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <find_char+0x61>
jmp    114c <find_char+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <find_char+0x18>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_char>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111f <find_char+0x1f>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,(%rsi,%rcx,1)
je     1120 <find_char+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <find_char+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find_char(i8 signext %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
void i2d_OCSP_RESPID(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_RESPID() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_NOW;
int /*<<< orphan*/ dlerror();
void *dlopen(char *, int /*<<< orphan*/);
char *strdup(int /*<<< orphan*/);
void *os_loadlib(char **pe, char *path) {
  void *retval;
  if (!(retval = dlopen(path, RTLD_NOW)))
    *pe = strdup(dlerror());
  return retval;
}


x86 assembly (clang, -O0):
<os_loadlib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1040 <dlopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1178 <os_loadlib+0x48>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_loadlib>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %rdi,%r14
mov    0x2ea7(%rip),%rcx
mov    (%rcx),%esi
mov    %rax,%rdi
call   1040 <dlopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1164 <os_loadlib+0x34>
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RTLD_NOW = global i32 0
define i8* @os_loadlib(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** %4
%7 = load i32, i32* @RTLD_NOW
%8 = call i8* @dlopen(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = call i32 (...) @dlerror()
%12 = call i8* @strdup(i32 %11)
%13 = load i8**, i8*** %3
store i8* %12, i8** %13
br label %14
14: ; preds = %10, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@RTLD_NOW = global i32 0
define i8* @os_loadlib(i8** nocapture writeonly %0, i8* %1) {
%3 = load i32, i32* @RTLD_NOW
%4 = tail call i8* @dlopen(i8* %1, i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 (...) @dlerror()
%8 = tail call i8* @strdup(i32 %7)
store i8* %8, i8** %0
br label %9
9: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ S_IFSOCK;
int w_is_fd_type_internal(int, int /*<<< orphan*/);
int w_is_fd_socket(int fd) { return w_is_fd_type_internal(fd, S_IFSOCK); }


x86 assembly (clang, -O0):
<w_is_fd_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <w_is_fd_type_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_is_fd_socket>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <w_is_fd_type_internal@plt>

LLVM IR (-O0):
@S_IFSOCK = global i32 0
define i32 @w_is_fd_socket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @S_IFSOCK
%5 = call i32 @w_is_fd_type_internal(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@S_IFSOCK = global i32 0
define i32 @w_is_fd_socket(i32 %0) {
%2 = load i32, i32* @S_IFSOCK
%3 = tail call i32 @w_is_fd_type_internal(i32 %0, i32 %2)
ret i32 %3
}
int countdigits(unsigned long long int num) {
  int digits = 0;
  while (num) {
    digits++;
    num /= 10;
  }
  return digits;
}


x86 assembly (clang, -O0):
<countdigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <countdigits+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    110f <countdigits+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countdigits>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1136 <countdigits+0x36>
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <countdigits+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @countdigits(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i64, i64* %2
%11 = udiv i64 %10, 10
store i64 %11, i64* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @countdigits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i64 %5, 10
%8 = icmp ult i64 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ tgt_putchar(int /*<<< orphan*/);
int tgt_puts(char *str) {
  while (*str)
    tgt_putchar(*str++);
  return 0;
}


x86 assembly (clang, -O0):
<tgt_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <tgt_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <tgt_putchar@plt>
jmp    111c <tgt_puts+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @tgt_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @tgt_putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int __get_array_size(char *);
char *strlwr(char *s) {
  int size1;
  size1 = __get_array_size(s);
  return s;
}


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

x86 assembly (clang, -O2):
<strlwr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__get_array_size@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = tail call i32 @__get_array_size(i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float amt;
  printf("Enter the Amount in Rs: ");
  scanf("%f", &amt);
  printf("The Amt in Paise will be: %.0f\n", (amt * 100));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeab(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xeb2(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter the Amount in Rs: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"The Amt in Paise will be: %.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 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), float* %2)
%5 = load float, float* %2
%6 = fmul float %5, 1.000000e+02
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter the Amount in Rs: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"The Amt in Paise will be: %.0f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 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), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 1.000000e+02
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
void *freeipmi_memcpy(void *dest, const void *src, size_t n) {
  while (0 <= --n)
    ((unsigned char *)dest)[n] = ((unsigned char *)src)[n];
  return (dest);
}


x86 assembly (clang, -O0):
<freeipmi_memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
ja     1142 <freeipmi_memcpy+0x42>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1110 <freeipmi_memcpy+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeipmi_memcpy>:
add    $0xffffffffffffffff,%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rsi,%rdx,1),%eax
mov    %al,(%rdi,%rdx,1)
add    $0xffffffffffffffff,%rdx
jmp    1110 <freeipmi_memcpy+0x10>

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

LLVM IR (-O2):
define noalias i8* @freeipmi_memcpy(i8* nocapture writeonly %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ %2, %3 ], [ %6, %4 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %9
br label %4
}
/* Variables and functions */
float fasterpow2(float);
float fasterexp(float p) { return fasterpow2(1.442695040f * p); }


x86 assembly (clang, -O0):
<fasterexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <fasterpow2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasterexp>:
mulss  0xee8(%rip),%xmm0
jmp    1030 <fasterpow2@plt>

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

LLVM IR (-O2):
define float @fasterexp(float %0) {
%2 = fmul float %0, 0x3FF7154760000000
%3 = tail call float @fasterpow2(float %2)
ret float %3
}
void gscan_(scan_no, feed_no, record, return_code) int *scan_no, *feed_no,
    *record, *return_code;
{}


x86 assembly (clang, -O0):
<gscan_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gscan_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_pointerToConstInt(int *);
void f_5(void) {
  int ta[5];
  int *tp = ta;
  doStuff_pointerToConstInt(tp);
}


x86 assembly (clang, -O0):
<f_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <doStuff_pointerToConstInt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_5>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <doStuff_pointerToConstInt@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @f_5() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @doStuff_pointerToConstInt(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
void on_off_string(char *s, int *config) {
  if (!strcmp(s, "on"))
    *config = true;
  else if (!strcmp(s, "off"))
    *config = false;
}


x86 assembly (clang, -O0):
<on_off_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1148 <on_off_string+0x38>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1170 <on_off_string+0x60>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    116b <on_off_string+0x5b>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1170 <on_off_string+0x60>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_off_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1141 <on_off_string+0x31>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    1149 <on_off_string+0x39>
xor    %eax,%eax
jmp    1146 <on_off_string+0x36>
mov    $0x1,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define void @on_off_string(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = load i32*, i32** %4
store i32 1, i32* %9
br label %17
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = load i32*, i32** %4
store i32 0, i32* %15
br label %16
16: ; preds = %14, %10
br label %17
17: ; preds = %16, %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define void @on_off_string(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = phi i32 [ 1, %2 ], [ 0, %5 ]
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %5
ret void
}
int check_cpp_errors(struct lexer_state *ls) { return 0; }


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

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

LLVM IR (-O0):
%struct.lexer_state = type opaque
define i32 @check_cpp_errors(%struct.lexer_state* %0) {
%2 = alloca %struct.lexer_state*
store %struct.lexer_state* %0, %struct.lexer_state** %2
ret i32 0
}

LLVM IR (-O2):
%struct.lexer_state = type opaque
define i32 @check_cpp_errors(%struct.lexer_state* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void gpioExtiLineConfig(uint8_t portsrc, uint8_t pinsrc) {
  (void)(portsrc);
  (void)(pinsrc);
}


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

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

LLVM IR (-O0):
define void @gpioExtiLineConfig(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
ret void
}

LLVM IR (-O2):
define void @gpioExtiLineConfig(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writehex(char);
void write2hex(char x) {
  writehex(x >> 4);
  writehex(x);
}


x86 assembly (clang, -O0):
<write2hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
movsbl %al,%edi
call   1030 <writehex@plt>
movsbl -0x1(%rbp),%edi
call   1030 <writehex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write2hex>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
sar    $0x4,%al
movsbl %al,%edi
call   1030 <writehex@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <writehex@plt>

LLVM IR (-O0):
define void @write2hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = trunc i32 %5 to i8
%7 = call i32 @writehex(i8 signext %6)
%8 = load i8, i8* %2
%9 = call i32 @writehex(i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @write2hex(i8 signext %0) {
%2 = ashr i8 %0, 4
%3 = tail call i32 @writehex(i8 signext %2)
%4 = tail call i32 @writehex(i8 signext %0)
ret void
}
/* Variables and functions */
unsigned char proto_assembleFrame(unsigned char *, unsigned short *,
                                  unsigned char *, int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *);
unsigned char protoX_readMeterImmd(unsigned char *buf, unsigned short *bufSize,
                                   unsigned char *gatewayId) {
  return proto_assembleFrame(buf, bufSize, gatewayId, 0x00, 0x3E, 0, NULL);
}


x86 assembly (clang, -O0):
<protoX_readMeterImmd>:
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
xor    %r9d,%r9d
mov    $0x3e,%r8d
xor    %eax,%eax
mov    %r9d,%ecx
movq   $0x0,(%rsp)
call   1030 <proto_assembleFrame@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protoX_readMeterImmd>:
push   %rax
movq   $0x0,(%rsp)
xor    %ecx,%ecx
mov    $0x3e,%r8d
xor    %r9d,%r9d
call   1030 <proto_assembleFrame@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @protoX_readMeterImmd(i8* %0, i16* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16*
%6 = alloca i8*
store i8* %0, i8** %4
store i16* %1, i16** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i16*, i16** %5
%9 = load i8*, i8** %6
%10 = call zeroext i8 @proto_assembleFrame(i8* %7, i16* %8, i8* %9, i32 0, i32 62, i32 0, i32* null)
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @protoX_readMeterImmd(i8* %0, i16* %1, i8* %2) {
%4 = tail call zeroext i8 @proto_assembleFrame(i8* %0, i16* %1, i8* %2, i32 0, i32 62, i32 0, i32* null)
ret i8 %4
}
/* Variables and functions */
int __semi_call(int, char const *);
int semi_write0(char const *string) { return __semi_call(4, string); }


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

x86 assembly (clang, -O2):
<semi_write0>:
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <__semi_call@plt>

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

LLVM IR (-O2):
define i32 @semi_write0(i8* %0) {
%2 = tail call i32 @__semi_call(i32 4, i8* %0)
ret i32 %2
}
/* Variables and functions */
double fact_ratio2(int, int);
double pow(int, int);
double Bfunc(int i, int r, double g) {
  return fact_ratio2(i, r) * pow(4 * g, r - i);
}


x86 assembly (clang, -O0):
<Bfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <fact_ratio2@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb5(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    -0x8(%rbp),%esi
sub    -0x4(%rbp),%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bfunc>:
push   %rbp
push   %rbx
push   %rax
movsd  %xmm0,(%rsp)
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <fact_ratio2@plt>
movsd  (%rsp),%xmm1
mulsd  0xec2(%rip),%xmm1
movsd  %xmm0,(%rsp)
cvttsd2si %xmm1,%edi
sub    %ebp,%ebx
mov    %ebx,%esi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @Bfunc(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call double @fact_ratio2(i32 %7, i32 %8)
%10 = load double, double* %6
%11 = fmul double 4.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = call double @pow(i32 %12, i32 %15)
%17 = fmul double %9, %16
ret double %17
}

LLVM IR (-O2):
define double @Bfunc(i32 %0, i32 %1, double %2) {
%4 = tail call double @fact_ratio2(i32 %0, i32 %1)
%5 = fmul double %2, 4.000000e+00
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %1, %0
%8 = tail call double @pow(i32 %6, i32 %7)
%9 = fmul double %4, %8
ret double %9
}
char *hexnum(char *buf, unsigned int num) {
  char *p = buf + 5;
  num &= 0xffff;
  *--p = 0;
  do {
    *--p = "0123456789abcdef"[num % 16];
    num /= 16;
  } while (num);
  return p;
}


x86 assembly (clang, -O0):
<hexnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,-0x1(%rax)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xeba(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,-0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <hexnum+0x35>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexnum>:
mov    %rdi,%rax
movzwl %si,%ecx
movb   $0x0,0x4(%rdi)
add    $0x4,%rax
lea    0xeeb(%rip),%rdi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%esi
and    $0xf,%esi
movzbl (%rsi,%rdi,1),%edx
mov    %dl,-0x1(%rax)
add    $0xffffffffffffffff,%rax
mov    %ecx,%edx
shr    $0x4,%edx
cmp    $0xf,%ecx
mov    %edx,%ecx
ja     1120 <hexnum+0x20>
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define i8* @hexnum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 5
store i8* %7, i8** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 65535
store i32 %9, i32* %4
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 -1
store i8* %11, i8** %5
store i8 0, i8* %11
br label %12
12: ; preds = %22, %2
%13 = load i32, i32* %4
%14 = urem i32 %13, 16
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %5
store i8 %17, i8* %19
%20 = load i32, i32* %4
%21 = udiv i32 %20, 16
store i32 %21, i32* %4
br label %22
22: ; preds = %12
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %12, label %25
25: ; preds = %22
%26 = load i8*, i8** %5
ret i8* %26
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define i8* @hexnum(i8* writeonly %0, i32 %1) {
%3 = and i32 %1, 65535
%4 = getelementptr inbounds i8, i8* %0, i64 4
store i8 0, i8* %4
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ %3, %2 ], [ %13, %5 ]
%7 = phi i8* [ %4, %2 ], [ %12, %5 ]
%8 = and i32 %6, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %7, i64 -1
store i8 %11, i8* %12
%13 = lshr i32 %6, 4
%14 = icmp ult i32 %6, 16
br i1 %14, label %15, label %5
15: ; preds = %5
ret i8* %12
}
/* Variables and functions */
int medusaDataReadyTimed(int, int /*<<< orphan*/, int /*<<< orphan*/);
int medusaDataReady(int socket) { return (medusaDataReadyTimed(socket, 0, 0)); }


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

x86 assembly (clang, -O2):
<medusaDataReady>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <medusaDataReadyTimed@plt>

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

LLVM IR (-O2):
define i32 @medusaDataReady(i32 %0) {
%2 = tail call i32 @medusaDataReadyTimed(i32 %0, i32 0, i32 0)
ret i32 %2
}
int emac2_etherstatsjabbers_set(unsigned int dev_id,
                                union emac2_etherstatsjabbers_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_etherstatsjabbers_u = type opaque
define i32 @emac2_etherstatsjabbers_set(i32 %0, %union.emac2_etherstatsjabbers_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_etherstatsjabbers_u*
store i32 %0, i32* %3
store %union.emac2_etherstatsjabbers_u* %1, %union.emac2_etherstatsjabbers_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_etherstatsjabbers_u = type opaque
define i32 @emac2_etherstatsjabbers_set(i32 %0, %union.emac2_etherstatsjabbers_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
void *fort_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *custom_fort_calloc(size_t nmemb, size_t size) {
  size_t total_size = nmemb * size;
  void *result = fort_malloc(total_size);
  if (result != NULL)
    memset(result, 0, total_size);
  return result;
}


x86 assembly (clang, -O0):
<custom_fort_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fort_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1164 <custom_fort_calloc+0x44>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_fort_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <fort_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <custom_fort_calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @custom_fort_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i8* @fort_malloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i64, i64* %5
%17 = call i32 @memset(i8* %15, i32 0, i64 %16)
br label %18
18: ; preds = %14, %2
%19 = load i8*, i8** %6
ret i8* %19
}

LLVM IR (-O2):
define i8* @custom_fort_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @fort_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 0, j = 1, k;
  k = i << j + j << i;
  printf("%d", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char);
void dropData2() {
  float ff = 3.14;
  char *p = &ff;
  printf("%d  %d   %d   %d\n", *p, *(p + 1), *(p + 2), *(p + 3));
}


x86 assembly (clang, -O0):
<dropData2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%sil
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xeb7(%rip),%rdi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl 0x3(%rax),%r8d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropData2>:
lea    0xee9(%rip),%rdi
mov    $0xffffffc3,%esi
mov    $0xfffffff5,%edx
mov    $0x48,%ecx
mov    $0x40,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%d %d %d %d\0A\00"
define void @dropData2() {
%1 = alloca float
%2 = alloca i8*
store float 0x40091EB860000000, float* %1
%3 = bitcast float* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %8, i8 signext %11, i8 signext %14)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d %d %d %d\0A\00"
define void @dropData2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext -61, i8 signext -11, i8 signext 72, i8 signext 64)
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double f(double x, double y) {
  return -8.0 * M_PI * M_PI * sin(2.0 * M_PI * (x + y));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
mov    0x2eb7(%rip),%rax
mulsd  (%rax),%xmm0
mov    0x2eac(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb3(%rip),%xmm0
mov    0x2e94(%rip),%rax
mulsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm2
movsd  0xedc(%rip),%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%rsp)
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* @M_PI
%6 = fmul double -8.000000e+00, %5
%7 = load double, double* @M_PI
%8 = fmul double %6, %7
%9 = load double, double* @M_PI
%10 = fmul double 2.000000e+00, %9
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fadd double %11, %12
%14 = fmul double %10, %13
%15 = call double @sin(double %14)
%16 = fmul double %8, %15
ret double %16
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @f(double %0, double %1) {
%3 = load double, double* @M_PI
%4 = fmul double %3, -8.000000e+00
%5 = fmul double %3, %4
%6 = fmul double %3, 2.000000e+00
%7 = fadd double %0, %1
%8 = fmul double %7, %6
%9 = tail call double @sin(double %8)
%10 = fmul double %9, %5
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char c, int x, int y) {
  if (c == 27)
    exit(0);
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
jne    1138 <keyboard+0x28>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1117 <keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 27
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
void auth_pam_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @auth_pam_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findAndReplace(char *, char, char);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char string[] = "find-and-replace";
  printf("%s\n", string);
  findAndReplace(string, '-', '_');
  printf("%s\n", string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2d,%esi
mov    $0x5f,%edx
call   1030 <findAndReplace@plt>
lea    -0x20(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
lea    0xed3(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2d,%esi
mov    $0x5f,%edx
call   1030 <findAndReplace@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.string = [17 x i8] c"find-and-replace\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = bitcast [17 x i8]* %1 to i8*
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%6 = call i32 @findAndReplace(i8* %5, i8 signext 45, i8 signext 95)
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [17 x i8] c"find-and-replace\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @findAndReplace(i8* %2, i8 signext 45, i8 signext 95)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
char *strcat(char *dst, const char *src) {
  char *cp = dst;
  while (*cp)
    cp++;
  while (*cp++ = *src++)
    ;
  return (dst);
}


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

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <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 <strcat+0x20>
ret

LLVM IR (-O0):
define i8* @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** %5
%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** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
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** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
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** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @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 numeric_cmp(const void *a, const void *b) {
  long ai = (long)a;
  long bi = (long)b;
  return ai - bi;
}


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

x86 assembly (clang, -O2):
<numeric_cmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @numeric_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = sub nsw i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @numeric_cmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub nsw i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
void gtk_tree_sortable_set_default_sort_func() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_sortable_set_default_sort_func() {
ret void
}
/* Variables and functions */
int tl_lex();
int tl_yylex(void) {
  int c = tl_lex();
  return c;
}


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

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

LLVM IR (-O0):
define i32 @tl_yylex() {
%1 = alloca i32
%2 = call i32 (...) @tl_lex()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @tl_yylex() {
%1 = tail call i32 (...) @tl_lex()
ret i32 %1
}