xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char const *, char const *);
int xstrcmp(const char *s1, const char *s2) {
  return strcmp(((s1) ? (s1) : ""), ((s2) ? (s2) : ""));
}


x86 assembly (clang, -O0):
<xstrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <xstrcmp+0x28>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <xstrcmp+0x38>
lea    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <xstrcmp+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <xstrcmp+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <xstrcmp+0x68>
lea    0xe91(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1178 <xstrcmp+0x68>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrcmp>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @xstrcmp(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i8*, i8** %3
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %9 ]
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i8*, i8** %4
br label %17
16: ; preds = %10
br label %17
17: ; preds = %16, %14
%18 = phi i8* [ %15, %14 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %16 ]
%19 = call i32 @strcmp(i8* %11, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @xstrcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ emit_leairrx4(int /*<<< orphan*/, int, int, int);
void gen_tlb_addr_r(int ar, int map) {
  if (map >= 0) {
    emit_leairrx4(0, ar, map, ar);
  }
}


x86 assembly (clang, -O0):
<gen_tlb_addr_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1138 <gen_tlb_addr_r+0x28>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
xor    %edi,%edi
call   1030 <emit_leairrx4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_tlb_addr_r>:
test   %esi,%esi
js     1121 <gen_tlb_addr_r+0x11>
mov    %esi,%edx
mov    %edi,%ecx
xor    %edi,%edi
mov    %ecx,%esi
jmp    1030 <emit_leairrx4@plt>
ret

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

LLVM IR (-O2):
define void @gen_tlb_addr_r(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @emit_leairrx4(i32 0, i32 %0, i32 %1, i32 %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
struct tbst_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void **tbst_probe(struct tbst_table *, void *);
void(tbst_assert_insert)(struct tbst_table *table, void *item) {
  void **p = tbst_probe(table, item);
  assert(p != NULL && *p == item);
}


x86 assembly (clang, -O0):
<tbst_assert_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <tbst_probe@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1162 <tbst_assert_insert+0x42>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbst_assert_insert>:
push   %rbx
mov    %rsi,%rbx
call   1030 <tbst_probe@plt>
xor    %edi,%edi
test   %rax,%rax
je     1137 <tbst_assert_insert+0x17>
cmp    %rbx,(%rax)
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.tbst_table = type { i32 }
define void @tbst_assert_insert(%struct.tbst_table* %0, i8* %1) {
%3 = alloca %struct.tbst_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.tbst_table* %0, %struct.tbst_table** %3
store i8* %1, i8** %4
%6 = load %struct.tbst_table*, %struct.tbst_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @tbst_probe(%struct.tbst_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br label %16
16: ; preds = %11, %2
%17 = phi i1 [ false, %2 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
%struct.tbst_table = type { i32 }
define void @tbst_assert_insert(%struct.tbst_table* %0, i8* %1) {
%3 = tail call i8** @tbst_probe(%struct.tbst_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
%11 = tail call i32 @assert(i32 %10)
ret void
}
int _evas_hash_gen(const char *key) {
  unsigned int hash_num = 5381;
  const unsigned char *ptr;
  if (!key)
    return 0;
  for (ptr = (unsigned char *)key; *ptr; ptr++)
    hash_num = (hash_num * 33) ^ *ptr;
  hash_num &= 0xff;
  return (int)hash_num;
}


x86 assembly (clang, -O0):
<_evas_hash_gen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <_evas_hash_gen+0x26>
movl   $0x0,-0x4(%rbp)
jmp    116d <_evas_hash_gen+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <_evas_hash_gen+0x5c>
imul   $0x21,-0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112e <_evas_hash_gen+0x2e>
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_evas_hash_gen>:
test   %rdi,%rdi
je     113b <_evas_hash_gen+0x3b>
mov    (%rdi),%al
test   %al,%al
je     113e <_evas_hash_gen+0x3e>
add    $0x1,%rdi
mov    $0x1505,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%edx
shl    $0x5,%edx
add    %ecx,%edx
movzbl %al,%ecx
xor    %edx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1120 <_evas_hash_gen+0x20>
movzbl %cl,%eax
ret
xor    %eax,%eax
ret
mov    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @_evas_hash_gen(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 5381, i32* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 0, i32* %2
br label %29
9: ; preds = %1
%10 = load i8*, i8** %3
store i8* %10, i8** %5
br label %11
11: ; preds = %22, %9
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load i32, i32* %4
%17 = mul i32 %16, 33
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %17, %20
store i32 %21, i32* %4
br label %22
22: ; preds = %15
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
br label %11
25: ; preds = %11
%26 = load i32, i32* %4
%27 = and i32 %26, 255
store i32 %27, i32* %4
%28 = load i32, i32* %4
store i32 %28, i32* %2
br label %29
29: ; preds = %25, %8
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @_evas_hash_gen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %18, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i8* [ %13, %6 ], [ %0, %3 ]
%9 = phi i32 [ %12, %6 ], [ 5381, %3 ]
%10 = mul i32 %9, 33
%11 = zext i8 %7 to i32
%12 = xor i32 %10, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6
%17 = and i32 %12, 255
br label %18
18: ; preds = %3, %16, %1
%19 = phi i32 [ 0, %1 ], [ 5, %3 ], [ %17, %16 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap16(int /*<<< orphan*/);
void be16_to_cpus(uint16_t *p) { *p = bswap16(*p); }


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

x86 assembly (clang, -O2):
<be16_to_cpus>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <bswap16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @be16_to_cpus(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @bswap16(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef short uint32_t;

/* Variables and functions */
uint32_t ROTR(uint32_t x, short n, short bitAmount) {
  return (x >> n) | (x << (bitAmount - n));
}


x86 assembly (clang, -O0):
<ROTR>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
sar    %cl,%eax
movswl -0x2(%rbp),%edx
movswl -0x6(%rbp),%ecx
movswl -0x4(%rbp),%esi
sub    %esi,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROTR>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
sub    %esi,%edx
mov    %edx,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @ROTR(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = ashr i32 %8, %10
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = load i16, i16* %6
%15 = sext i16 %14 to i32
%16 = load i16, i16* %5
%17 = sext i16 %16 to i32
%18 = sub nsw i32 %15, %17
%19 = shl i32 %13, %18
%20 = or i32 %11, %19
%21 = trunc i32 %20 to i16
ret i16 %21
}

LLVM IR (-O2):
define signext i16 @ROTR(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = sext i16 %0 to i32
%5 = sext i16 %1 to i32
%6 = ashr i32 %4, %5
%7 = sext i16 %2 to i32
%8 = sub nsw i32 %7, %5
%9 = shl i32 %4, %8
%10 = or i32 %9, %6
%11 = trunc i32 %10 to i16
ret i16 %11
}
int ebcdic_to_control(void *baton, int c, int *ctrl_char) { return 0; }


x86 assembly (clang, -O0):
<ebcdic_to_control>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ebcdic_to_control(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @ebcdic_to_control(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 0
}
int FN_SetChLrRange() { return (0); }


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

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

LLVM IR (-O0):
define i32 @FN_SetChLrRange() {
ret i32 0
}

LLVM IR (-O2):
define i32 @FN_SetChLrRange() {
ret i32 0
}
int f2(int (*f_p)(), int *one, int *two) {
  int rez = 0;
  rez = f_p(one);
  rez = rez * (*two);
  return (rez);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *%rcx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
xor    %eax,%eax
call   *%rcx
imul   (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f2(i32 (...)* %0, i32* %1, i32* %2) {
%4 = alloca i32 (...)*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 (...)* %0, i32 (...)** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
%8 = load i32 (...)*, i32 (...)** %4
%9 = load i32*, i32** %5
%10 = bitcast i32 (...)* %8 to i32 (i32*, ...)*
%11 = call i32 (i32*, ...) %10(i32* %9)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = mul nsw i32 %12, %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @f2(i32 (...)* nocapture %0, i32* %1, i32* nocapture %2) {
%4 = bitcast i32 (...)* %0 to i32 (i32*, ...)*
%5 = tail call i32 (i32*, ...) %4(i32* %1)
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int sub(int, int);
int sum(int, int);
int main() {
  int i = (5, 6), k;
  (k = 5, (i = 5 + (6, 7, 8) * sub(1, 2)), "hello");
  (k = 5, (i = 5 + (6, 7, 8) * sum(1, 2)), "hello");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <sub@plt>
shl    $0x3,%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
shl    $0x3,%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <sub@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
store i32 5, i32* %3
%4 = call i32 @sub(i32 1, i32 2)
%5 = mul nsw i32 8, %4
%6 = add nsw i32 5, %5
store i32 %6, i32* %2
store i32 5, i32* %3
%7 = call i32 @sum(i32 1, i32 2)
%8 = mul nsw i32 8, %7
%9 = add nsw i32 5, %8
store i32 %9, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sub(i32 1, i32 2)
%2 = tail call i32 @sum(i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_rla(void) { op_write1(0x17); }


x86 assembly (clang, -O0):
<op_enc_rla>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_rla>:
mov    $0x17,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_rla() {
%1 = call i32 @op_write1(i32 23)
ret void
}

LLVM IR (-O2):
define void @op_enc_rla() {
%1 = tail call i32 @op_write1(i32 23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VMFilePrint(int, char *);
int /*<<< orphan*/ VMThreadSleep(int);
void VMThread(void *param) {
  VMFilePrint(1, "VMThread Alive\n");
  VMThreadSleep(10);
  VMFilePrint(1, "VMThread Awake\n");
}


x86 assembly (clang, -O0):
<VMThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
lea    0xec8(%rip),%rsi
call   1040 <VMFilePrint@plt>
mov    $0xa,%edi
call   1030 <VMThreadSleep@plt>
mov    $0x1,%edi
lea    0xebd(%rip),%rsi
call   1040 <VMFilePrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VMThread>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1040 <VMFilePrint@plt>
mov    $0xa,%edi
call   1030 <VMThreadSleep@plt>
lea    0xecd(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <VMFilePrint@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"VMThread Alive\0A\00"
@.str.1 = [16 x i8] c"VMThread Awake\0A\00"
define void @VMThread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @VMFilePrint(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @VMThreadSleep(i32 10)
%5 = call i32 @VMFilePrint(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"VMThread Alive\0A\00"
@.str.1 = [16 x i8] c"VMThread Awake\0A\00"
define void @VMThread(i8* nocapture readnone %0) {
%2 = tail call i32 @VMFilePrint(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @VMThreadSleep(i32 10)
%4 = tail call i32 @VMFilePrint(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int dummyrsp_DoRspCycles(unsigned int Cycles) { return Cycles; }


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

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

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

LLVM IR (-O2):
define i32 @dummyrsp_DoRspCycles(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ e_dey();
void e_dey_accu() { e_dey(); }


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

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

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

LLVM IR (-O2):
define void @e_dey_accu() {
%1 = tail call i32 (...) @e_dey()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int ASN1_item_digest(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, char *,
                     unsigned char *, unsigned int *);
int /*<<< orphan*/ X509_NAME_it;
int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type,
                     unsigned char *md, unsigned int *len) {
  return (ASN1_item_digest(&X509_NAME_it, type, (char *)data, md, len));
}


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

x86 assembly (clang, -O2):
<X509_NAME_digest>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rdi,%rdx
mov    0x2ec8(%rip),%rdi
jmp    1030 <ASN1_item_digest@plt>

LLVM IR (-O0):
@X509_NAME_it = global i32 0
define i32 @X509_NAME_digest(i32* %0, i32* %1, i8* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
%10 = load i32*, i32** %5
%11 = bitcast i32* %10 to i8*
%12 = load i8*, i8** %7
%13 = load i32*, i32** %8
%14 = call i32 @ASN1_item_digest(i32* @X509_NAME_it, i32* %9, i8* %11, i8* %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
@X509_NAME_it = global i32 0
define i32 @X509_NAME_digest(i32* %0, i32* %1, i8* %2, i32* %3) {
%5 = bitcast i32* %0 to i8*
%6 = tail call i32 @ASN1_item_digest(i32* @X509_NAME_it, i32* %1, i8* %5, i8* %2, i32* %3)
ret i32 %6
}
void error_log_printf(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @error_log_printf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int authldapcommon(char const *, int /*<<< orphan*/,
                   int (*)(struct authinfo *, void *), void *);
int auth_ldap_pre(const char *userid, const char *service,
                  int (*callback)(struct authinfo *, void *), void *arg) {
  return (authldapcommon(userid, 0, callback, arg));
}


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

x86 assembly (clang, -O2):
<auth_ldap_pre>:
xor    %esi,%esi
jmp    1030 <authldapcommon@plt>

LLVM IR (-O0):
%struct.authinfo = type opaque
%struct.authinfo.0 = type opaque
define i32 @auth_ldap_pre(i8* %0, i8* %1, i32 (%struct.authinfo*, i8*)* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32 (%struct.authinfo*, i8*)*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 (%struct.authinfo*, i8*)* %2, i32 (%struct.authinfo*, i8*)** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i32 (%struct.authinfo*, i8*)*, i32 (%struct.authinfo*, i8*)** %7
%11 = bitcast i32 (%struct.authinfo*, i8*)* %10 to i32 (%struct.authinfo.0*, i8*)*
%12 = load i8*, i8** %8
%13 = call i32 @authldapcommon(i8* %9, i32 0, i32 (%struct.authinfo.0*, i8*)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.authinfo = type opaque
%struct.authinfo.0 = type opaque
define i32 @auth_ldap_pre(i8* %0, i8* nocapture readnone %1, i32 (%struct.authinfo*, i8*)* %2, i8* %3) {
%5 = bitcast i32 (%struct.authinfo*, i8*)* %2 to i32 (%struct.authinfo.0*, i8*)*
%6 = tail call i32 @authldapcommon(i8* %0, i32 0, i32 (%struct.authinfo.0*, i8*)* %5, i8* %3)
ret i32 %6
}
/* Variables and functions */
char *cvt(long double, int, int *, int *, int);
char *_ecvt(long double value, int ndigit, int *decpt, int *sign) {
  return cvt(value, ndigit, decpt, sign, 1);
}


x86 assembly (clang, -O0):
<_ecvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
fldt   -0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %rsp,%rax
fstpt  (%rax)
mov    $0x1,%ecx
call   1030 <cvt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ecvt>:
mov    $0x1,%ecx
jmp    1030 <cvt@plt>

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

LLVM IR (-O2):
define i8* @_ecvt(x86_fp80 %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i8* @cvt(x86_fp80 %0, i32 %1, i32* %2, i32* %3, i32 1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double const);
int /*<<< orphan*/ putchar(char);
void show_array(const double ar[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%8.3f", ar[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<show_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <show_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <show_array+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <show_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <show_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%8.3f\00"
define void @show_array(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%8.3f\00"
define void @show_array(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void parse_file_uri_free(char *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<parse_file_uri_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <parse_file_uri_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_file_uri_free>:
test   %rdi,%rdi
je     111a <parse_file_uri_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @parse_file_uri_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ uint16_t;
struct etimer {
  int dummy;
};

/* Variables and functions */
scalar_t__ timer_elapsed_time(struct etimer *);
bool timer_elapsed_milliseconds_short(struct etimer *t, uint16_t value) {
  uint32_t milliseconds;
  milliseconds = value;
  return (timer_elapsed_time(t) >= milliseconds);
}


x86 assembly (clang, -O0):
<timer_elapsed_milliseconds_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <timer_elapsed_time@plt>
cmp    -0x18(%rbp),%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_elapsed_milliseconds_short>:
push   %rbx
mov    %rsi,%rbx
call   1030 <timer_elapsed_time@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setge  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_milliseconds_short(%struct.etimer* %0, i64 %1) {
%3 = alloca %struct.etimer*
%4 = alloca i64
%5 = alloca i64
store %struct.etimer* %0, %struct.etimer** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
store i64 %6, i64* %5
%7 = load %struct.etimer*, %struct.etimer** %3
%8 = call i64 @timer_elapsed_time(%struct.etimer* %7)
%9 = load i64, i64* %5
%10 = icmp sge i64 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_milliseconds_short(%struct.etimer* %0, i64 %1) {
%3 = tail call i64 @timer_elapsed_time(%struct.etimer* %0)
%4 = icmp sge i64 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int listen(int, int);
int plat_listen(int s, int backlog) { return (listen(s, backlog)); }


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

x86 assembly (clang, -O2):
<plat_listen>:
jmp    1030 <listen@plt>

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

LLVM IR (-O2):
define i32 @plat_listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  char a = 'A';
  if ((a == 'Z') || ((a = 'L') && (a == 'A')))
    a = a;
  printf("%c", a);
  printf(" Nothing ");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
je     1150 <main+0x40>
movb   $0x4c,-0x5(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1143 <main+0x33>
jmp    1156 <main+0x46>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jne    1156 <main+0x46>
mov    -0x5(%rbp),%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4c,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [10 x i8] c" Nothing \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 65, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 90
br i1 %5, label %11, label %6
6: ; preds = %0
store i8 76, i8* %2
br i1 true, label %7, label %13
7: ; preds = %6
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 65
br i1 %10, label %11, label %13
11: ; preds = %7, %0
%12 = load i8, i8* %2
store i8 %12, i8* %2
br label %13
13: ; preds = %11, %7, %6
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c" Nothing \00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 76)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct rtas_lri_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_lri_scn *rtas_get_lri_scn(struct rtas_event *re) {
  return (struct rtas_lri_scn *)get_re_scn(re, 14);
}


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

x86 assembly (clang, -O2):
<rtas_get_lri_scn>:
mov    $0xe,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_lri_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_lri_scn* @rtas_get_lri_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 14)
%5 = inttoptr i64 %4 to %struct.rtas_lri_scn*
ret %struct.rtas_lri_scn* %5
}

LLVM IR (-O2):
%struct.rtas_lri_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_lri_scn* @rtas_get_lri_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 14)
%3 = inttoptr i64 %2 to %struct.rtas_lri_scn*
ret %struct.rtas_lri_scn* %3
}
/* Type definitions */
typedef char *uint64_t;
typedef char *time_t;

/* Variables and functions */
time_t time(time_t *t) {
  time_t tmp;
  uint64_t val;
  __asm__ __volatile__("rdtsc" : "=A"(val));
  tmp = val;
  if (t)
    *t = tmp;
  return tmp;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
rdtsc
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112c <time+0x2c>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
rdtsc
test   %rdi,%rdi
je     110a <time+0xa>
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define i8* @time(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i8*
store i8** %0, i8*** %2
%5 = call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i8* %5, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %3
%7 = load i8**, i8*** %2
%8 = icmp ne i8** %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8**, i8*** %2
store i8* %10, i8** %11
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @time(i8** writeonly %0) {
%2 = tail call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i8** %0, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8* %2, i8** %0
br label %5
5: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void putvec(int b[], int p) {
  int i;
  for (i = 0; i < p; i++)
    printf("%d ", b[i]);
  puts("");
}


x86 assembly (clang, -O0):
<putvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <putvec+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <putvec+0x16>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putvec>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1155 <putvec+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <putvec+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [1 x i8] zeroinitializer
define void @putvec(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @putvec(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ first_come_first_serve();
int /*<<< orphan*/ mlfq_scheduling(int);
int /*<<< orphan*/ priority_scheduling();
int /*<<< orphan*/ stride_scheduling(int);
void run_simulation(int algorithm, int quantum) {
  switch (algorithm) {
  case 3:
    stride_scheduling(quantum);
    break;
  case 1:
    priority_scheduling();
    break;
  case 2:
    mlfq_scheduling(quantum);
    break;
  case 0:
  default:
    first_come_first_serve();
    break;
  }
}


x86 assembly (clang, -O0):
<run_simulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     119e <run_simulation+0x5e>
mov    -0x10(%rbp),%rax
lea    0xe96(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%edi
call   1060 <stride_scheduling@plt>
jmp    11a5 <run_simulation+0x65>
mov    $0x0,%al
call   1030 <priority_scheduling@plt>
jmp    11a5 <run_simulation+0x65>
mov    -0x8(%rbp),%edi
call   1040 <mlfq_scheduling@plt>
jmp    11a5 <run_simulation+0x65>
jmp    119e <run_simulation+0x5e>
mov    $0x0,%al
call   1050 <first_come_first_serve@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_simulation>:
cmp    $0x1,%edi
je     1156 <run_simulation+0x16>
cmp    $0x2,%edi
je     115d <run_simulation+0x1d>
cmp    $0x3,%edi
jne    1164 <run_simulation+0x24>
mov    %esi,%edi
jmp    1060 <stride_scheduling@plt>
xor    %eax,%eax
jmp    1030 <priority_scheduling@plt>
mov    %esi,%edi
jmp    1040 <mlfq_scheduling@plt>
xor    %eax,%eax
jmp    1050 <first_come_first_serve@plt>

LLVM IR (-O0):
define void @run_simulation(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
switch i32 %5, label %15 [
i32 3, label %6
i32 1, label %9
i32 2, label %11
i32 0, label %14
]
6: ; preds = %2
%7 = load i32, i32* %4
%8 = call i32 @stride_scheduling(i32 %7)
br label %17
9: ; preds = %2
%10 = call i32 (...) @priority_scheduling()
br label %17
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @mlfq_scheduling(i32 %12)
br label %17
14: ; preds = %2
br label %15
15: ; preds = %2, %14
%16 = call i32 (...) @first_come_first_serve()
br label %17
17: ; preds = %15, %11, %9, %6
ret void
}

LLVM IR (-O2):
define void @run_simulation(i32 %0, i32 %1) {
switch i32 %0, label %9 [
i32 3, label %3
i32 1, label %5
i32 2, label %7
]
3: ; preds = %2
%4 = tail call i32 @stride_scheduling(i32 %1)
br label %11
5: ; preds = %2
%6 = tail call i32 (...) @priority_scheduling()
br label %11
7: ; preds = %2
%8 = tail call i32 @mlfq_scheduling(i32 %1)
br label %11
9: ; preds = %2
%10 = tail call i32 (...) @first_come_first_serve()
br label %11
11: ; preds = %9, %7, %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayMenu();
int promptValue(char *);
int promptOperation() {
  displayMenu();
  return promptValue("Veuillez choisir une operation ?");
}


x86 assembly (clang, -O0):
<promptOperation>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <displayMenu@plt>
lea    0xece(%rip),%rdi
call   1040 <promptValue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<promptOperation>:
push   %rax
xor    %eax,%eax
call   1030 <displayMenu@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <promptValue@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Veuillez choisir une operation ?\00"
define i32 @promptOperation() {
%1 = call i32 (...) @displayMenu()
%2 = call i32 @promptValue(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [33 x i8] c"Veuillez choisir une operation ?\00"
define i32 @promptOperation() {
%1 = tail call i32 (...) @displayMenu()
%2 = tail call i32 @promptValue(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
short func_54(int *p_55) {
  unsigned l_56 = 1UL;
  step_hash(14);
  return l_56;
}


x86 assembly (clang, -O0):
<func_54>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0xe,%edi
call   1030 <step_hash@plt>
mov    -0xc(%rbp),%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_54>:
push   %rax
mov    $0xe,%edi
call   1030 <step_hash@plt>
mov    $0x1,%ax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @func_54(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
%4 = call i32 @step_hash(i32 14)
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @func_54(i32* nocapture readnone %0) {
%2 = tail call i32 @step_hash(i32 14)
ret i16 1
}
void gdk_gc_values_mask_get_type() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @boundaries_collision() {
ret void
}
float *test_func_00(float *p, float *x) {
  float r = 0;
  r += *p++;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  (%rax),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  (%rax),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
xorps  %xmm0,%xmm0
addss  (%rdi),%xmm0
addss  0x4(%rdi),%xmm0
lea    0x8(%rdi),%rax
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define float* @test_func_00(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
store float 0.000000e+00, float* %5
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i32 1
store float* %7, float** %3
%8 = load float, float* %6
%9 = load float, float* %5
%10 = fadd float %9, %8
store float %10, float* %5
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i32 1
store float* %12, float** %3
%13 = load float, float* %11
%14 = load float, float* %5
%15 = fadd float %14, %13
store float %15, float* %5
%16 = load float, float* %5
%17 = load float*, float** %4
store float %16, float* %17
%18 = load float*, float** %3
ret float* %18
}

LLVM IR (-O2):
define float* @test_func_00(float* %0, float* nocapture writeonly %1) {
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %0
%5 = fadd float %4, 0.000000e+00
%6 = getelementptr inbounds float, float* %0, i64 2
%7 = load float, float* %3
%8 = fadd float %5, %7
store float %8, float* %1
ret float* %6
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
int fstat(int, struct stat *);
int get_file_size(int fd) {
  struct stat stat_struct;
  if (fstat(fd, &stat_struct) == -1)
    return -1;
  return (int)stat_struct.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <fstat@plt>
cmp    $0xffffffff,%eax
jne    113c <get_file_size+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <get_file_size+0x33>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
cmp    $0xffffffff,%eax
je     1121 <get_file_size+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @get_file_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 -1, i32 %8
ret i32 %9
}