xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ dma_do(int, scalar_t__, int);
void vdp_dma_cram(uint32_t from, uint16_t to, uint16_t len) {
  dma_do(from, len,
         ((0xC000 + (((uint32_t)to) & 0x3FFF)) << 16) +
             ((((uint32_t)to) >> 14) | 0x80));
}


x86 assembly (clang, -O0):
<vdp_dma_cram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
and    $0x3fff,%edx
add    $0xc000,%edx
shl    $0x10,%edx
mov    -0x10(%rbp),%rax
sar    $0xe,%eax
or     $0x80,%eax
add    %eax,%edx
call   1030 <dma_do@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdp_dma_cram>:
mov    %esi,%eax
shl    $0x10,%eax
or     $0xc0000000,%eax
sar    $0xe,%esi
or     $0x80,%esi
add    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <dma_do@plt>

LLVM IR (-O0):
define void @vdp_dma_cram(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 16383
%12 = add nsw i32 49152, %11
%13 = shl i32 %12, 16
%14 = load i64, i64* %5
%15 = trunc i64 %14 to i32
%16 = ashr i32 %15, 14
%17 = or i32 %16, 128
%18 = add nsw i32 %13, %17
%19 = call i32 @dma_do(i32 %7, i64 %8, i32 %18)
ret void
}

