xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void haltError(char *message, int num) {
  endwin();
  printf("Something has gone wrong, very wrong.\n");
  printf(message);
  printf("\n");
  printf("Number associated with this error: %d\n", num);
  exit(1);
}


x86 assembly (clang, -O0):
<haltError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <endwin@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<haltError>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <endwin@plt>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe7a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Something has gone wrong, very wrong.\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [39 x i8] c"Number associated with this error: %d\0A\00"
define void @haltError(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @endwin()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.2 = [39 x i8] c"Number associated with this error: %d\0A\00"
@str = [38 x i8] c"Something has gone wrong, very wrong.\00"
define void @haltError(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
}
void destroyGeneAdjMatrix(int **adj, int num_genes) {
  int i, num;
  num = 2 * num_genes;
  for (i = num - 1; i >= 0; i--)
    free(adj[i]);
  free(adj);
  return;
}


x86 assembly (clang, -O0):
<destroyGeneAdjMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     115a <destroyGeneAdjMatrix+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <destroyGeneAdjMatrix+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyGeneAdjMatrix>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1144 <destroyGeneAdjMatrix+0x34>
lea    (%rsi,%rsi,1),%ebp
add    $0x1,%ebp
lea    (%rsi,%rsi,1),%eax
add    $0xfffffffe,%eax
lea    (%r14,%rax,8),%rbx
add    $0x8,%rbx
nop
mov    (%rbx),%rdi
call   1030 <free@plt>
add    $0xffffffff,%ebp
add    $0xfffffffffffffff8,%rbx
cmp    $0x1,%ebp
jg     1130 <destroyGeneAdjMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroyGeneAdjMatrix(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = shl nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ %6, %4 ], [ %9, %7 ]
%9 = add nsw i64 %8, -1
%10 = and i64 %9, 4294967295
%11 = getelementptr inbounds i32*, i32** %0, i64 %10
%12 = bitcast i32** %11 to i8**
%13 = load i8*, i8** %12
tail call void @free(i8* %13)
%14 = trunc i64 %8 to i32
%15 = icmp sgt i32 %14, 1
br i1 %15, label %7, label %16
16: ; preds = %7, %2
%17 = bitcast i32** %0 to i8*
tail call void @free(i8* %17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ramfs_init();
void abms_preinit(void) { ramfs_init(); }


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

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

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

LLVM IR (-O2):
define void @abms_preinit() {
%1 = tail call i32 (...) @ramfs_init()
ret void
}
Test(config_reader, test_set_json_config1) {
  set_json_config("invalid_key", json_string("std_header_template"));
  set_json_config("invalid_key", json_integer(3));
  cr_assert(1);
}


x86 assembly (clang, -O0):
<Test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1050 <json_string@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <set_json_config@plt>
mov    $0x3,%edi
mov    $0x0,%al
call   1030 <json_integer@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <set_json_config@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <cr_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test>:
push   %rbx
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1050 <json_string@plt>
lea    0xeaa(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <set_json_config@plt>
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <json_integer@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <set_json_config@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rbx
jmp    1060 <cr_assert@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"invalid_key\00"
@.str.1 = [20 x i8] c"std_header_template\00"
define i32 @Test(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 (i8*, ...) bitcast (i32 (...)* @json_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @set_json_config to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i32, ...) bitcast (i32 (...)* @json_integer to i32 (i32, ...)*)(i32 3)
%9 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @set_json_config to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (i32, ...) bitcast (i32 (...)* @cr_assert to i32 (i32, ...)*)(i32 1)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [12 x i8] c"invalid_key\00"
@.str.1 = [20 x i8] c"std_header_template\00"
define i32 @Test(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @json_string to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @set_json_config to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @json_integer to i32 (i32, ...)*)(i32 3)
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @set_json_config to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @cr_assert to i32 (i32, ...)*)(i32 1)
ret i32 undef
}
/* Variables and functions */
char *cnfCreim(char *const, int);
int /*<<< orphan*/ cnfFree(char *);
int /*<<< orphan*/ cnfImpn(char *const, int, int, char *);
int /*<<< orphan*/ emsSetc(char *, char *);
void ems_setc_(char *const token, char *const cvalue, int token_length,
               int cvalue_length) {
  char ctok[15 + 1];
  char *ccval;

  cnfImpn(token, token_length, 15, ctok);
  ccval = cnfCreim(cvalue, cvalue_length);
  emsSetc(ctok, ccval);
  cnfFree(ccval);
  return;
}


x86 assembly (clang, -O0):
<ems_setc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x30(%rbp),%rcx
mov    $0xf,%edx
call   1030 <cnfImpn@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1060 <cnfCreim@plt>
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <emsSetc@plt>
mov    -0x38(%rbp),%rdi
call   1040 <cnfFree@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ems_setc_>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%ebp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %edx,%esi
mov    $0xf,%edx
mov    %r14,%rcx
call   1030 <cnfImpn@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <cnfCreim@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <emsSetc@plt>
mov    %rbx,%rdi
call   1040 <cnfFree@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ems_setc_(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [16 x i8]
%10 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i8*, i8** %5
%12 = load i32, i32* %7
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%14 = call i32 @cnfImpn(i8* %11, i32 %12, i32 15, i8* %13)
%15 = load i8*, i8** %6
%16 = load i32, i32* %8
%17 = call i8* @cnfCreim(i8* %15, i32 %16)
store i8* %17, i8** %10
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%19 = load i8*, i8** %10
%20 = call i32 @emsSetc(i8* %18, i8* %19)
%21 = load i8*, i8** %10
%22 = call i32 @cnfFree(i8* %21)
ret void
}

LLVM IR (-O2):
define void @ems_setc_(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = call i32 @cnfImpn(i8* %0, i32 %2, i32 15, i8* %6)
%8 = call i8* @cnfCreim(i8* %1, i32 %3)
%9 = call i32 @emsSetc(i8* %6, i8* %8)
%10 = call i32 @cnfFree(i8* %8)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
extern uint32_t cel_dek_hash(const char *str) {
  register uint32_t h = 0;
  while (*str != '\0') {
    h = ((h << 5) ^ (h >> 27) ^ (*str++));
  }
  return (h & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<cel_dek_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <cel_dek_hash+0x49>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1b,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <cel_dek_hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cel_dek_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1130 <cel_dek_hash+0x30>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sar    $0x1b,%eax
xor    %edx,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <cel_dek_hash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cel_dek_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i32, i32* %3
%11 = shl i32 %10, 5
%12 = load i32, i32* %3
%13 = ashr i32 %12, 27
%14 = xor i32 %11, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
%17 = load i8, i8* %15
%18 = sext i8 %17 to i32
%19 = xor i32 %14, %18
store i32 %19, i32* %3
br label %4
20: ; preds = %4
%21 = load i32, i32* %3
%22 = and i32 %21, 2147483647
ret i32 %22
}

LLVM IR (-O2):
define i32 @cel_dek_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %13, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = shl i32 %6, 5
%10 = ashr i32 %6, 27
%11 = xor i32 %9, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = xor i32 %11, %8
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = and i32 %13, 2147483647
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
void mcsafe_inject_src(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @mcsafe_inject_src(i8* nocapture %0) {
ret void
}
int test_imm_74int32_mem(int *val) {
  return ((*val) & (0x74 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_74int32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x74,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_74int32_mem>:
testb  $0x74,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_74int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 116
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_74int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 116
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stb_pointer_array_free(void *q, int len) {
  void **p = (void **)q;
  int i;
  for (i = 0; i < len; ++i)
    free(p[i]);
}


x86 assembly (clang, -O0):
<stb_pointer_array_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <stb_pointer_array_free+0x49>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <stb_pointer_array_free+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @stb_pointer_array_free(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i8**
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %3, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
char *calculate_size(char *, int /*<<< orphan*/);
char *parse_stat(char *, int);
char *get_resident_set_size(char *pid) {
  char *rss = parse_stat(pid, 24);
  if (rss == NULL)
    return NULL;
  char *rss_conv = calculate_size(rss, 0);
  return rss_conv;
}


x86 assembly (clang, -O0):
<get_resident_set_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x18,%esi
call   1040 <parse_stat@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <get_resident_set_size+0x36>
movq   $0x0,-0x8(%rbp)
jmp    116d <get_resident_set_size+0x4d>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <calculate_size@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_resident_set_size>:
push   %rax
mov    $0x18,%esi
call   1040 <parse_stat@plt>
test   %rax,%rax
je     113b <get_resident_set_size+0x1b>
mov    %rax,%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <calculate_size@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_resident_set_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @parse_stat(i8* %6, i32 24)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %15
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i8* @calculate_size(i8* %12, i32 0)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
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* @get_resident_set_size(i8* %0) {
%2 = tail call i8* @parse_stat(i8* %0, i32 24)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @calculate_size(i8* %2, i32 0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ FE_TONEAREST;
int /*<<< orphan*/ fesetround(int /*<<< orphan*/);
void Sys_SetFloatEnv(void) { fesetround(FE_TONEAREST); }


x86 assembly (clang, -O0):
<Sys_SetFloatEnv>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fesetround@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_SetFloatEnv>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fesetround@plt>

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
define void @Sys_SetFloatEnv() {
%1 = load i32, i32* @FE_TONEAREST
%2 = call i32 @fesetround(i32 %1)
ret void
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
define void @Sys_SetFloatEnv() {
%1 = load i32, i32* @FE_TONEAREST
%2 = tail call i32 @fesetround(i32 %1)
ret void
}
void closeSystemLog(void) {}


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

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

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

LLVM IR (-O2):
define void @closeSystemLog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void say_hello(void *str) { printf("Hello %s\n", (const char *)str); }


x86 assembly (clang, -O0):
<say_hello>:
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):
<say_hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @say_hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char x;
  scanf("%c", &x);
  printf("%d\n", ((x) - '0'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
sub    $0x30,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
add    $0xffffffd0,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 48
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, -48
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
void mcnet_write_int32(uint8_t *out, int32_t in) {
  out[0] = ((in >> 24) & 0xFF);
  out[1] = ((in >> 16) & 0xFF);
  out[2] = ((in >> 8) & 0xFF);
  out[3] = ((in >> 0) & 0xFF);
}


x86 assembly (clang, -O0):
<mcnet_write_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcnet_write_int32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @mcnet_write_int32(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 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = ashr i32 %20, 0
%22 = and i32 %21, 255
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 3
store i32 %22, i32* %24
ret void
}

LLVM IR (-O2):
define void @mcnet_write_int32(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ asctime(struct tm const *);
char *copy_string_result(char *, int /*<<< orphan*/);
char *rpl_asctime_r(struct tm const *restrict tm, char *restrict buf) {
  return copy_string_result(buf, asctime(tm));
}


x86 assembly (clang, -O0):
<rpl_asctime_r>:
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 <asctime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <copy_string_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_asctime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <asctime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <copy_string_result@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @rpl_asctime_r(%struct.tm* noalias %0, i8* noalias %1) {
%3 = alloca %struct.tm*
%4 = alloca i8*
store %struct.tm* %0, %struct.tm** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load %struct.tm*, %struct.tm** %3
%7 = call i32 @asctime(%struct.tm* %6)
%8 = call i8* @copy_string_result(i8* %5, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @rpl_asctime_r(%struct.tm* noalias %0, i8* noalias %1) {
%3 = tail call i32 @asctime(%struct.tm* %0)
%4 = tail call i8* @copy_string_result(i8* %1, i32 %3)
ret i8* %4
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
char *Char_array(int size) {
  return ((char *)malloc((unsigned)(size * sizeof(char))));
}


x86 assembly (clang, -O0):
<Char_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Char_array>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @Char_array(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 1
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @Char_array(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_metapost_comments() {
  test_parser_verify_parse(test_parser_sourcefile("metapost", " % comment"),
                           "metapost", "", "% comment", 0);
}


x86 assembly (clang, -O0):
<test_metapost_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xebc(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_metapost_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed5(%rip),%rdx
lea    0xec5(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"metapost\00"
@.str.1 = [11 x i8] c" % comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"% comment\00"
define void @test_metapost_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"metapost\00"
@.str.1 = [11 x i8] c" % comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"% comment\00"
define void @test_metapost_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
void ff_hevc_put_hevc_uni_epel_h4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h4_8_sse4() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t gf_add(uint8_t a, uint8_t b) { return a ^ b; }


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

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

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

LLVM IR (-O2):
define i32 @gf_add(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
int unkown_eapol_handler() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unkown_eapol_handler() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t mpack_load_u8(const char *p) { return (uint8_t)p[0]; }


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

x86 assembly (clang, -O2):
<mpack_load_u8>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mpack_load_u8(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 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @mpack_load_u8(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void setGreater() {
  emitln("setg\t%%al");
  emitln("neg\t%%al\t#change 1 to -1");
  emitln("movsx\t%%al,%%eax\t#extend al to eax");
}


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

x86 assembly (clang, -O2):
<setGreater>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emitln@plt>
lea    0xee6(%rip),%rdi
call   1030 <emitln@plt>
lea    0xef3(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"setg\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setGreater() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"setg\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setGreater() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}
__attribute__((__noreturn__)) void abort(void) { __builtin_unreachable(); }


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @abort() {
unreachable
}

LLVM IR (-O2):
int test_imm_6Fint32_mem(int *val) {
  return ((*val) & (0x6F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Fint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x6f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Fint32_mem>:
testb  $0x6f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Fint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 111
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_6Fint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 111
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float acos(int /*<<< orphan*/);
int /*<<< orphan*/ glmDotProduct3f(float const *, float const *);
float glmComputeNormalizedVectorAngle3fRad(const float v1[3],
                                           const float v2[3]) {
  return acos(glmDotProduct3f(v1, v2));
}


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

x86 assembly (clang, -O2):
<glmComputeNormalizedVectorAngle3fRad>:
push   %rax
call   1040 <glmDotProduct3f@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define float @glmComputeNormalizedVectorAngle3fRad(float* %0, float* %1) {
%3 = tail call i32 @glmDotProduct3f(float* %0, float* %1)
%4 = tail call float @acos(i32 %3)
ret float %4
}
void dummy_mix(void *v, float f[], int i) {}


x86 assembly (clang, -O0):
<dummy_mix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dummy_mix(i8* nocapture %0, float* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
void tls_deinit(void *ssl_ctx) {}


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

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

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

LLVM IR (-O2):
define void @tls_deinit(i8* nocapture %0) {
ret void
}
double square_1(x)
double x;
{ return x * x; }


x86 assembly (clang, -O0):
<square_1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_1>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @square_1(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void greeting() {
  puts("*** Welcome to Simpletron Simulator! ***");
  puts("*** Created by ahemed Mohamed Abd El Mawgood! ***");
  puts("*** ahmedsoliman0x666 (at) gmail.com ***");
}


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

x86 assembly (clang, -O2):
<greeting>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"*** Welcome to Simpletron Simulator! ***\00"
@.str.1 = [50 x i8] c"*** Created by ahemed Mohamed Abd El Mawgood! ***\00"
@.str.2 = [41 x i8] c"*** ahmedsoliman0x666 (at) gmail.com ***\00"
define void @greeting() {
%1 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"*** Welcome to Simpletron Simulator! ***\00"
@.str.1 = [50 x i8] c"*** Created by ahemed Mohamed Abd El Mawgood! ***\00"
@.str.2 = [41 x i8] c"*** ahmedsoliman0x666 (at) gmail.com ***\00"
define void @greeting() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int test_imm_4Cint16_mem(short *val) {
  return ((*val) & (0x4C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Cint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x4c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Cint16_mem>:
testb  $0x4c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Cint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 76
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_4Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 76
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_spifunc2(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_spifunc2() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_spifunc2() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void MPURegionEnable(uint32_t ui32Region) {
  ;
  (*((volatile uint32_t *)(0xE000ED98))) = ui32Region;
  (*((volatile uint32_t *)(0xE000EDA0))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<MPURegionEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xe000ed98,%eax
mov    %ecx,(%rax)
mov    $0xe000eda0,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0xe000eda0,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionEnable>:
mov    $0xe000eda0,%eax
mov    %edi,-0x8(%rax)
orl    $0x1,(%rax)
ret

LLVM IR (-O0):
define void @MPURegionEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 3758157208 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 3758157216 to i32*)
%5 = or i32 %4, 1
store volatile i32 %5, i32* inttoptr (i64 3758157216 to i32*)
ret void
}

LLVM IR (-O2):
define void @MPURegionEnable(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 3758157208 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 3758157216 to i32*)
%3 = or i32 %2, 1
store volatile i32 %3, i32* inttoptr (i64 3758157216 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void deleteS_M(int shmid) {
  if (shmctl(shmid, IPC_RMID, 0) == -1) {
    printf("delete S_M failed!\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<deleteS_M>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    116d <deleteS_M+0x3d>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteS_M>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
je     1148 <deleteS_M+0x18>
pop    %rax
ret
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [20 x i8] c"delete S_M failed!\0A\00"
define void @deleteS_M(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @shmctl(i32 %3, i32 %4, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@str = [19 x i8] c"delete S_M failed!\00"
define void @deleteS_M(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
int *test_func_05(int *p, int c) {
  *--p = c;
  *--p = c;
  *--p = c;
  return p;
}


x86 assembly (clang, -O0):
<test_func_05>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffc,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,-0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffc,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,-0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffc,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,-0x4(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_05>:
mov    %esi,-0x4(%rdi)
mov    %esi,-0x8(%rdi)
mov    %esi,-0xc(%rdi)
lea    -0xc(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @test_func_05(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i32 -1
store i32* %7, i32** %3
store i32 %5, i32* %7
%8 = load i32, i32* %4
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i32 -1
store i32* %10, i32** %3
store i32 %8, i32* %10
%11 = load i32, i32* %4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i32 -1
store i32* %13, i32** %3
store i32 %11, i32* %13
%14 = load i32*, i32** %3
ret i32* %14
}

LLVM IR (-O2):
define i32* @test_func_05(i32* writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 -1
store i32 %1, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 -2
store i32 %1, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 -3
store i32 %1, i32* %5
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ color();
int main() {
  color();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <color@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @color()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @color()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CheckSigs();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Handler(int n) {
  fprintf(stderr, "In handler\n");
  fprintf(stderr, "--------------\n");
  CheckSigs();
}


x86 assembly (clang, -O0):
<Handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <CheckSigs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Handler>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <CheckSigs@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"In handler\0A\00"
@.str.1 = [16 x i8] c"--------------\0A\00"
define void @Handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @CheckSigs()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"In handler\0A\00"
@.str.1 = [16 x i8] c"--------------\0A\00"
define void @Handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @CheckSigs()
ret void
}