xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
void minipack_pack_str16(void *ptr, uint16_t length, size_t *sz) {
  *sz = 3;
  *((uint8_t *)ptr) = 0xDA;
  *((uint16_t *)(ptr + 1)) = htons(length);
}


x86 assembly (clang, -O0):
<minipack_pack_str16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x3,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xda,(%rax)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_str16>:
push   %rbx
mov    %rdi,%rbx
movq   $0x3,(%rdx)
movl   $0xda,(%rdi)
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0x1(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @minipack_pack_str16(i8* nocapture writeonly %0, i32 %1, i64* nocapture writeonly %2) {
store i64 3, i64* %2
%4 = bitcast i8* %0 to i32*
store i32 218, i32* %4
%5 = tail call i32 @htons(i32 %1)
%6 = getelementptr i8, i8* %0, i64 1
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}
char *uwsgi_cheap_string(char *buf, int len) {
  int i;
  char *cheap_buf = buf - 1;
  for (i = 0; i < len; i++) {
    *cheap_buf++ = buf[i];
  }
  buf[len - 1] = 0;
  return buf - 1;
}


x86 assembly (clang, -O0):
<uwsgi_cheap_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <uwsgi_cheap_string+0x54>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111e <uwsgi_cheap_string+0x1e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_cheap_string>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
lea    -0x1(%rdi),%r14
test   %esi,%esi
jle    112e <uwsgi_cheap_string+0x1e>
mov    %ebp,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @uwsgi_cheap_string(i8* %0, i32 %1) {
%3 = getelementptr i8, i8* %0, i64 -1
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %2
%8 = add nsw i32 %1, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret i8* %3
}
int Operand_label12_rtoa(unsigned int *valp, unsigned int pc) {
  *valp += pc;
  return 0;
}


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

x86 assembly (clang, -O2):
<Operand_label12_rtoa>:
add    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_label12_rtoa(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, %1
store i32 %4, i32* %0
ret i32 0
}
__attribute__((always_)) void pci_msi_shutdown(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_msi_shutdown(%struct.pci_dev* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_read_block(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *, int);
uint16_t eeprom_read_word(const uint16_t *addr) {
  uint16_t ret = 0;
  eeprom_read_block(&ret, addr, 2);
  return ret;
}


x86 assembly (clang, -O0):
<eeprom_read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x2,%edx
call   1030 <eeprom_read_block@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_read_word>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <eeprom_read_block@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @eeprom_read_word(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @eeprom_read_block(i32* %2, i32* %0, i32 2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
unsigned char *cbor_write_type_long_size(unsigned char *, unsigned int,
                                         int /*<<< orphan*/,
                                         unsigned long long);
unsigned char *cbor_write_plong(unsigned char *data, unsigned int size,
                                unsigned long long value) {
  return cbor_write_type_long_size(data, size, 0, value);
}


x86 assembly (clang, -O0):
<cbor_write_plong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <cbor_write_type_long_size@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_write_plong>:
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <cbor_write_type_long_size@plt>

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

LLVM IR (-O2):
define i8* @cbor_write_plong(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @cbor_write_type_long_size(i8* %0, i32 %1, i32 0, i64 %2)
ret i8* %4
}
/* Variables and functions */
int mult(int, int);
int subs(int, int);
int op(int a, int b, int c, int d) { return mult(a, b) + subs(c, d); }


x86 assembly (clang, -O0):
<op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mult@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <subs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <mult@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <subs@plt>
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @op(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 = call i32 @mult(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @subs(i32 %12, i32 %13)
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @op(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mult(i32 %0, i32 %1)
%6 = tail call i32 @subs(i32 %2, i32 %3)
%7 = add nsw i32 %6, %5
ret i32 %7
}
/* Variables and functions */
scalar_t__ malloc(int);
void getptr(char *p) { p = (char *)malloc(100); }


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

x86 assembly (clang, -O2):
<getptr>:
mov    $0x64,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @getptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @malloc(i32 100)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
ret void
}

LLVM IR (-O2):
define void @getptr(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 100)
ret void
}
void swap_long_buf(N, buf) int N;
long *buf;
{
  int i;
  for (i = 0; i < N; i++) {
    swap_long(buf++);
  }
}


x86 assembly (clang, -O0):
<swap_long_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <swap_long_buf+0x46>
mov    -0x10(%rbp),%rdi
mov    %rdi,%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <swap_long@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <swap_long_buf+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_long_buf>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1136 <swap_long_buf+0x26>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
lea    0x8(%rsi),%r14
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <swap_long@plt>
mov    %r14,%rsi
add    $0xffffffff,%ebx
jne    1120 <swap_long_buf+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @swap_long_buf(i32 %0, i64* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i64* [ %7, %4 ], [ %1, %2 ]
%7 = getelementptr inbounds i64, i64* %6, i64 1
%8 = tail call i32 (i64*, ...) bitcast (i32 (...)* @swap_long to i32 (i64*, ...)*)(i64* %6)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
const char *libinjection_version() { return "3.9.1"; }


x86 assembly (clang, -O0):
<libinjection_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libinjection_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"3.9.1\00"
define i8* @libinjection_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"3.9.1\00"
define i8* @libinjection_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int CRYPTO_ONCE;

/* Variables and functions */
int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void)) {
  if (*once != 0)
    return 1;
  init();
  *once = 1;
  return 1;
}


x86 assembly (clang, -O0):
<CRYPTO_THREAD_run_once>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1129 <CRYPTO_THREAD_run_once+0x29>
movl   $0x1,-0x4(%rbp)
jmp    113d <CRYPTO_THREAD_run_once+0x3d>
call   *-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_THREAD_run_once>:
push   %rbx
cmpl   $0x0,(%rdi)
jne    1111 <CRYPTO_THREAD_run_once+0x11>
mov    %rdi,%rbx
call   *%rsi
movl   $0x1,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CRYPTO_THREAD_run_once(i32* nocapture %0, void ()* nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
tail call void %1()
store i32 1, i32* %0
br label %6
6: ; preds = %2, %5
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ g_mutex_lock(void *);
int gcry_gthread_mutex_lock(void **lock) {
  g_mutex_lock(*lock);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gcry_gthread_mutex_lock(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @g_mutex_lock(i8* %2)
ret i32 0
}
/* Variables and functions */
size_t snprintf(char *, size_t, char *, double);
size_t SCPI_DoubleToStr(double val, char *str, size_t len) {
  return snprintf((str), (len), "%lg", (val));
}


x86 assembly (clang, -O0):
<SCPI_DoubleToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movsd  -0x8(%rbp),%xmm0
lea    0xec7(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCPI_DoubleToStr>:
lea    0xee9(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lg\00"
define i64 @SCPI_DoubleToStr(double %0, i8* %1, i64 %2) {
%4 = alloca double
%5 = alloca i8*
%6 = alloca i64
store double %0, double* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load double, double* %4
%10 = call i64 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
ret i64 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lg\00"
define i64 @SCPI_DoubleToStr(double %0, i8* %1, i64 %2) {
%4 = tail call i64 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret i64 %4
}
int d_bge_cr2(double a1) { return !(__builtin_isgreaterequal(100, a1)); }


x86 assembly (clang, -O0):
<d_bge_cr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_cr2>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @d_bge_cr2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_bge_cr2(double %0) {
%2 = fcmp ugt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
size_t randgen(int);
char rand_letter_downcase(void) {
  return "abcdefghijklmnopqrstuvwxyz"[randgen(26)];
}


x86 assembly (clang, -O0):
<rand_letter_downcase>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
call   1030 <randgen@plt>
mov    %rax,%rcx
lea    0xed8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_letter_downcase>:
push   %rax
mov    $0x1a,%edi
call   1030 <randgen@plt>
lea    0xede(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define signext i8 @rand_letter_downcase() {
%1 = call i64 @randgen(i32 26)
%2 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %1
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define signext i8 @rand_letter_downcase() {
%1 = tail call i64 @randgen(i32 26)
%2 = getelementptr inbounds [27 x i8], [27 x i8]* @.str, i64 0, i64 %1
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
scalar_t__ EOF;
int EXIT_SUCCESS;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
int main(int argc, char **argv) {
  long nc;
  nc = 0;
  while (getchar() != EOF)
    nc++;
  printf("%ld\n", nc);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
je     1166 <main+0x46>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113e <main+0x1e>
mov    -0x18(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %8, %3 ]
%5 = tail call i64 (...) @getchar()
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
%8 = add nuw nsw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Recursive(int /*<<< orphan*/, long);
void *Thread(void *arg) {
  long thread = (long)arg;
  Recursive(0, thread);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @Thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @Recursive(i32 0, i64 %6)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Thread(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @Recursive(i32 0, i64 %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ system(char *);
void display_winner(int lane) {
  char cmdline[80];
  system("clear");
  snprintf(cmdline, 79, "toilet -f bigmono12 -F border \"Lane %d\"", lane);
  system(cmdline);
}


x86 assembly (clang, -O0):
<display_winner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <system@plt>
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x4f,%esi
lea    0xebc(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <system@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_winner>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %edi,%ebx
lea    0xed0(%rip),%rdi
call   1030 <system@plt>
lea    0xeca(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x4f,%esi
mov    %ebx,%ecx
call   1040 <snprintf@plt>
mov    %r14,%rdi
call   1030 <system@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [40 x i8] c"toilet -f bigmono12 -F border \22Lane %d\22\00"
define void @display_winner(i32 %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 %0, i32* %2
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 79, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%9 = call i32 @system(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [40 x i8] c"toilet -f bigmono12 -F border \22Lane %d\22\00"
define void @display_winner(i32 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @snprintf(i8* %3, i32 79, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
double __nv_acos(double);
double acos(double __a) { return __nv_acos(__a); }


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

x86 assembly (clang, -O2):
<acos>:
jmp    1030 <__nv_acos@plt>

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

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call double @__nv_acos(double %0)
ret double %2
}
void INT_Excep_PERIA_INTA232(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA232() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x15() {
  Assert_real((isspace(21) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              110, ("isspace should be 0 for 0x15"));
}


x86 assembly (clang, -O0):
<t_isspace_0x15>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x6e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x15>:
push   %rax
mov    $0x15,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x6e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x15\00"
define void @t_isspace_0x15() {
%1 = call i64 @isspace(i32 21)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x15\00"
define void @t_isspace_0x15() {
%1 = tail call i64 @isspace(i32 21)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int, int *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int a[40];
  foo(40, a);
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xb0(%rbp),%rsi
mov    $0x28,%edi
call   1040 <foo@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0xa8,%rsp
mov    %rsp,%rsi
mov    $0x28,%edi
call   1040 <foo@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [40 x i32], [40 x i32]* %2, i64 0, i64 0
%4 = call i32 @foo(i32 40, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = alloca [40 x i32]
%2 = bitcast [40 x i32]* %1 to i8*
%3 = getelementptr inbounds [40 x i32], [40 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32 40, i32* %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef size_t uint8_t;

/* Variables and functions */
size_t rev_byte(size_t);
void opt_reverse_arraybytecpy(uint8_t *dest, uint8_t *src, size_t len) {
  uint8_t i;
  for (i = 0; i < len; i++)
    dest[i] = rev_byte(src[i]);
}


x86 assembly (clang, -O0):
<opt_reverse_arraybytecpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    116b <opt_reverse_arraybytecpy+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <rev_byte@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <opt_reverse_arraybytecpy+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_reverse_arraybytecpy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1146 <opt_reverse_arraybytecpy+0x36>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <rev_byte@plt>
mov    %rax,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <opt_reverse_arraybytecpy+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @opt_reverse_arraybytecpy(i64* nocapture writeonly %0, i64* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = load i64, i64* %7
%9 = tail call i64 @rev_byte(i64 %8)
%10 = getelementptr inbounds i64, i64* %0, i64 %6
store i64 %9, i64* %10
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
void ff_hevc_put_hevc_bi_w_qpel_hv32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv32_8_sse4() {
ret void
}
int cdo_omp_get_thread_num(void) {
  int threadnum = 0;
  return (threadnum);
}


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

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

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

LLVM IR (-O2):
define i32 @cdo_omp_get_thread_num() {
ret i32 0
}
int AddShareCount(void *pMem) { return ++*(int *)((char *)(pMem)-4); }


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

x86 assembly (clang, -O2):
<AddShareCount>:
mov    -0x4(%rdi),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rdi)
ret

LLVM IR (-O0):
define i32 @AddShareCount(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
ret i32 %7
}

LLVM IR (-O2):
define i32 @AddShareCount(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
ret i32 %5
}
unsigned long long GetMaxUnsignedLongLong(void) {
  return ((unsigned long long)-1);
}


x86 assembly (clang, -O0):
<GetMaxUnsignedLongLong>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMaxUnsignedLongLong>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @GetMaxUnsignedLongLong() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @GetMaxUnsignedLongLong() {
ret i64 -1
}
void XtSetWMColormapWindows() {}


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

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

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

LLVM IR (-O2):
define void @XtSetWMColormapWindows() {
ret void
}
int mhia_handle_probe_response(struct user_t *user, struct mhia_msg *msg) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.user_t = type opaque
%struct.mhia_msg = type opaque
define i32 @mhia_handle_probe_response(%struct.user_t* nocapture readnone %0, %struct.mhia_msg* nocapture readnone %1) {
ret i32 0
}
void tape_load(void) {}


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

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

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

LLVM IR (-O2):
define void @tape_load() {
ret void
}
int nlowestone_minus_mlowestone(int n, int m) {
  return (1 << (m + n)) - (1 << m);
}


x86 assembly (clang, -O0):
<nlowestone_minus_mlowestone>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlowestone_minus_mlowestone>:
lea    (%rdi,%rsi,1),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @nlowestone_minus_mlowestone(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = shl nuw i32 1, %3
%5 = shl nsw i32 -1, %1
%6 = add i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int _tfsread(int, char *, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_tfsread(int fd, char *buf, int cnt) {
  int ret;
  monLock();
  ret = _tfsread(fd, buf, cnt);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfsread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_tfsread@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfsread>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <_tfsread@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_tfsread(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = call i32 (...) @monLock()
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @_tfsread(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
%13 = call i32 (...) @monUnlock()
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @mon_tfsread(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (...) @monLock()
%5 = tail call i32 @_tfsread(i32 %0, i8* %1, i32 %2)
%6 = tail call i32 (...) @monUnlock()
ret i32 %5
}
void basic_distribution(void *comm, int n, int chunk_size, int *nl, int *mnl,
                        int *split_pe, int *split_indx, int *start_indx) {
  int flr, cng, rem, the_mnl, the_partial_sum_mnl;
  int nc;
  int numprocs, myid;
  numprocs = 1;
  myid = 0;
  *nl = n;
  *mnl = n;
  *split_pe = 0;
  *split_indx = 0;
  *start_indx = 0;
}


x86 assembly (clang, -O0):
<basic_distribution>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x1,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<basic_distribution>:
mov    0x10(%rsp),%rax
mov    0x8(%rsp),%rdx
mov    %esi,(%rcx)
mov    %esi,(%r8)
movl   $0x0,(%r9)
movl   $0x0,(%rdx)
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @basic_distribution(i8* %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
store i32 1, i32* %23
store i32 0, i32* %24
%25 = load i32, i32* %10
%26 = load i32*, i32** %12
store i32 %25, i32* %26
%27 = load i32, i32* %10
%28 = load i32*, i32** %13
store i32 %27, i32* %28
%29 = load i32*, i32** %14
store i32 0, i32* %29
%30 = load i32*, i32** %15
store i32 0, i32* %30
%31 = load i32*, i32** %16
store i32 0, i32* %31
ret void
}

LLVM IR (-O2):
define void @basic_distribution(i8* nocapture readnone %0, i32 %1, i32 %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6, i32* nocapture writeonly %7) {
store i32 %1, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void handler(int signo) {
  (void)signo;
  printf("Caught signal being tested!\n");
  printf("Test PASSED\n");
  _exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Caught signal being tested!\0A\00"
@.str.1 = [13 x i8] c"Test PASSED\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"Caught signal being tested!\00"
@str.2 = [12 x i8] c"Test PASSED\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int minus(int a, int b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i32 @minus(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int /*<<< orphan*/ readlink(char *, char *, size_t);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void fdpath(int fd, char *output, size_t size) {
  char path[4 * 4096];
  snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
  readlink(path, output, size);
}


x86 assembly (clang, -O0):
<fdpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4020,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x4020(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x4000,%esi
lea    0xeb4(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x4020(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <readlink@plt>
add    $0x4020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdpath>:
push   %r15
push   %r14
push   %rbx
sub    $0x4000,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ecx
lea    0xec5(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x4000,%esi
call   1040 <snprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <readlink@plt>
add    $0x4000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/proc/self/fd/%d\00"
define void @fdpath(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [16384 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [16384 x i8], [16384 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @snprintf(i8* %8, i32 16384, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [16384 x i8], [16384 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @readlink(i8* %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/proc/self/fd/%d\00"
define void @fdpath(i32 %0, i8* nocapture %1, i64 %2) {
%4 = alloca [16384 x i8]
%5 = getelementptr inbounds [16384 x i8], [16384 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 16384, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @readlink(i8* %5, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_barrierattr_t;

/* Variables and functions */
int EINVAL;
int PTHREAD_PROCESS_PRIVATE;
int PTHREAD_PROCESS_SHARED;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ pthread_barrierattr_init(int /*<<< orphan*/ *);
int pthread_barrierattr_setpshared(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stderr;
char *strerror(int);
int main(void) {
  fprintf(stderr, "process-shared attribute is not available for testing\n");
  return 4;
  pthread_barrierattr_t ba;
  int pshared = PTHREAD_PROCESS_PRIVATE + 1;
  int rc;
  if (pshared == PTHREAD_PROCESS_SHARED) {
    pshared += 1;
  }
  if (pthread_barrierattr_init(&ba) != 0) {
    printf("Error at pthread_barrierattr_init()\n");
    return 2;
  }
  rc = pthread_barrierattr_setpshared(&ba, pshared);
  if (rc == EINVAL)
    printf("Test PASSED\n");
  else {
    printf("Get return code: %d, %s\n", rc, strerror(rc));
    printf(
        "Test PASSED: Note*: Expected EINVAL, but standard says 'may' fail.\n");
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@EINVAL = global i32 0
@PTHREAD_PROCESS_PRIVATE = global i32 0
@PTHREAD_PROCESS_SHARED = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@EINVAL = global i32 0
@PTHREAD_PROCESS_PRIVATE = global i32 0
@PTHREAD_PROCESS_SHARED = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hi\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void pm_err_handler() {}


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

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

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

LLVM IR (-O2):
define void @pm_err_handler() {
ret void
}