LLVM IR (-O2):
define void @vdp_dma_cram(i32 %0, i64 %1, i64 %2) {
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 16
%6 = or i32 %5, -1073741824
%7 = ashr i32 %4, 14
%8 = or i32 %7, 128
%9 = add nsw i32 %6, %8
%10 = tail call i32 @dma_do(i32 %0, i64 %2, i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void copy_int(int val, void *buf, int maxbytes) {
  if (maxbytes > 0 && maxbytes >= sizeof(int))
    memcpy(buf, (void *)&val, sizeof(val));
}


x86 assembly (clang, -O0):
<copy_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    114c <copy_int+0x3c>
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jb     114c <copy_int+0x3c>
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_int>:
push   %rax
mov    %edi,0x4(%rsp)
cmp    $0x4,%edx
jl     112f <copy_int+0x1f>
lea    0x4(%rsp),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @copy_int(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = icmp uge i64 %11, 4
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = bitcast i32* %4 to i8*
%16 = call i32 @memcpy(i8* %14, i8* %15, i32 4)
br label %17
17: ; preds = %13, %9, %3
ret void
}

LLVM IR (-O2):
define void @copy_int(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = icmp sgt i32 %2, 3
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = bitcast i32* %4 to i8*
%8 = call i32 @memcpy(i8* %1, i8* %7, i32 4)
br label %9
9: ; preds = %6, %3
ret void
}
const char *pa_strna(const char *x) { return x ? x : "n/a"; }


x86 assembly (clang, -O0):
<pa_strna>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <pa_strna+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <pa_strna+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <pa_strna+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_strna>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"n/a\00"
define i8* @pa_strna(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"n/a\00"
define i8* @pa_strna(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
int max(int x, int y) {
  if (x < y)
    return y;
  else
    return x;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <max+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
unsigned kol_btn_get() { asm("int $0x40" ::"a"(17)); }


x86 assembly (clang, -O0):
<kol_btn_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%eax
int    $0x40
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_btn_get>:
mov    $0x11,%eax
int    $0x40
ret

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

LLVM IR (-O2):
define i32 @kol_btn_get() {
tail call void asm sideeffect "int $$0x40", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 17)
ret i32 undef
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int apply_sign64(int, int const);
int iclip(int const, int, int);
long long llabs(int const);
int get_mult_shift_diag(const int64_t px, const int idet, const int shift) {
  const int64_t v1 = px * idet;
  const int v2 =
      apply_sign64((int)((llabs(v1) + ((1LL << shift) >> 1)) >> shift), v1);
  return iclip(v2, 0xe001, 0x11fff);
}


x86 assembly (clang, -O0):
<get_mult_shift_diag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <llabs@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sar    $0x1,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
sar    %cl,%rax
mov    %eax,%edi
mov    -0x10(%rbp),%esi
call   1050 <apply_sign64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0xe001,%esi
mov    $0x11fff,%edx
call   1030 <iclip@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mult_shift_diag>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
imul   %edi,%ebp
mov    %ebp,%edi
call   1040 <llabs@plt>
mov    $0x1,%edi
mov    %ebx,%ecx
shl    %cl,%rdi
sar    %rdi
add    %rax,%rdi
sar    %cl,%rdi
mov    %ebp,%esi
call   1050 <apply_sign64@plt>
mov    %eax,%edi
mov    $0xe001,%esi
mov    $0x11fff,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <iclip@plt>

LLVM IR (-O0):
define i32 @get_mult_shift_diag(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i64 @llabs(i32 %12)
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = shl i64 1, %15
%17 = ashr i64 %16, 1
%18 = add nsw i64 %13, %17
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = ashr i64 %18, %20
%22 = trunc i64 %21 to i32
%23 = load i32, i32* %7
%24 = call i32 @apply_sign64(i32 %22, i32 %23)
store i32 %24, i32* %8
%25 = load i32, i32* %8
%26 = call i32 @iclip(i32 %25, i32 57345, i32 73727)
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_mult_shift_diag(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = tail call i64 @llabs(i32 %4)
%6 = zext i32 %2 to i64
%7 = shl nuw i64 1, %6
%8 = ashr i64 %7, 1
%9 = add nsw i64 %5, %8
%10 = ashr i64 %9, %6
%11 = trunc i64 %10 to i32
%12 = tail call i32 @apply_sign64(i32 %11, i32 %4)
%13 = tail call i32 @iclip(i32 %12, i32 57345, i32 73727)
ret i32 %13
}
/* Type definitions */
struct bucket_loop {
  int dummy;
};
struct bucket_list {
  int dummy;
};

/* Variables and functions */
struct bucket_list *get_config_file(char const *);
struct bucket_loop *init_bucket_loop(struct bucket_list *);
int /*<<< orphan*/ objunref(struct bucket_list *);
extern struct bucket_loop *get_category_loop(const char *configname) {
  struct bucket_loop *cloop;
  struct bucket_list *file;
  file = get_config_file(configname);
  cloop = init_bucket_loop(file);
  objunref(file);
  return (cloop);
}


x86 assembly (clang, -O0):
<get_category_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_config_file@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <init_bucket_loop@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <objunref@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_category_loop>:
push   %r14
push   %rbx
push   %rax
call   1030 <get_config_file@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <init_bucket_loop@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <objunref@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.bucket_loop = type { i32 }
%struct.bucket_list = type { i32 }
define %struct.bucket_loop* @get_category_loop(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.bucket_loop*
%4 = alloca %struct.bucket_list*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call %struct.bucket_list* @get_config_file(i8* %5)
store %struct.bucket_list* %6, %struct.bucket_list** %4
%7 = load %struct.bucket_list*, %struct.bucket_list** %4
%8 = call %struct.bucket_loop* @init_bucket_loop(%struct.bucket_list* %7)
store %struct.bucket_loop* %8, %struct.bucket_loop** %3
%9 = load %struct.bucket_list*, %struct.bucket_list** %4
%10 = call i32 @objunref(%struct.bucket_list* %9)
%11 = load %struct.bucket_loop*, %struct.bucket_loop** %3
ret %struct.bucket_loop* %11
}

LLVM IR (-O2):
%struct.bucket_loop = type { i32 }
%struct.bucket_list = type { i32 }
define %struct.bucket_loop* @get_category_loop(i8* %0) {
%2 = tail call %struct.bucket_list* @get_config_file(i8* %0)
%3 = tail call %struct.bucket_loop* @init_bucket_loop(%struct.bucket_list* %2)
%4 = tail call i32 @objunref(%struct.bucket_list* %2)
ret %struct.bucket_loop* %3
}
int xfuse_deinit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xfuse_deinit() {
ret i32 0
}
int mus_bgm_waitpos(int no, int index) {
  printf("%s not implemented\n", __func__);
  return (-1);
}


x86 assembly (clang, -O0):
<mus_bgm_waitpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_bgm_waitpos>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef5(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_bgm_waitpos = [16 x i8] c"mus_bgm_waitpos\00"
define i32 @mus_bgm_waitpos(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.mus_bgm_waitpos, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.mus_bgm_waitpos = [16 x i8] c"mus_bgm_waitpos\00"
define i32 @mus_bgm_waitpos(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.mus_bgm_waitpos, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
struct info {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void yy_symbol_value_print(FILE *yyoutput, int yytype,
                           struct info *const *const yyvaluep) {
  FILE *yyo = yyoutput;
  ((void)(yyo));
  if (!yyvaluep)
    return;
  ((void)(yyoutput));
  switch (yytype) {
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<yy_symbol_value_print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1127 <yy_symbol_value_print+0x27>
jmp    112c <yy_symbol_value_print+0x2c>
jmp    112c <yy_symbol_value_print+0x2c>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.info = type { i32 }
define void @yy_symbol_value_print(i32* %0, i32 %1, %struct.info** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca %struct.info**
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store %struct.info** %2, %struct.info*** %6
%8 = load i32*, i32** %4
store i32* %8, i32** %7
%9 = load i32*, i32** %7
%10 = load %struct.info**, %struct.info*** %6
%11 = icmp ne %struct.info** %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
br label %17
13: ; preds = %3
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
switch i32 %15, label %16 [
]
16: ; preds = %13
br label %17
17: ; preds = %12, %16
ret void
}

LLVM IR (-O2):
%struct.info = type { i32 }
define void @yy_symbol_value_print(i32* nocapture %0, i32 %1, %struct.info** nocapture %2) {
ret void
}
void *pdvp(const void *v1, const void *v2, unsigned int n, unsigned int t) {}


x86 assembly (clang, -O0):
<pdvp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @pdvp(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ RFM22BReceiverHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void RFM22BReceiverUpdated() { UAVObjUpdated(RFM22BReceiverHandle()); }


x86 assembly (clang, -O0):
<RFM22BReceiverUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RFM22BReceiverHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFM22BReceiverUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <RFM22BReceiverHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @RFM22BReceiverUpdated() {
%1 = call i32 (...) @RFM22BReceiverHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RFM22BReceiverUpdated() {
%1 = tail call i32 (...) @RFM22BReceiverHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Test\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"Test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int is_ws(char c) {
  int value;
  if (c == ' ' || c == '\t' || c == '\n' || c == '\0') {
    value = 1;
  } else {
    value = 0;
  }
  return value;
}


x86 assembly (clang, -O0):
<is_ws>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
je     113e <is_ws+0x3e>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
je     113e <is_ws+0x3e>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     113e <is_ws+0x3e>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    114a <is_ws+0x4a>
movl   $0x1,-0x8(%rbp)
jmp    1151 <is_ws+0x51>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ws>:
cmp    $0x20,%dil
ja     1120 <is_ws+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000601,%rdx
bt     %rcx,%rdx
jae    1120 <is_ws+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_ws(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 10, label %3
i8 9, label %3
i8 0, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ floor(int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopNumber();
int /*<<< orphan*/ wStackPushNumber(int /*<<< orphan*/);
void wBuiltinFix() { wStackPushNumber(floor(wStackPopNumber())); }


x86 assembly (clang, -O0):
<wBuiltinFix>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <floor@plt>
mov    %eax,%edi
call   1040 <wStackPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinFix>:
push   %rax
xor    %eax,%eax
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <floor@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <wStackPushNumber@plt>

LLVM IR (-O0):
define void @wBuiltinFix() {
%1 = call i32 (...) @wStackPopNumber()
%2 = call i32 @floor(i32 %1)
%3 = call i32 @wStackPushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @wBuiltinFix() {
%1 = tail call i32 (...) @wStackPopNumber()
%2 = tail call i32 @floor(i32 %1)
%3 = tail call i32 @wStackPushNumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void write_h(void *addr, size_t size) { printf("*** written %p\n", addr); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"*** written %p\0A\00"
define void @write_h(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"*** written %p\0A\00"
define void @write_h(i8* %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct TYPE_3__ {
  int /*<<< orphan*/ member_0;
};
typedef TYPE_1__ mbstate_t;

/* Variables and functions */
int wcrtomb(char *, int /*<<< orphan*/, TYPE_1__ *);
int wctomb(char *s, wchar_t wc) {
  if (!s)
    return 0;
  mbstate_t ps = {0};
  return wcrtomb(s, wc, &ps);
}


x86 assembly (clang, -O0):
<wctomb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <wctomb+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1169 <wctomb+0x49>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x18(%rbp),%rdx
call   1040 <wcrtomb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb>:
test   %rdi,%rdi
je     112a <wctomb+0x1a>
push   %rax
movl   $0x0,(%rsp)
mov    %rsp,%rdx
call   1030 <wcrtomb@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @wctomb(i8* %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = icmp eq i8* %0, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = bitcast %struct.TYPE_3__* %3 to i8*
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
store i32 0, i32* %7
%8 = call i32 @wcrtomb(i8* %0, i32 %1, %struct.TYPE_3__* %3)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %10
}
void PrintObjectGetVarPN1(void *theEnv, const char *logicalName,
                          void *theValue) {}


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

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

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

LLVM IR (-O2):
define void @PrintObjectGetVarPN1(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ calibrate_by_tsc(double *, int /*<<< orphan*/ *);
scalar_t__ calibrate_cpufreq(double *, int /*<<< orphan*/ *);
scalar_t__ calibrate_cpuinfo(double *, int /*<<< orphan*/ *);
void os_calibrate(double *nsofclk, uint64_t *clkofsec) {
  if (calibrate_cpuinfo(nsofclk, clkofsec) == 0) {
    return;
  }
  if (calibrate_cpufreq(nsofclk, clkofsec) == 0) {
    return;
  }
  calibrate_by_tsc(nsofclk, clkofsec);
}


x86 assembly (clang, -O0):
<os_calibrate>:
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   1050 <calibrate_cpuinfo@plt>
cmp    $0x0,%rax
jne    115c <os_calibrate+0x2c>
jmp    1185 <os_calibrate+0x55>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calibrate_cpufreq@plt>
cmp    $0x0,%rax
jne    1178 <os_calibrate+0x48>
jmp    1185 <os_calibrate+0x55>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calibrate_by_tsc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_calibrate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <calibrate_cpuinfo@plt>
test   %rax,%rax
je     1166 <os_calibrate+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <calibrate_cpufreq@plt>
test   %rax,%rax
je     1166 <os_calibrate+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <calibrate_by_tsc@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @os_calibrate(double* %0, i32* %1) {
%3 = tail call i64 @calibrate_cpuinfo(double* %0, i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @calibrate_cpufreq(double* %0, i32* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @calibrate_by_tsc(double* %0, i32* %1)
br label %10
10: ; preds = %5, %2, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int const);
void set_29(const int on) { gpio_set(29, on); }


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

x86 assembly (clang, -O2):
<set_29>:
mov    %edi,%esi
mov    $0x1d,%edi
jmp    1030 <gpio_set@plt>

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

LLVM IR (-O2):
define void @set_29(i32 %0) {
%2 = tail call i32 @gpio_set(i32 29, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mat3f_scale_new(float *, float const, float const,
                                   float const);
void mat3f_scaleVec_new(float result[9], const float xyz[3]) {
  mat3f_scale_new(result, xyz[0], xyz[1], xyz[2]);
}


x86 assembly (clang, -O0):
<mat3f_scaleVec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
call   1030 <mat3f_scale_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3f_scaleVec_new>:
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
movss  0x8(%rsi),%xmm2
jmp    1030 <mat3f_scale_new@plt>

LLVM IR (-O0):
define void @mat3f_scaleVec_new(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 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = call i32 @mat3f_scale_new(float* %5, float %8, float %11, float %14)
ret void
}

LLVM IR (-O2):
define void @mat3f_scaleVec_new(float* %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 2
%7 = load float, float* %6
%8 = tail call i32 @mat3f_scale_new(float* %0, float %3, float %5, float %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_155() {
  Assert_real((isqrt(155) == 12),
              "/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/stdlib/isqrt.c",
              780, ("Integer square root of 155 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_155>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9b,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x30c,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_155>:
push   %rax
mov    $0x9b,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x30c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 155 should be 12\00"
define void @t_sqrt_155() {
%1 = call i32 @isqrt(i32 155)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 155 should be 12\00"
define void @t_sqrt_155() {
%1 = tail call i32 @isqrt(i32 155)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void clock_init_uart_h6(void) {
  (*((volatile unsigned long *)((0x03001000 + 0x90C))) |=
   (unsigned long)(1 << ((0) + 1 - 1)));
  (*((volatile unsigned long *)((0x03001000 + 0x90C))) |=
   (unsigned long)(1 << ((16) + 1 - 1)));
}


x86 assembly (clang, -O0):
<clock_init_uart_h6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x300190c,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x300190c,%eax
mov    %rcx,(%rax)
mov    $0x300190c,%eax
mov    (%rax),%rcx
or     $0x10000,%rcx
mov    $0x300190c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_init_uart_h6>:
orq    $0x1,0x300190c
03 01
orq    $0x10000,0x300190c
ret

LLVM IR (-O0):
define void @clock_init_uart_h6() {
%1 = load volatile i64, i64* inttoptr (i64 50338060 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 50338060 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 50338060 to i64*)
%4 = or i64 %3, 65536
store volatile i64 %4, i64* inttoptr (i64 50338060 to i64*)
ret void
}

LLVM IR (-O2):
define void @clock_init_uart_h6() {
%1 = load volatile i64, i64* inttoptr (i64 50338060 to i64*)
%2 = or i64 %1, 1
store volatile i64 %2, i64* inttoptr (i64 50338060 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 50338060 to i64*)
%4 = or i64 %3, 65536
store volatile i64 %4, i64* inttoptr (i64 50338060 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strv_free_free(char ***);
void strv_free_freep(char ****p) {
  if (*p)
    strv_free_free(*p);
}


x86 assembly (clang, -O0):
<strv_free_freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <strv_free_freep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strv_free_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_free_freep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <strv_free_freep+0xd>
jmp    1030 <strv_free_free@plt>
ret

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

LLVM IR (-O2):
define void @strv_free_freep(i8**** nocapture %0) {
%2 = load i8***, i8**** %0
%3 = icmp eq i8*** %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @strv_free_free(i8*** %2)
br label %6
6: ; preds = %4, %1
ret void
}
void fz_var_xxx(void *e) {}


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

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

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

LLVM IR (-O2):
define void @fz_var_xxx(i8* nocapture %0) {
ret void
}
int g(int b) {
  if (b != 0) {
    b = b > 0 ? b : -b;
    if (b != 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <g+0x4f>
cmpl   $0x0,-0x8(%rbp)
jle    1126 <g+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112e <g+0x2e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114a <g+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1156 <g+0x56>
jmp    114f <g+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void XSetWMProperties() {}


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

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

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

LLVM IR (-O2):
define void @XSetWMProperties() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void draw_y(int x) {
  for (int i = 0; i < x; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<draw_y>:
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 <draw_y+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <draw_y+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_y>:
push   %rbx
test   %edi,%edi
jle    112f <draw_y+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <draw_y+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @draw_y(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 ([2 x i8], [2 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 void
}

LLVM IR (-O2):
define void @draw_y(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
int main(void) {
  int fiftytwo = 52;
  int five = 5;
  return fiftytwo - five - five;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int RAND_egd_bytes(char const *, int);
int RAND_egd(const char *path) { return (RAND_egd_bytes(path, 255)); }


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

x86 assembly (clang, -O2):
<RAND_egd>:
mov    $0xff,%esi
jmp    1030 <RAND_egd_bytes@plt>

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

LLVM IR (-O2):
define i32 @RAND_egd(i8* %0) {
%2 = tail call i32 @RAND_egd_bytes(i8* %0, i32 255)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr,
                          size_t stacksize) {
  printf("FIXME: pthread_attr_getstack called\n");
  abort();
}


x86 assembly (clang, -O0):
<pthread_attr_setstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<pthread_attr_setstack>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"FIXME: pthread_attr_getstack called\0A\00"
define i32 @pthread_attr_setstack(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"FIXME: pthread_attr_getstack called\00"
define i32 @pthread_attr_setstack(i32* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
void *thread_function0(void *);
void *thread_function0_1(void *arg) {
  void *ret = thread_function0(arg);
  return ret;
}


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

x86 assembly (clang, -O2):
<thread_function0_1>:
jmp    1030 <thread_function0@plt>

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

LLVM IR (-O2):
define i8* @thread_function0_1(i8* %0) {
%2 = tail call i8* @thread_function0(i8* %0)
ret i8* %2
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char **, char const *, struct option const *, int *,
                     int /*<<< orphan*/, int /*<<< orphan*/);
int getopt_long(int argc, char *const *argv, const char *options,
                const struct option *long_options, int *opt_index) {
  return _getopt_internal(argc, (char **)argv, options, long_options, opt_index,
                          0, 0);
}


x86 assembly (clang, -O0):
<getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long>:
push   %rax
movl   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <_getopt_internal@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 0, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0, i32 0)
ret i32 %6
}
OP(fd, c9) {
  illegal_1();
  op_c9();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_c9@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c9()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xb4() {
  Assert_real((isgraph(180) == 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_isgraph.c",
              905, ("isgraph should be 0 for 0xb4"));
}


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

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

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

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


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

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

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

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