xunge/DecIR huggingface dataset:
/* Variables and functions */
char *realpath(char const *, char *);
const char *my_realpath(const char *path, char *resolved_path) {
  char *str = realpath(path, resolved_path);
  return str ? str : path;
}


x86 assembly (clang, -O0):
<my_realpath>:
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 <realpath@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1149 <my_realpath+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1151 <my_realpath+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_realpath>:
push   %rbx
mov    %rdi,%rbx
call   1030 <realpath@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @my_realpath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @realpath(i8* %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 %13
11: ; preds = %2
%12 = load i8*, i8** %5
br label %15
13: ; preds = %2
%14 = load i8*, i8** %3
br label %15
15: ; preds = %13, %11
%16 = phi i8* [ %12, %11 ], [ %14, %13 ]
ret i8* %16
}

LLVM IR (-O2):
define i8* @my_realpath(i8* %0, i8* %1) {
%3 = tail call i8* @realpath(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* %0, i8* %3
ret i8* %5
}
/* Variables and functions */
void strcat(char *new, const char *orig) {
  while (*new ++)
    ;
  while ((*new ++ = *orig++))
    ;
  *new = '\0';
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1129 <strcat+0x29>
jmp    110c <strcat+0xc>
jmp    112e <strcat+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115d <strcat+0x5d>
jmp    112e <strcat+0x2e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat+0x10>
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @strcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %5, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
store i8 0, i8* %13
ret void
}
int test_imm_45uint16_mem(unsigned short *val) {
  return ((*val) & (-0x45 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_45uint16_mem>:
movzwl (%rdi),%eax
test   $0xffbb,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_45uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -69
%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_45uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -69
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_world(int num) {
  int i;
  for (i = 0; i < num; i++) {
    printf("World\n");
  }
  return 69;
}


x86 assembly (clang, -O0):
<print_world>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <print_world+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_world+0x12>
mov    $0x45,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_world>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <print_world+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
jne    1130 <print_world+0x20>
mov    $0x45,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"World\0A\00"
define i32 @print_world(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret i32 69
}

LLVM IR (-O2):
@str = [6 x i8] c"World\00"
define i32 @print_world(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 69
}
main() {
  char *c = 0;
  printf("%s\n", *c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
void ff_hevc_put_hevc_epel_v32_8_avx2() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @pathcon_nm5_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void diewitherror(char *errorMessage) {
  perror(errorMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<diewitherror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<diewitherror>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @diewitherror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @diewitherror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fmax(double, double);
int /*<<< orphan*/ fmaxf(float, float);
int /*<<< orphan*/ fmaxl(long double, long double);
void uninitvar_fmax(void) {
  float f1, f2;
  (void)fmaxf(f1, f2);
  double d1, d2;
  (void)fmax(d1, d2);
  long double ld1, ld2;
  (void)fmaxl(ld1, ld2);
}


x86 assembly (clang, -O0):
<uninitvar_fmax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmaxf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <fmax@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <fmaxl@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fmax>:
sub    $0x28,%rsp
call   1030 <fmaxf@plt>
call   1050 <fmax@plt>
call   1040 <fmaxl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_fmax() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = load float, float* %1
%8 = load float, float* %2
%9 = call i32 @fmaxf(float %7, float %8)
%10 = load double, double* %3
%11 = load double, double* %4
%12 = call i32 @fmax(double %10, double %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load x86_fp80, x86_fp80* %6
%15 = call i32 @fmaxl(x86_fp80 %13, x86_fp80 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fmax() {
%1 = tail call i32 @fmaxf(float undef, float undef)
%2 = tail call i32 @fmax(double undef, double undef)
%3 = tail call i32 @fmaxl(x86_fp80 undef, x86_fp80 undef)
ret void
}
void ACCESS_DESCRIPTION_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ACCESS_DESCRIPTION_free() {
ret void
}
/* Type definitions */
struct GameMap {
  int dummy;
};

/* Variables and functions */
int map_leftop(struct GameMap *const);
int /*<<< orphan*/ map_rotate_left(struct GameMap *const, int);
int map_rightop(struct GameMap *const map) {
  map_rotate_left(map, 2);
  int actions = map_leftop(map);
  map_rotate_left(map, 2);
  return actions;
}


x86 assembly (clang, -O0):
<map_rightop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <map_rotate_left@plt>
mov    -0x8(%rbp),%rdi
call   1040 <map_leftop@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <map_rotate_left@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_rightop>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2,%esi
call   1030 <map_rotate_left@plt>
mov    %rbx,%rdi
call   1040 <map_leftop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <map_rotate_left@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.GameMap = type { i32 }
define i32 @map_rightop(%struct.GameMap* %0) {
%2 = alloca %struct.GameMap*
%3 = alloca i32
store %struct.GameMap* %0, %struct.GameMap** %2
%4 = load %struct.GameMap*, %struct.GameMap** %2
%5 = call i32 @map_rotate_left(%struct.GameMap* %4, i32 2)
%6 = load %struct.GameMap*, %struct.GameMap** %2
%7 = call i32 @map_leftop(%struct.GameMap* %6)
store i32 %7, i32* %3
%8 = load %struct.GameMap*, %struct.GameMap** %2
%9 = call i32 @map_rotate_left(%struct.GameMap* %8, i32 2)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.GameMap = type { i32 }
define i32 @map_rightop(%struct.GameMap* %0) {
%2 = tail call i32 @map_rotate_left(%struct.GameMap* %0, i32 2)
%3 = tail call i32 @map_leftop(%struct.GameMap* %0)
%4 = tail call i32 @map_rotate_left(%struct.GameMap* %0, i32 2)
ret i32 %3
}
void tprintf(const char *fmt, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @tprintf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int setup_fd(int /*<<< orphan*/, int, char *);
int /*<<< orphan*/ socket(int, int, int);
int s_socket(int domain, int type, int protocol, int nonblock, char *msg) {
  return setup_fd(socket(domain, type, protocol), nonblock, msg);
}


x86 assembly (clang, -O0):
<s_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <setup_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_socket>:
push   %rbp
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %ecx,%ebp
call   1040 <socket@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <setup_fd@plt>

LLVM IR (-O0):
define i32 @s_socket(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @socket(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = call i32 @setup_fd(i32 %14, i32 %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @s_socket(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%7 = tail call i32 @setup_fd(i32 %6, i32 %3, i8* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ drop_mem(int);
void drop_mems(int *qids, int no) {
  int i;
  for (i = 0; i < no; i++, qids++) {
    drop_mem(*qids);
  }
}


x86 assembly (clang, -O0):
<drop_mems>:
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    1157 <drop_mems+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <drop_mem@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1126 <drop_mems+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @drop_mems(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 = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = call i32 @drop_mem(i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %3
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @drop_mems(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = load i32, i32* %6
%8 = tail call i32 @drop_mem(i32 %7)
%9 = add nuw nsw i32 %5, 1
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = icmp eq i32 %9, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strc(char *, char *);
int main() {
  char a[100], b[] = "this is a book.";
  strc(a, b);
  puts(a);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <strc@plt>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <strc@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.b = [16 x i8] c"this is a book.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [16 x i8]
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %3 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = call i32 @strc(i8* %5, i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.b = [16 x i8] c"this is a book.\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @strc(i8* %3, i8* %4)
%6 = call i32 @puts(i8* %3)
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
scalar_t__ read_line();
int main() {
  while (read_line()) {
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <read_line@plt>
cmp    $0x0,%rax
je     1135 <main+0x25>
jmp    111f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_line@plt>
test   %rax,%rax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = call i64 (...) @read_line()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @read_line()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 0
}
void sfd_unload(void) {}


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

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

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

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

/* Variables and functions */
uint32_t get32_le(void *p) {
  return *(uint8_t *)p | *((uint8_t *)p + 1) << 8 | *((uint8_t *)p + 2) << 16 |
         *((uint8_t *)p + 3) << 24;
}


x86 assembly (clang, -O0):
<get32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32_le>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get32_le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %5, %10
%12 = load i8*, i8** %2
%13 = bitcast i8* %12 to i32*
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 16
%17 = or i32 %11, %16
%18 = load i8*, i8** %2
%19 = bitcast i8* %18 to i32*
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = shl i32 %21, 24
%23 = or i32 %17, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @get32_le(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void gdk_keymap_get_entries_for_keyval() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keymap_get_entries_for_keyval() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *p_strdup(const char *str) {
  size_t len = strlen(str);
  char *s = (char *)malloc(len + 1);
  if (!s) {
    return NULL;
  }
  memcpy(s, str, len + 1);
  return s;
}


x86 assembly (clang, -O0):
<p_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <p_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118f <p_strdup+0x5f>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1164 <p_strdup+0x34>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
jmp    1167 <p_strdup+0x37>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @p_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
scalar_t__ FSE_32bits();
int /*<<< orphan*/ FSE_readLE32(void const *);
int /*<<< orphan*/ FSE_readLE64(void const *);
size_t FSE_readLEST(const void *memPtr) {
  if (FSE_32bits())
    return (size_t)FSE_readLE32(memPtr);
  else
    return (size_t)FSE_readLE64(memPtr);
}


x86 assembly (clang, -O0):
<FSE_readLEST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <FSE_32bits@plt>
cmp    $0x0,%rax
je     1161 <FSE_readLEST+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <FSE_readLE32@plt>
cltq
mov    %rax,-0x8(%rbp)
jmp    1170 <FSE_readLEST+0x40>
mov    -0x10(%rbp),%rdi
call   1040 <FSE_readLE64@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FSE_readLEST>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <FSE_32bits@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     114a <FSE_readLEST+0x1a>
call   1030 <FSE_readLE32@plt>
jmp    114f <FSE_readLEST+0x1f>
call   1040 <FSE_readLE64@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
define i64 @FSE_readLEST(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @FSE_32bits()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @FSE_readLE32(i8* %7)
%9 = sext i32 %8 to i64
store i64 %9, i64* %2
br label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @FSE_readLE64(i8* %11)
%13 = sext i32 %12 to i64
store i64 %13, i64* %2
br label %14
14: ; preds = %10, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @FSE_readLEST(i8* %0) {
%2 = tail call i64 (...) @FSE_32bits()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @FSE_readLE32(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @FSE_readLE64(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
%10 = sext i32 %9 to i64
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x7e() {
  Assert_real((isbdigit(126) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              635, ("isbdigit should be 0 for ~"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x7e>:
push   %rax
mov    $0x7e,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x27b,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for ~\00"
define void @t_isbdigit_0x7e() {
%1 = tail call i64 @isbdigit(i32 126)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int IsDigit(int c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<IsDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <IsDigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsDigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @IsDigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *btshas_mm_malloc(int sz) {
  void *p;
  p = malloc(sz);
  memset(p, 0, sz);
  return (p);
}


x86 assembly (clang, -O0):
<btshas_mm_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btshas_mm_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @btshas_mm_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @memset(i8* %6, i32 0, i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @btshas_mm_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
ret i8* %2
}
int __getpagesize(void) { return 0x1000; }


x86 assembly (clang, -O0):
<__getpagesize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1000,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__getpagesize() {
ret i32 4096
}

LLVM IR (-O2):
define i32 @__getpagesize() {
ret i32 4096
}
int __access_ok(unsigned long addr, unsigned long size) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @__access_ok(i64 %0, i64 %1) {
ret i32 1
}
int kgsl_get_alloc_size(int detailed) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kgsl_get_alloc_size(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ anvil_syslog(int /*<<< orphan*/, char *, ...);
void __test_assert(char *expr, char *file, int line, const char *func) {
  anvil_syslog(0, "Test '%s' failed: file %s,", expr, file);
  anvil_syslog(0, " line %d, function '%s'\n", line, func);
}


x86 assembly (clang, -O0):
<__test_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %edi,%edi
lea    0xec8(%rip),%rsi
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
xor    %edi,%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_assert>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xedb(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
lea    0xee6(%rip),%rsi
xor    %edi,%edi
mov    %ebp,%edx
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <anvil_syslog@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Test '%s' failed: file %s,\00"
@.str.1 = [25 x i8] c" line %d, function '%s'\0A\00"
define void @__test_assert(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 (i32, i8*, ...) @anvil_syslog(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 (i32, i8*, ...) @anvil_syslog(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Test '%s' failed: file %s,\00"
@.str.1 = [25 x i8] c" line %d, function '%s'\0A\00"
define void @__test_assert(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 (i32, i8*, ...) @anvil_syslog(i32 0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = tail call i32 (i32, i8*, ...) @anvil_syslog(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int sig_num) { printf("Received sig %d.\n", sig_num); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"Received sig %d.\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
long getElapsedUserTime(struct rusage *ru) {
  return (1000000L * (long)ru->ru_utime.tv_sec + (long)ru->ru_utime.tv_usec);
}


x86 assembly (clang, -O0):
<getElapsedUserTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
add    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getElapsedUserTime>:
imul   $0xf4240,0x8(%rdi),%rax
add    (%rdi),%rax
ret

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

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
define i64 @getElapsedUserTime(%struct.rusage* nocapture %0) {
%2 = getelementptr inbounds %struct.rusage, %struct.rusage* %0, i64 0, i32 0, i32 1
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %0, i64 0, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}
/* Variables and functions */
double FDLIBM___ieee754_scalb(double, double);
scalar_t__ FDLIBM_ilogb(double);
double FDLIBM_significand(double x) {
  return FDLIBM___ieee754_scalb(x, (double)-FDLIBM_ilogb(x));
}


x86 assembly (clang, -O0):
<FDLIBM_significand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <FDLIBM_ilogb@plt>
movsd  -0x10(%rbp),%xmm0
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
cvtsi2sd %rax,%xmm1
call   1030 <FDLIBM___ieee754_scalb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FDLIBM_significand>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <FDLIBM_ilogb@plt>
neg    %rax
cvtsi2sd %rax,%xmm1
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <FDLIBM___ieee754_scalb@plt>

LLVM IR (-O0):
define double @FDLIBM_significand(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call i64 @FDLIBM_ilogb(double %4)
%6 = sub nsw i64 0, %5
%7 = sitofp i64 %6 to double
%8 = call double @FDLIBM___ieee754_scalb(double %3, double %7)
ret double %8
}

LLVM IR (-O2):
define double @FDLIBM_significand(double %0) {
%2 = tail call i64 @FDLIBM_ilogb(double %0)
%3 = sub nsw i64 0, %2
%4 = sitofp i64 %3 to double
%5 = tail call double @FDLIBM___ieee754_scalb(double %0, double %4)
ret double %5
}
void use(int *p) { (void)p; }


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

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

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

LLVM IR (-O2):
define void @use(i32* nocapture %0) {
ret void
}
float _bnr_round(float n) {
  int r = (n * 100);
  while (r % 5)
    r++;
  return (r / 100.0);
}


x86 assembly (clang, -O0):
<_bnr_round>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113f <_bnr_round+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <_bnr_round+0x1d>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bnr_round>:
mulss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
nopl   0x0(%rax)
imul   $0xcccccccd,%eax,%ecx
add    $0x19999999,%ecx
add    $0x1,%eax
cmp    $0x33333332,%ecx
ja     1110 <_bnr_round+0x10>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xecf(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @_bnr_round(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 1.000000e+02
%6 = fptosi float %5 to i32
store i32 %6, i32* %3
br label %7
7: ; preds = %11, %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %7
14: ; preds = %7
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 1.000000e+02
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
define float @_bnr_round(float %0) {
%2 = fmul float %0, 1.000000e+02
%3 = fptosi float %2 to i32
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ %3, %1 ], [ %8, %4 ]
%6 = srem i32 %5, 5
%7 = icmp eq i32 %6, 0
%8 = add nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
%10 = sitofp i32 %5 to double
%11 = fdiv double %10, 1.000000e+02
%12 = fptrunc double %11 to float
ret float %12
}
/* Type definitions */
struct gbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t gbuf_lsize(struct gbuf const *);
size_t gbuf_offset(struct gbuf const *buf) {
  assert(buf != NULL);
  return gbuf_lsize(buf);
}


x86 assembly (clang, -O0):
<gbuf_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <gbuf_lsize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbuf_offset>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <gbuf_lsize@plt>

LLVM IR (-O0):
%struct.gbuf = type { i32 }
define i64 @gbuf_offset(%struct.gbuf* %0) {
%2 = alloca %struct.gbuf*
store %struct.gbuf* %0, %struct.gbuf** %2
%3 = load %struct.gbuf*, %struct.gbuf** %2
%4 = icmp ne %struct.gbuf* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.gbuf*, %struct.gbuf** %2
%8 = call i64 @gbuf_lsize(%struct.gbuf* %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.gbuf = type { i32 }
define i64 @gbuf_offset(%struct.gbuf* %0) {
%2 = icmp ne %struct.gbuf* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @gbuf_lsize(%struct.gbuf* %0)
ret i64 %5
}
int main(void) {
  5 % 1;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void c_free(void *arg0) { free(arg0); }


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

x86 assembly (clang, -O2):
<c_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @c_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct VectorVectorBase {
  int dummy;
};

/* Variables and functions */
size_t GetVectorVectorSize(struct VectorVectorBase *);
size_t get_vector_vector_size(struct VectorVectorBase *basev) {
  return GetVectorVectorSize(basev);
}


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

x86 assembly (clang, -O2):
<get_vector_vector_size>:
jmp    1030 <GetVectorVectorSize@plt>

LLVM IR (-O0):
%struct.VectorVectorBase = type { i32 }
define i64 @get_vector_vector_size(%struct.VectorVectorBase* %0) {
%2 = alloca %struct.VectorVectorBase*
store %struct.VectorVectorBase* %0, %struct.VectorVectorBase** %2
%3 = load %struct.VectorVectorBase*, %struct.VectorVectorBase** %2
%4 = call i64 @GetVectorVectorSize(%struct.VectorVectorBase* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.VectorVectorBase = type { i32 }
define i64 @get_vector_vector_size(%struct.VectorVectorBase* %0) {
%2 = tail call i64 @GetVectorVectorSize(%struct.VectorVectorBase* %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLfloat;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glPixelMapfv(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
void PixelMapfv(GLenum map, GLint mapsize, GLfloat *values) {
  glPixelMapfv(map, mapsize, values);
}


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

x86 assembly (clang, -O2):
<PixelMapfv>:
jmp    1030 <glPixelMapfv@plt>

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

LLVM IR (-O2):
define void @PixelMapfv(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @glPixelMapfv(i32 %0, i32 %1, i32* %2)
ret void
}
const char *stress_3_get_description(void) {
  return "Create a file named stress_3_test_file_pid, "
         "where pid is the process id. "
         "Write a single character past the end of the file, "
         "based on the specified file size, "
         "which creates a hole in the file. "
         "Fill the hole with random data. "
         "Then truncate the file length to zero. "
         "The size is given by the -z or --size option, "
         "otherwise it defaults to 1000000. "
         "The file will be deleted if the delete option "
         "is specified.";
}


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

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

LLVM IR (-O0):
@.str = [403 x i8] c"Create a file named stress_3_test_file_pid, where pid is the process id. Write a single character past the end of the file, based on the specified file size, which creates a hole in the file. Fill the hole with random data. Then truncate the file length to zero. The size is given by the -z or --size option, otherwise it defaults to 1000000. The file will be deleted if the delete option is specified.\00"
define i8* @stress_3_get_description() {
ret i8* getelementptr inbounds ([403 x i8], [403 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [403 x i8] c"Create a file named stress_3_test_file_pid, where pid is the process id. Write a single character past the end of the file, based on the specified file size, which creates a hole in the file. Fill the hole with random data. Then truncate the file length to zero. The size is given by the -z or --size option, otherwise it defaults to 1000000. The file will be deleted if the delete option is specified.\00"
define i8* @stress_3_get_description() {
ret i8* getelementptr inbounds ([403 x i8], [403 x i8]* @.str, i64 0, i64 0)
}