xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long long _mulx_u64(unsigned long long, unsigned long long,
                             unsigned long long *);
__attribute__((no)) unsigned long long
calc_mulx_u64(unsigned long long x, unsigned long long y,
              unsigned long long *res_h) {
  return _mulx_u64(x, y, res_h);
}


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

x86 assembly (clang, -O2):
<calc_mulx_u64>:
jmp    1030 <_mulx_u64@plt>

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

LLVM IR (-O2):
define i64 @calc_mulx_u64(i64 %0, i64 %1, i64* %2) {
%4 = tail call i64 @_mulx_u64(i64 %0, i64 %1, i64* %2)
ret i64 %4
}
OP(fd, d1) { op_d1(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d1()
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
uint32_t __int64_t_encoded_array_size(const int64_t *p, uint32_t elements) {
  (void)p;
  return (8) * elements;
}


x86 assembly (clang, -O0):
<__int64_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int64_t_encoded_array_size>:
lea    0x0(,%rsi,8),%eax
ret

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

LLVM IR (-O2):
define i32 @__int64_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl nsw i32 %1, 3
ret i32 %3
}
/* Variables and functions */
int get_block_ptr(int);
int /*<<< orphan*/ set_block_ptr(int, int /*<<< orphan*/);
void free_list(int head) {
  if (head == -2 || head == 0) {
    return;
  }
  int tail = get_block_ptr(head);
  set_block_ptr(head, 0);
  free_list(tail);
}


x86 assembly (clang, -O0):
<free_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffffffe,-0x4(%rbp)
je     114f <free_list+0x1f>
cmpl   $0x0,-0x4(%rbp)
jne    1154 <free_list+0x24>
jmp    1171 <free_list+0x41>
mov    -0x4(%rbp),%edi
call   1050 <get_block_ptr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <set_block_ptr@plt>
mov    -0x8(%rbp),%edi
call   1030 <free_list@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_list>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0xfffffffe,%ebx
je     114d <free_list+0x2d>
nopw   0x0(%rax,%rax,1)
test   %ebx,%ebx
je     114d <free_list+0x2d>
mov    %ebx,%edi
call   1040 <get_block_ptr@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <set_block_ptr@plt>
mov    %ebp,%ebx
cmp    $0xfffffffe,%ebx
jne    1130 <free_list+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @free_list(i32 %0) {
br label %2
2: ; preds = %4, %1
%3 = phi i32 [ %0, %1 ], [ %5, %4 ]
switch i32 %3, label %4 [
i32 -2, label %7
i32 0, label %7
]
4: ; preds = %2
%5 = tail call i32 @get_block_ptr(i32 %3)
%6 = tail call i32 @set_block_ptr(i32 %3, i32 0)
br label %2
7: ; preds = %2, %2
ret void
}
/* Variables and functions */
unsigned char _hex_nibble(unsigned char);
void _hex_byte(unsigned char c, unsigned char *dest) {
  dest[0] = _hex_nibble((unsigned char)(c >> 4));
  dest[1] = _hex_nibble((unsigned char)(c & 0x0f));
}


x86 assembly (clang, -O0):
<_hex_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
movzbl %al,%edi
call   1030 <_hex_nibble@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <_hex_nibble@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hex_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ebp,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <_hex_nibble@plt>
mov    %al,(%rbx)
and    $0xf,%ebp
mov    %ebp,%edi
call   1030 <_hex_nibble@plt>
mov    %al,0x1(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @_hex_byte(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = trunc i32 %7 to i8
%9 = call zeroext i8 @_hex_nibble(i8 zeroext %8)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = and i32 %13, 15
%15 = trunc i32 %14 to i8
%16 = call zeroext i8 @_hex_nibble(i8 zeroext %15)
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @_hex_byte(i8 zeroext %0, i8* nocapture writeonly %1) {
%3 = lshr i8 %0, 4
%4 = tail call zeroext i8 @_hex_nibble(i8 zeroext %3)
store i8 %4, i8* %1
%5 = and i8 %0, 15
%6 = tail call zeroext i8 @_hex_nibble(i8 zeroext %5)
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
ret void
}
unsigned int enable_4G(void) {
  return ((*(volatile unsigned int *)(0xF0003208) & (1 << 15)) &&
          (*(volatile unsigned int *)(0xF0001f00) & (1 << 13)));
}


x86 assembly (clang, -O0):
<enable_4G>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0003208,%eax
mov    (%rax),%ecx
and    $0x8000,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1(%rbp)
je     1134 <enable_4G+0x34>
mov    $0xf0001f00,%eax
mov    (%rax),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_4G>:
mov    $0xf0001f00,%ecx
xor    %eax,%eax
testl  $0x8000,0x1308(%rcx)
je     111b <enable_4G+0x1b>
mov    (%rcx),%eax
shr    $0xd,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @enable_4G() {
%1 = load volatile i32, i32* inttoptr (i64 4026544648 to i32*)
%2 = and i32 %1, 32768
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 4026539776 to i32*)
%6 = and i32 %5, 8192
%7 = icmp ne i32 %6, 0
br label %8
8: ; preds = %4, %0
%9 = phi i1 [ false, %0 ], [ %7, %4 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @enable_4G() {
%1 = load volatile i32, i32* inttoptr (i64 4026544648 to i32*)
%2 = and i32 %1, 32768
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 4026539776 to i32*)
%6 = lshr i32 %5, 13
%7 = and i32 %6, 1
br label %8
8: ; preds = %4, %0
%9 = phi i32 [ 0, %0 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ key_registry_init();
int /*<<< orphan*/ nonces_init();
int /*<<< orphan*/ principals_init();
void init_crypto_lib() {
  nonces_init();
  key_registry_init();
  principals_init();
}


x86 assembly (clang, -O0):
<init_crypto_lib>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <nonces_init@plt>
mov    $0x0,%al
call   1050 <key_registry_init@plt>
mov    $0x0,%al
call   1030 <principals_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_crypto_lib>:
push   %rax
xor    %eax,%eax
call   1040 <nonces_init@plt>
xor    %eax,%eax
call   1050 <key_registry_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <principals_init@plt>

LLVM IR (-O0):
define void @init_crypto_lib() {
%1 = call i32 (...) @nonces_init()
%2 = call i32 (...) @key_registry_init()
%3 = call i32 (...) @principals_init()
ret void
}

LLVM IR (-O2):
define void @init_crypto_lib() {
%1 = tail call i32 (...) @nonces_init()
%2 = tail call i32 (...) @key_registry_init()
%3 = tail call i32 (...) @principals_init()
ret void
}
void free5(void *****p) {
  free(p[0][0][0][0]);
  free(p[0][0][0]);
  free(p[0][0]);
  free(p[0]);
  free(p);
}


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

x86 assembly (clang, -O2):
<free5>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free5(i8***** nocapture %0) {
%2 = load i8****, i8***** %0
%3 = load i8***, i8**** %2
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast i8***** %0 to i8****
%7 = load i8***, i8**** %6
%8 = load i8**, i8*** %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = bitcast i8***** %0 to i8***
%11 = load i8**, i8*** %10
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = bitcast i8***** %0 to i8**
%14 = load i8*, i8** %13
tail call void @free(i8* %14)
%15 = bitcast i8***** %0 to i8*
tail call void @free(i8* %15)
ret void
}
void getFirstField(char keyword[20], char *cmd) {
  int i = 0;
  while (*cmd != ' ' && *cmd != '\0') {
    keyword[i] = *cmd;
    cmd++;
    i++;
  }
  keyword[i] = '\0';
}


x86 assembly (clang, -O0):
<getFirstField>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x15(%rbp)
je     1138 <getFirstField+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1148 <getFirstField+0x48>
jmp    1173 <getFirstField+0x73>
mov    -0x10(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <getFirstField+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFirstField>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   $0xdf,%cl
je     1122 <getFirstField+0x22>
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
jmp    1110 <getFirstField+0x10>
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @getFirstField(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i64 [ %10, %7 ], [ 0, %2 ]
%5 = phi i8* [ %9, %7 ], [ %1, %2 ]
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 32, label %11
i8 0, label %11
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = add nuw i64 %4, 1
br label %3
11: ; preds = %3, %3
%12 = and i64 %4, 4294967295
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *printCount(void *arg) {
  long tid = (long)arg;
  printf("%ld\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<printCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCount>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i8* @printCount(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define noalias i8* @printCount(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void RTManifestReadStandardEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTManifestReadStandardEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MDrv_PNL_SetOutputPattern(unsigned char, unsigned short,
                                             unsigned short, unsigned short);
void MApi_PNL_SetOutputPattern(unsigned char bEnable, unsigned short u16Red,
                               unsigned short u16Green,
                               unsigned short u16Blue) {
  MDrv_PNL_SetOutputPattern(bEnable, u16Red, u16Green, u16Blue);
}


x86 assembly (clang, -O0):
<MApi_PNL_SetOutputPattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movzbl %dl,%edi
movzwl %cx,%esi
movzwl %ax,%edx
movzwl -0x8(%rbp),%ecx
call   1030 <MDrv_PNL_SetOutputPattern@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MApi_PNL_SetOutputPattern>:
jmp    1030 <MDrv_PNL_SetOutputPattern@plt>

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

LLVM IR (-O2):
define void @MApi_PNL_SetOutputPattern(i8 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = tail call i32 @MDrv_PNL_SetOutputPattern(i8 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3)
ret void
}
/* Variables and functions */
double DegtoRad(double);
double sin(double);
double CrossWind(double WindSpeed, double WindAngle) {
  double Wangle = DegtoRad(WindAngle);
  return (sin(Wangle) * WindSpeed);
}


x86 assembly (clang, -O0):
<CrossWind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <DegtoRad@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
mulsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CrossWind>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
call   1040 <DegtoRad@plt>
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @CrossWind(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = call double @DegtoRad(double %6)
store double %7, double* %5
%8 = load double, double* %5
%9 = call double @sin(double %8)
%10 = load double, double* %3
%11 = fmul double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @CrossWind(double %0, double %1) {
%3 = tail call double @DegtoRad(double %1)
%4 = tail call double @sin(double %3)
%5 = fmul double %4, %0
ret double %5
}
int nn_xpub_ispeer(int socktype) { return socktype == (2 * 16 + 1) ? 1 : 0; }


x86 assembly (clang, -O0):
<nn_xpub_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x21,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_xpub_ispeer>:
xor    %eax,%eax
cmp    $0x21,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @nn_xpub_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 33
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @nn_xpub_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 33
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double mp_bswap_double(double);
double mp_load_double(const char **data) {
  double val = mp_bswap_double(*(double *)*data);
  *data += sizeof(double);
  return val;
}


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

x86 assembly (clang, -O2):
<mp_load_double>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsd  (%rax),%xmm0
call   1030 <mp_bswap_double@plt>
addq   $0x8,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define double @mp_load_double(i8** %0) {
%2 = alloca i8**
%3 = alloca double
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = call double @mp_bswap_double(double %7)
store double %8, double* %3
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 8
store i8* %11, i8** %9
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @mp_load_double(i8** nocapture %0) {
%2 = bitcast i8** %0 to double**
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = tail call double @mp_bswap_double(double %4)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 8
store i8* %7, i8** %0
ret double %5
}
/* Variables and functions */
int fmod(double, double);
double randomz(double x) {
  return fmod(((double)329) * x * 1e+8, ((double)100000001)) * 1e-8;
}


x86 assembly (clang, -O0):
<randomz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
call   1030 <fmod@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomz>:
push   %rax
mulsd  0xee7(%rip),%xmm0
mulsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @randomz(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.290000e+02, %3
%5 = fmul double %4, 1.000000e+08
%6 = call i32 @fmod(double %5, double 0x4197D78404000000)
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.000000e-08
ret double %8
}

LLVM IR (-O2):
define double @randomz(double %0) {
%2 = fmul double %0, 3.290000e+02
%3 = fmul double %2, 1.000000e+08
%4 = tail call i32 @fmod(double %3, double 0x4197D78404000000)
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 1.000000e-08
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M4_f(char *s) {
  debug("M4_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

x86 assembly (clang, -O2):
<M4_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"M4_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M4_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"M4_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M4_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
void *ft_memset(void *, int /*<<< orphan*/, size_t);
scalar_t__ malloc(size_t);
void *ft_memalloc(size_t size) {
  void *mem;
  mem = (void *)malloc(size);
  if (!mem)
    return (NULL);
  return (ft_memset(mem, 0, size));
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <ft_memalloc+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1164 <ft_memalloc+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <ft_memset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     113c <ft_memalloc+0x1c>
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <ft_memset@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
%6 = tail call i8* @ft_memset(i8* %5, i32 0, i64 %0)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
void setAtomicInt(int *atom, const int value) {
  if (!atom)
    return;
  { *atom = value; }
}


x86 assembly (clang, -O0):
<setAtomicInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111b <setAtomicInt+0x1b>
jmp    1124 <setAtomicInt+0x24>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setAtomicInt>:
test   %rdi,%rdi
je     1107 <setAtomicInt+0x7>
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @setAtomicInt(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 = icmp ne i32* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
br label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
store i32 %9, i32* %10
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @setAtomicInt(i32* writeonly %0, i32 %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i32 %1, i32* %0
br label %5
5: ; preds = %2, %4
ret void
}
/* Variables and functions */
int establish_connection(char *, char *, int /*<<< orphan*/);
int connect_client(char *ip, char *port) {
  return establish_connection(ip, port, 0);
}


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

x86 assembly (clang, -O2):
<connect_client>:
xor    %edx,%edx
jmp    1030 <establish_connection@plt>

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

LLVM IR (-O2):
define i32 @connect_client(i8* %0, i8* %1) {
%3 = tail call i32 @establish_connection(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x8a() {
  Assert_real((islower(138) == 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_islower.c",
              695, ("islower should be 0 for 0x8a"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x8a>:
push   %rax
mov    $0x8a,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b7,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x8a\00"
define void @t_islower_0x8a() {
%1 = call i64 @islower(i32 138)
%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 695, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x8a\00"
define void @t_islower_0x8a() {
%1 = tail call i64 @islower(i32 138)
%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 695, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, struct timeval *);
int main(int argc, char *argv[]) {
  struct timeval tv;
  tv.tv_sec = 10;
  tv.tv_usec = 0;
  select(1, NULL, NULL, NULL, &tv);
  return 0;
}


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)
movl   $0xa,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x20(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0xa,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%r8
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
store i32 10, i32* %7
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
store i64 0, i64* %8
%9 = call i32 @select(i32 1, i32* null, i32* null, i32* null, %struct.timeval* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 10, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i64 0, i64* %6
%7 = call i32 @select(i32 1, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t typeSize(uint64_t ty) {
  if (ty == 0)
    return 4;
  else if (ty == 1)
    return 8;
  else if (ty == 2)
    return 4;
  else if (ty == 3)
    return 8;
}


x86 assembly (clang, -O0):
<typeSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <typeSize+0x1d>
movl   $0x4,-0x4(%rbp)
jmp    116e <typeSize+0x6e>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <typeSize+0x33>
movl   $0x8,-0x4(%rbp)
jmp    116e <typeSize+0x6e>
cmpl   $0x2,-0x8(%rbp)
jne    1149 <typeSize+0x49>
movl   $0x4,-0x4(%rbp)
jmp    116e <typeSize+0x6e>
cmpl   $0x3,-0x8(%rbp)
jne    115f <typeSize+0x5f>
movl   $0x8,-0x4(%rbp)
jmp    116e <typeSize+0x6e>
jmp    1164 <typeSize+0x64>
jmp    1169 <typeSize+0x69>
jmp    116e <typeSize+0x6e>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<typeSize>:
and    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
lea    0x4(,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @typeSize(i32 %0) {
%2 = and i32 %0, -3
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i32 8, i32 4
ret i32 %4
}
double ldexp(double x, int exp) { return exp == 0 ? x : 0.0; }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1125 <ldexp+0x25>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1132 <ldexp+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1132 <ldexp+0x32>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
test   %edi,%edi
je     1107 <ldexp+0x7>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load double, double* %3
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi double [ %8, %7 ], [ 0.000000e+00, %9 ]
ret double %11
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, double %0, double 0.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit_error(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p;
  if (size == 0)
    return NULL;
  if ((p = malloc(size)) == NULL) {
    exit_error("xmalloc: No enough memory");
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xmalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    116f <xmalloc+0x4f>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1167 <xmalloc+0x47>
lea    0xe9e(%rip),%rdi
call   1030 <exit_error@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
test   %rdi,%rdi
je     113e <xmalloc+0x1e>
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <xmalloc+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1030 <exit_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"xmalloc: No enough memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %16
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @exit_error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = load i8*, i8** %4
store i8* %15, i8** %2
br label %16
16: ; preds = %14, %7
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [26 x i8] c"xmalloc: No enough memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit_error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ abs_diff(scalar_t__, scalar_t__);
uint32_t __hsail_sad_u32(uint32_t a, uint32_t b, uint32_t add) {
  return abs_diff(a, b) + add;
}


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

x86 assembly (clang, -O2):
<__hsail_sad_u32>:
push   %rbx
mov    %rdx,%rbx
call   1030 <abs_diff@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__hsail_sad_u32(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = call i64 @abs_diff(i64 %7, i64 %8)
%10 = load i64, i64* %6
%11 = add nsw i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @__hsail_sad_u32(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @abs_diff(i64 %0, i64 %1)
%5 = add nsw i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ICPrintStringValue(char *stringValue) {
  printf("StringValue = %s\n", stringValue);
}


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

x86 assembly (clang, -O2):
<ICPrintStringValue>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"StringValue = %s\0A\00"
define void @ICPrintStringValue(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int main() {
  int ***a, **b, *z, **x, u, **p, *y;
  b = &z;
  u = f();
  a = &x;
  *a = b;
  y = *x;
  printf("%d %d", a, x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <f@plt>
lea    0x10(%rsp),%rdx
mov    %rdx,0x8(%rsp)
lea    0xec4(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32**
%3 = bitcast i32** %1 to i8*
%4 = bitcast i32*** %2 to i8*
%5 = tail call i32 (...) @f()
store i32** %1, i32*** %2
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32*** %2, i32** %1)
ret i32 0
}
int _dl_parse_copy_information(struct dyn_elf *xpnt, unsigned long rel_addr,
                               unsigned long rel_size, int type) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.dyn_elf = type opaque
define i32 @_dl_parse_copy_information(%struct.dyn_elf* %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca %struct.dyn_elf*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store %struct.dyn_elf* %0, %struct.dyn_elf** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.dyn_elf = type opaque
define i32 @_dl_parse_copy_information(%struct.dyn_elf* nocapture readnone %0, i64 %1, i64 %2, i32 %3) {
ret i32 0
}
int getSign(int value) { return value >= 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<getSign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSign>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @getSign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @getSign(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int *getZero();
void testStoreZero(int *a) {
  a = getZero();
  *a = 1;
}


x86 assembly (clang, -O0):
<testStoreZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getZero@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStoreZero>:
push   %rax
xor    %eax,%eax
call   1030 <getZero@plt>
movl   $0x1,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @testStoreZero(i32* nocapture readnone %0) {
%2 = tail call i32* (...) @getZero()
store i32 1, i32* %2
ret void
}
/* Variables and functions */
int int_hash(int, int);
unsigned bignumhash(int i) { return int_hash(i, 10001); }


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

x86 assembly (clang, -O2):
<bignumhash>:
mov    $0x2711,%esi
jmp    1030 <int_hash@plt>

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

LLVM IR (-O2):
define i32 @bignumhash(i32 %0) {
%2 = tail call i32 @int_hash(i32 %0, i32 10001)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ str_revert(char *);
int main(int argc, char **argv) {
  if (2 != argc) {
    printf("Nombre de parametres insuffisants\n");
    return 1;
  }
  str_revert(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
je     115c <main+0x3c>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <str_revert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <str_revert@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [34 x i8] c"Nombre de parametres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @str_revert(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %11
}