xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ write_to_vga(scalar_t__, char);
int set_char_at_off(char x, char y, char c) {
  write_to_vga(y * 160 + x * 2 + 0, c);
}


x86 assembly (clang, -O0):
<set_char_at_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
movsbl -0x6(%rbp),%eax
imul   $0xa0,%eax,%eax
movsbl -0x5(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
add    $0x0,%eax
movslq %eax,%rdi
movsbl -0x7(%rbp),%esi
call   1030 <write_to_vga@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_char_at_off>:
lea    (%rsi,%rsi,4),%eax
shl    $0x5,%eax
lea    (%rax,%rdi,2),%eax
movslq %eax,%rdi
mov    %edx,%esi
jmp    1030 <write_to_vga@plt>

LLVM IR (-O0):
define i32 @set_char_at_off(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = mul nsw i32 %9, 160
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = mul nsw i32 %12, 2
%14 = add nsw i32 %10, %13
%15 = add nsw i32 %14, 0
%16 = sext i32 %15 to i64
%17 = load i8, i8* %7
%18 = call i32 @write_to_vga(i64 %16, i8 signext %17)
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @set_char_at_off(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = sext i8 %1 to i32
%5 = mul nsw i32 %4, 160
%6 = sext i8 %0 to i32
%7 = shl nsw i32 %6, 1
%8 = add nsw i32 %5, %7
%9 = sext i32 %8 to i64
%10 = tail call i32 @write_to_vga(i64 %9, i8 signext %2)
ret i32 undef
}
int vgchange_encryption_disk(void) {
  int ret = 0;
  int i = 0;
}


x86 assembly (clang, -O0):
<vgchange_encryption_disk>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vgchange_encryption_disk() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ js_load_file(int /*<<< orphan*/ *, size_t *, char const *);
int /*<<< orphan*/ perror_exit(int, char const *);
char *load_file(const char *filename, size_t *lenp) {
  char *buf;
  size_t buf_len;
  buf = (char *)js_load_file(NULL, &buf_len, filename);
  if (!buf)
    perror_exit(1, filename);
  if (lenp)
    *lenp = buf_len;
  return buf;
}


x86 assembly (clang, -O0):
<load_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
lea    -0x20(%rbp),%rsi
call   1030 <js_load_file@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <load_file+0x3e>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1040 <perror_exit@plt>
cmpq   $0x0,-0x10(%rbp)
je     1174 <load_file+0x54>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_file>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x8(%rsp),%rsi
xor    %edi,%edi
mov    %r15,%rdx
call   1030 <js_load_file@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1160 <load_file+0x40>
test   %r14,%r14
je     1153 <load_file+0x33>
mov    0x8(%rsp),%rax
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%edi
mov    %r15,%rsi
call   1040 <perror_exit@plt>
test   %r14,%r14
jne    114b <load_file+0x2b>
jmp    1153 <load_file+0x33>

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

LLVM IR (-O2):
define i8* @load_file(i8* %0, i64* writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @js_load_file(i32* null, i64* %3, i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @perror_exit(i32 1, i8* %0)
br label %9
9: ; preds = %7, %2
%10 = icmp eq i64* %1, null
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = load i64, i64* %3
store i64 %12, i64* %1
br label %13
13: ; preds = %11, %9
%14 = inttoptr i64 %5 to i8*
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void epoller_free(int epoll_fd) { close(epoll_fd); }


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

x86 assembly (clang, -O2):
<epoller_free>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @epoller_free(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int bbm_long_read(void *, unsigned short, unsigned int *);
signed int bbm_com_long_read(void *handle, unsigned short addr,
                             unsigned int *data) {
  signed int res;
  res = bbm_long_read(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_long_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <bbm_long_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_long_read>:
jmp    1030 <bbm_long_read@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_long_read(i8* %0, i16 zeroext %1, i32* %2) {
%4 = tail call i32 @bbm_long_read(i8* %0, i16 zeroext %1, i32* %2)
ret i32 %4
}
void freeColumnList(char **azCol) {
  int i;
  for (i = 1; azCol[i]; i++) {
    sqlite3_free(azCol[i]);
  }
  sqlite3_free(azCol);
}


x86 assembly (clang, -O0):
<freeColumnList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1157 <freeColumnList+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <sqlite3_free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <freeColumnList+0x13>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <sqlite3_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeColumnList>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x8(%rdi),%rdi
test   %rdi,%rdi
je     1143 <freeColumnList+0x33>
lea    0x10(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <sqlite3_free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freeColumnList+0x20>
mov    %r14,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sqlite3_free@plt>

LLVM IR (-O0):
define void @freeColumnList(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 1, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i8**, i8*** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @sqlite3_free to i32 (i8*, ...)*)(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i8**, i8*** %2
%23 = call i32 (i8**, ...) bitcast (i32 (...)* @sqlite3_free to i32 (i8**, ...)*)(i8** %22)
ret void
}

LLVM IR (-O2):
define void @freeColumnList(i8** %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 1, %1 ]
%7 = phi i8* [ %11, %5 ], [ %3, %1 ]
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @sqlite3_free to i32 (i8*, ...)*)(i8* %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = tail call i32 (i8**, ...) bitcast (i32 (...)* @sqlite3_free to i32 (i8**, ...)*)(i8** %0)
ret void
}
__attribute__((no, noclone)) int foo() {
  unsigned long long a[] = {2, 21};
  return a[0] * a[1];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.foo.a = [2 x i64] [i64 2, i64 21]
define i32 @foo() {
%1 = alloca [2 x i64]
%2 = bitcast [2 x i64]* %1 to i8*
%3 = getelementptr inbounds [2 x i64], [2 x i64]* %1, i64 0, i64 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %1, i64 0, i64 1
%6 = load i64, i64* %5
%7 = mul i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 42
}
int my_strcmp(const char *p, const char *q) {
  while (*p == *q) {
    if (*p++ == 0) {
      return 0;
    }
    q++;
  }
  return *p - *q;
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115a <my_strcmp+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1149 <my_strcmp+0x49>
movl   $0x0,-0x4(%rbp)
jmp    116d <my_strcmp+0x6d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <my_strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <my_strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <my_strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
void glmGenerateZeroMatrix2d(double m[4]) { memset(m, 0, 4 * sizeof(double)); }


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

x86 assembly (clang, -O2):
<glmGenerateZeroMatrix2d>:
xor    %esi,%esi
mov    $0x20,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @glmGenerateZeroMatrix2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = call i32 @memset(double* %3, i32 0, i32 32)
ret void
}

LLVM IR (-O2):
define void @glmGenerateZeroMatrix2d(double* %0) {
%2 = tail call i32 @memset(double* %0, i32 0, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kputChar(char);
void kWrite(char *str, int length) {
  int i = 0;
  while (length > 0) {
    kputChar(str[i++]);
    length--;
  }
}


x86 assembly (clang, -O0):
<kWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1159 <kWrite+0x49>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <kputChar@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <kWrite+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kWrite>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <kWrite+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
add    $0x1,%rbx
call   1030 <kputChar@plt>
cmp    %rbx,%r15
jne    1130 <kWrite+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @kWrite(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = tail call i32 @kputChar(i8 signext %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *foo2(void) {
  static char buf[1000];
  strcpy(buf, "hello");
  return buf;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2f12(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@foo2.buf = internal global [1000 x i8] zeroinitializer
@.str = [6 x i8] c"hello\00"
define i8* @foo2() {
%1 = call i32 @strcpy(i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @foo2.buf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @foo2.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@foo2.buf = internal global [1000 x i8] zeroinitializer
@.str = [6 x i8] c"hello\00"
define i8* @foo2() {
%1 = tail call i32 @strcpy(i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @foo2.buf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @foo2.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_batch_context_recv_close_on_server_cancelled() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_batch_context_recv_close_on_server_cancelled>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_batch_context_recv_close_on_server_cancelled>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_recv_close_on_server_cancelled() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_recv_close_on_server_cancelled() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
struct hle_t {
  int dummy;
};
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ alist_multQ44(struct hle_t *, int, int, int);
void HILOGAIN(struct hle_t *hle, uint32_t w1, uint32_t w2) {
  int8_t gain = (w1 >> 16);
  uint16_t count = w1;
  uint16_t dmem = (w2 >> 16);
  alist_multQ44(hle, dmem, count, gain);
}


x86 assembly (clang, -O0):
<HILOGAIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <alist_multQ44@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HILOGAIN>:
mov    %edx,%eax
mov    %esi,%edx
mov    %esi,%ecx
sar    $0x10,%ecx
sar    $0x10,%eax
mov    %eax,%esi
jmp    1030 <alist_multQ44@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @HILOGAIN(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = ashr i32 %10, 16
store i32 %11, i32* %7
%12 = load i32, i32* %5
store i32 %12, i32* %8
%13 = load i32, i32* %6
%14 = ashr i32 %13, 16
store i32 %14, i32* %9
%15 = load %struct.hle_t*, %struct.hle_t** %4
%16 = load i32, i32* %9
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = call i32 @alist_multQ44(%struct.hle_t* %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @HILOGAIN(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = ashr i32 %1, 16
%5 = ashr i32 %2, 16
%6 = tail call i32 @alist_multQ44(%struct.hle_t* %0, i32 %5, i32 %1, i32 %4)
ret void
}
int get_end(int vends[], int i) {
  while (vends[i] != 0) {
    i = vends[i];
  }
  return i;
}


x86 assembly (clang, -O0):
<get_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1130 <get_end+0x30>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0xc(%rbp)
jmp    110b <get_end+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_end>:
mov    %esi,%eax
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%esi
test   %esi,%esi
jne    1100 <get_end>
ret

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

LLVM IR (-O2):
define i32 @get_end(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %7, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %4
}
int compare_counts(const void *lhs, const void *rhs) {
  if (*((unsigned int *)lhs) < *((unsigned int *)rhs))
    return -1;
  if (*((unsigned int *)lhs) == *((unsigned int *)rhs))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<compare_counts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jae    112a <compare_counts+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <compare_counts+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <compare_counts+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <compare_counts+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_counts>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_counts(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t gettimeusec() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  int64_t t = (int64_t)tv.tv_sec * 1000000 + (int64_t)tv.tv_usec;
  return t;
}


x86 assembly (clang, -O0):
<gettimeusec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeusec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @gettimeusec() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @gettimeusec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ my_crc32c(int /*<<< orphan*/ const *, size_t);
int /*<<< orphan*/ my_crc32c_runtime_detection();
uint32_t my_crc32c_first(const uint8_t *buf, size_t len) {
  my_crc32c_runtime_detection();
  return my_crc32c(buf, len);
}


x86 assembly (clang, -O0):
<my_crc32c_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <my_crc32c_runtime_detection@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <my_crc32c@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @my_crc32c_first(i32* %0, i64 %1) {
%3 = tail call i32 (...) @my_crc32c_runtime_detection()
%4 = tail call i32 @my_crc32c(i32* %0, i64 %1)
ret i32 %4
}
/* Type definitions */
typedef union ibv_gid {
  int dummy;
} ibv_gid;
typedef int /*<<< orphan*/ uint8_t;
struct ibv_context {
  int dummy;
};

/* Variables and functions */
int _query_gid(struct ibv_context *, int /*<<< orphan*/, int, union ibv_gid *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_query_gid(struct ibv_context *context, uint8_t port_num, int index,
                  union ibv_gid *gid) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _query_gid(context, port_num, index, gid);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_query_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <_query_gid@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_query_gid>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <_query_gid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
%union.ibv_gid = type { i32 }
define i32 @ibv_query_gid(%struct.ibv_context* %0, i32 %1, i32 %2, %union.ibv_gid* %3) {
%5 = alloca %struct.ibv_context*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %union.ibv_gid*
%9 = alloca i32
store %struct.ibv_context* %0, %struct.ibv_context** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %union.ibv_gid* %3, %union.ibv_gid** %8
%10 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%11 = load %struct.ibv_context*, %struct.ibv_context** %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load %union.ibv_gid*, %union.ibv_gid** %8
%15 = call i32 @_query_gid(%struct.ibv_context* %11, i32 %12, i32 %13, %union.ibv_gid* %14)
store i32 %15, i32* %9
%16 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
%union.ibv_gid = type { i32 }
define i32 @ibv_query_gid(%struct.ibv_context* %0, i32 %1, i32 %2, %union.ibv_gid* %3) {
%5 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%6 = tail call i32 @_query_gid(%struct.ibv_context* %0, i32 %1, i32 %2, %union.ibv_gid* %3)
%7 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %6
}
int foo(int i) {
  int a = 0x20;
  int b = 0x10;
  return a + b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
store i32 16, 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 @foo(i32 %0) {
ret i32 48
}
/* Variables and functions */
int /*<<< orphan*/ fd_w25q16dw_wait_while_busy();
void fd_hal_external_flash_wait_while_busy(void) {
  fd_w25q16dw_wait_while_busy();
}


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

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

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

LLVM IR (-O2):
define void @fd_hal_external_flash_wait_while_busy() {
%1 = tail call i32 (...) @fd_w25q16dw_wait_while_busy()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Usage:\n catdoc [-vu8btawxlV] [-m number] [-s charset] "
         "[-d charset] [ -f format] files\n");
}


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

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

LLVM IR (-O0):
@.str = [87 x i8] c"Usage:\0A catdoc [-vu8btawxlV] [-m number] [-s charset] [-d charset] [ -f format] files\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [86 x i8] c"Usage:\0A catdoc [-vu8btawxlV] [-m number] [-s charset] [-d charset] [ -f format] files\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
ret void
}
int f_le_rm2(float a1, float *a2) { return !(((a1) <= (*a2))); }


x86 assembly (clang, -O0):
<f_le_rm2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_le_rm2>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @f_le_rm2(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = fcmp ole float %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_le_rm2(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp ult float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void TEKMAINunload(void) {}


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

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

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

LLVM IR (-O2):
define void @TEKMAINunload() {
ret void
}
int add1(int n) { return n + 1; }


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

x86 assembly (clang, -O2):
<add1>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @add1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memmgr_init();
void malloc_init(void) { memmgr_init(); }


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

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

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

LLVM IR (-O2):
define void @malloc_init() {
%1 = tail call i32 (...) @memmgr_init()
ret void
}
void foo(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @foo(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(int /*<<< orphan*/ *, int,
                                 int /*<<< orphan*/ *, int, int, int);
void pixel_avg_8x16(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                    int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 8, 16);
}


x86 assembly (clang, -O0):
<pixel_avg_8x16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x8,%r8d
mov    $0x10,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_8x16>:
mov    $0x8,%r8d
mov    $0x10,%r9d
jmp    1030 <pixel_avg_wxh@plt>

LLVM IR (-O0):
define void @pixel_avg_8x16(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
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_avg_wxh(i32* %9, i32 %10, i32* %11, i32 %12, i32 8, i32 16)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_8x16(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 8, i32 16)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int floor(int);
scalar_t__ rand();
int random2(int i, int j) {
  return i + floor((1 + j - i) * (double)rand() / (((double)RAND_MAX) + 1));
}


x86 assembly (clang, -O0):
<random2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2e86(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xe91(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random2>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
sub    %edi,%esi
add    $0x1,%esi
cvtsi2sd %esi,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2e9c(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xea7(%rip),%xmm1
mulsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @random2(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 1, %6
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = call i64 (...) @rand()
%12 = sitofp i64 %11 to double
%13 = fmul double %10, %12
%14 = load i64, i64* @RAND_MAX
%15 = sitofp i64 %14 to double
%16 = fadd double %15, 1.000000e+00
%17 = fdiv double %13, %16
%18 = fptosi double %17 to i32
%19 = call i32 @floor(i32 %18)
%20 = add nsw i32 %5, %19
ret i32 %20
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @random2(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = sitofp i32 %4 to double
%6 = tail call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = fmul double %5, %7
%9 = load i64, i64* @RAND_MAX
%10 = sitofp i64 %9 to double
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %8, %11
%13 = fptosi double %12 to i32
%14 = tail call i32 @floor(i32 %13)
%15 = add nsw i32 %14, %0
ret i32 %15
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int __xstat64(int, char const *, struct stat64 *);
int __lxstat64(int vers, const char *file, struct stat64 *buf) {
  return __xstat64(vers, file, buf);
}


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

x86 assembly (clang, -O2):
<__lxstat64>:
jmp    1030 <__xstat64@plt>

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

LLVM IR (-O2):
%struct.stat64 = type { i32 }
define i32 @__lxstat64(i32 %0, i8* %1, %struct.stat64* %2) {
%4 = tail call i32 @__xstat64(i32 %0, i8* %1, %struct.stat64* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
int main() {
  char *args[] = {"/bin/sh", NULL};
  execve(args[0], args, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2cf1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cee(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = load i8*, i8** %3
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%6 = call i32 @execve(i8* %4, i8** %5, i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3, i32* null)
ret i32 0
}
/* Type definitions */
struct xfs_mount {
  int dummy;
};
struct xfs_dir2_data_hdr {
  int dummy;
};
struct xfs_dir2_data_entry {
  int dummy;
};

/* Variables and functions */
int xfs_dir3_data_first_offset(struct xfs_mount *);
struct xfs_dir2_data_entry *
xfs_dir3_data_first_entry_p(struct xfs_mount *mp,
                            struct xfs_dir2_data_hdr *hdr) {
  return (struct xfs_dir2_data_entry *)((char *)hdr +
                                        xfs_dir3_data_first_offset(mp));
}


x86 assembly (clang, -O0):
<xfs_dir3_data_first_entry_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xfs_dir3_data_first_offset@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfs_dir3_data_first_entry_p>:
push   %rbx
mov    %rsi,%rbx
call   1030 <xfs_dir3_data_first_offset@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.xfs_dir2_data_entry = type { i32 }
%struct.xfs_mount = type { i32 }
%struct.xfs_dir2_data_hdr = type { i32 }
define %struct.xfs_dir2_data_entry* @xfs_dir3_data_first_entry_p(%struct.xfs_mount* %0, %struct.xfs_dir2_data_hdr* %1) {
%3 = alloca %struct.xfs_mount*
%4 = alloca %struct.xfs_dir2_data_hdr*
store %struct.xfs_mount* %0, %struct.xfs_mount** %3
store %struct.xfs_dir2_data_hdr* %1, %struct.xfs_dir2_data_hdr** %4
%5 = load %struct.xfs_dir2_data_hdr*, %struct.xfs_dir2_data_hdr** %4
%6 = bitcast %struct.xfs_dir2_data_hdr* %5 to i8*
%7 = load %struct.xfs_mount*, %struct.xfs_mount** %3
%8 = call i32 @xfs_dir3_data_first_offset(%struct.xfs_mount* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = bitcast i8* %10 to %struct.xfs_dir2_data_entry*
ret %struct.xfs_dir2_data_entry* %11
}

LLVM IR (-O2):
%struct.xfs_dir2_data_entry = type { i32 }
%struct.xfs_mount = type { i32 }
%struct.xfs_dir2_data_hdr = type { i32 }
define %struct.xfs_dir2_data_entry* @xfs_dir3_data_first_entry_p(%struct.xfs_mount* %0, %struct.xfs_dir2_data_hdr* readnone %1) {
%3 = bitcast %struct.xfs_dir2_data_hdr* %1 to i8*
%4 = tail call i32 @xfs_dir3_data_first_offset(%struct.xfs_mount* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = bitcast i8* %6 to %struct.xfs_dir2_data_entry*
ret %struct.xfs_dir2_data_entry* %7
}
float re_mul_f(float re1, float im1, float re2, float im2) {
  return re1 * re2 - im1 * im2;
}


x86 assembly (clang, -O0):
<re_mul_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_mul_f>:
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @re_mul_f(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %7
%11 = load float, float* %6
%12 = load float, float* %8
%13 = fmul float %11, %12
%14 = fneg float %13
%15 = call float @llvm.fmuladd.f32(float %9, float %10, float %14)
ret float %15
}

LLVM IR (-O2):
define float @re_mul_f(float %0, float %1, float %2, float %3) {
%5 = fneg float %1
%6 = fmul float %5, %3
%7 = tail call float @llvm.fmuladd.f32(float %0, float %2, float %6)
ret float %7
}