xunge/DecIR huggingface dataset:
int test_imm_2Cuint16_mem(unsigned short *val) {
  return ((*val) & (-0x2C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Cuint16_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, -44
%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_2Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -44
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void do_nothing(int sig) { (void)sig; }


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

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

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

LLVM IR (-O2):
define void @do_nothing(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, unsigned char const *, int);
void GLUE_SET_PX_FROM_P1(void *b, int wv) {
  static const unsigned char tab[3][3] = {
      {0x90, 0x90, 0x90},
      {0x48, 0x89, 0xC7},
      {0x48, 0x89, 0xC1},
  };
  memcpy(b, tab[wv], 3);
}


x86 assembly (clang, -O0):
<GLUE_SET_PX_FROM_P1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
lea    0xed2(%rip),%rsi
imul   $0x3,%rax,%rax
add    %rax,%rsi
mov    $0x3,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_SET_PX_FROM_P1>:
movslq %esi,%rax
lea    (%rax,%rax,2),%rax
lea    0xee2(%rip),%rsi
add    %rax,%rsi
mov    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@GLUE_SET_PX_FROM_P1.tab = internal constant [3 x [3 x i8]] [[3 x i8] c"\90\90\90", [3 x i8] c"H\89\C7", [3 x i8] c"H\89\C1"]
define void @GLUE_SET_PX_FROM_P1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* @GLUE_SET_PX_FROM_P1.tab, i64 0, i64 %7
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%10 = call i32 @memcpy(i8* %5, i8* %9, i32 3)
ret void
}

LLVM IR (-O2):
@GLUE_SET_PX_FROM_P1.tab = internal constant [3 x [3 x i8]] [[3 x i8] c"\90\90\90", [3 x i8] c"H\89\C7", [3 x i8] c"H\89\C1"]
define void @GLUE_SET_PX_FROM_P1(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* @GLUE_SET_PX_FROM_P1.tab, i64 0, i64 %3, i64 0
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i32 3)
ret void
}
int get_cut_part(const int file_size) {
  int part = 0;
  float f_part = 0;
  if (file_size < 0)
    return -1;
  f_part = ((float)file_size / ((float)(18 * 1024 * 1024)));
  part = (int)f_part;
  if (f_part - (int)f_part > 0)
    part = (int)f_part + 1;
  return part;
}


x86 assembly (clang, -O0):
<get_cut_part>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112c <get_cut_part+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <get_cut_part+0x79>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
cvttss2si -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1173 <get_cut_part+0x73>
cvttss2si -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cut_part>:
test   %edi,%edi
js     112d <get_cut_part+0x2d>
cvtsi2ss %edi,%xmm0
divss  0xef0(%rip),%xmm0
cvttss2si %xmm0,%ecx
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
add    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @get_cut_part(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 0, i32* %4
store float 0.000000e+00, float* %5
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %27
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to float
%12 = fdiv float %11, 0x4172000000000000
store float %12, float* %5
%13 = load float, float* %5
%14 = fptosi float %13 to i32
store i32 %14, i32* %4
%15 = load float, float* %5
%16 = load float, float* %5
%17 = fptosi float %16 to i32
%18 = sitofp i32 %17 to float
%19 = fsub float %15, %18
%20 = fcmp ogt float %19, 0.000000e+00
br i1 %20, label %21, label %25
21: ; preds = %9
%22 = load float, float* %5
%23 = fptosi float %22 to i32
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %25
25: ; preds = %21, %9
%26 = load i32, i32* %4
store i32 %26, i32* %2
br label %27
27: ; preds = %25, %8
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @get_cut_part(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to float
%5 = fdiv float %4, 0x4172000000000000
%6 = fptosi float %5 to i32
%7 = sitofp i32 %6 to float
%8 = fsub float %5, %7
%9 = fcmp ogt float %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = add nsw i32 %10, %6
br label %12
12: ; preds = %1, %3
%13 = phi i32 [ %11, %3 ], [ -1, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int send_command_expect_ok(int, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int netplot_clear(int server_connection_index) {
  char buffer[256];
  memset(buffer, 0, 256);
  snprintf(buffer, 256, "clear %d\n", server_connection_index);
  return send_command_expect_ok(server_connection_index, buffer);
}


x86 assembly (clang, -O0):
<netplot_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
lea    0xe99(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1050 <send_command_expect_ok@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netplot_clear>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    0xeab(%rip),%rdx
mov    %r14,%rdi
mov    $0x100,%esi
mov    %ebx,%ecx
call   1030 <snprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <send_command_expect_ok@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"clear %d\0A\00"
define i32 @netplot_clear(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%11 = call i32 @send_command_expect_ok(i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [10 x i8] c"clear %d\0A\00"
define i32 @netplot_clear(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 256)
%5 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @send_command_expect_ok(i32 %0, i8* %3)
ret i32 %6
}
const char *macroToString() { return "FOO"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"FOO\00"
define i8* @macroToString() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"FOO\00"
define i8* @macroToString() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void *t_fun(void *arg) {
  foo();
  return NULL;
}


x86 assembly (clang, -O0):
<t_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @t_fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @foo()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @t_fun(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @foo()
ret i8* null
}
/* Type definitions */
struct filter_node {
  int dummy;
};

/* Variables and functions */
char *PrintFilterInternal(struct filter_node *);
char *Filter2Str(struct filter_node *pf) { return (PrintFilterInternal(pf)); }


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

x86 assembly (clang, -O2):
<Filter2Str>:
jmp    1030 <PrintFilterInternal@plt>

LLVM IR (-O0):
%struct.filter_node = type { i32 }
define i8* @Filter2Str(%struct.filter_node* %0) {
%2 = alloca %struct.filter_node*
store %struct.filter_node* %0, %struct.filter_node** %2
%3 = load %struct.filter_node*, %struct.filter_node** %2
%4 = call i8* @PrintFilterInternal(%struct.filter_node* %3)
ret i8* %4
}

LLVM IR (-O2):
%struct.filter_node = type { i32 }
define i8* @Filter2Str(%struct.filter_node* %0) {
%2 = tail call i8* @PrintFilterInternal(%struct.filter_node* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
unsigned char *dh_init_private_key(unsigned char *priv, size_t priv_size) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<dh_init_private_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dh_init_private_key>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @dh_init_private_key(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @dh_init_private_key(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i8* null
}
void empty_function(void) {}


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

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

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

LLVM IR (-O2):
define void @empty_function() {
ret void
}
int test_imm_CBint16_mem(short *val) {
  return ((*val) & (-0xCB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CBint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -203
%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_CBint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -203
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_43uint16_mem(unsigned short *val) {
  return ((*val) & (0x43 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_43uint16_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, 67
%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_43uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 67
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int nota_valida(int nota, char *msg_error) {
  if (nota < 0 || nota > 10) {
    printf("%s", msg_error);
    puts("");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<nota_valida>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1143 <nota_valida+0x23>
cmpl   $0xa,-0x8(%rbp)
jle    116b <nota_valida+0x4b>
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1172 <nota_valida+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nota_valida>:
mov    $0x1,%eax
cmp    $0xb,%edi
jb     1147 <nota_valida+0x27>
push   %rax
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @nota_valida(i32 %0, i8* %1) {
%3 = icmp ugt i32 %0, 10
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @putchar(i32 10)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add_ecc(int /*<<< orphan*/ *);
int /*<<< orphan*/ add_edc(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ add_header(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void convert_track_mode_1_2048(uint8_t *sector, uint32_t adr) {
  add_header(sector, adr, 1);
  add_edc(sector, 16 + 2048, sector + 2064);
  memset(sector + 2068, 0, 8);
  add_ecc(sector);
}


x86 assembly (clang, -O0):
<convert_track_mode_1_2048>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1040 <add_header@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
add    $0x2040,%rdx
mov    $0x810,%esi
call   1030 <add_edc@plt>
mov    -0x8(%rbp),%rdi
add    $0x2050,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1060 <add_ecc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_track_mode_1_2048>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edx
call   1040 <add_header@plt>
lea    0x2040(%rbx),%rdx
mov    %rbx,%rdi
mov    $0x810,%esi
call   1030 <add_edc@plt>
lea    0x2050(%rbx),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <add_ecc@plt>

LLVM IR (-O0):
define void @convert_track_mode_1_2048(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @add_header(i32* %5, i32 %6, i32 1)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 2064
%11 = call i32 @add_edc(i32* %8, i32 2064, i32* %10)
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 2068
%14 = call i32 @memset(i32* %13, i32 0, i32 8)
%15 = load i32*, i32** %3
%16 = call i32 @add_ecc(i32* %15)
ret void
}

LLVM IR (-O2):
define void @convert_track_mode_1_2048(i32* %0, i32 %1) {
%3 = tail call i32 @add_header(i32* %0, i32 %1, i32 1)
%4 = getelementptr inbounds i32, i32* %0, i64 2064
%5 = tail call i32 @add_edc(i32* %0, i32 2064, i32* %4)
%6 = getelementptr inbounds i32, i32* %0, i64 2068
%7 = tail call i32 @memset(i32* %6, i32 0, i32 8)
%8 = tail call i32 @add_ecc(i32* %0)
ret void
}
int stack_list_full(struct Stack *s) {}


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

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

LLVM IR (-O0):
%struct.Stack = type opaque
define i32 @stack_list_full(%struct.Stack* %0) {
%2 = alloca i32
%3 = alloca %struct.Stack*
store %struct.Stack* %0, %struct.Stack** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.Stack = type opaque
define i32 @stack_list_full(%struct.Stack* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func() {
  static int x = 1;
  printf("%d\n", x);
  x *= 2;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2efc(%rip),%eax
shl    $0x1,%eax
mov    %eax,0x2ef3(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mov    0x2f11(%rip),%esi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
shll   0x2eff(%rip)
pop    %rax
ret

LLVM IR (-O0):
@func.x = internal global i32 1
@.str = [4 x i8] c"%d\0A\00"
define void @func() {
%1 = load i32, i32* @func.x
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @func.x
%4 = mul nsw i32 %3, 2
store i32 %4, i32* @func.x
ret void
}

LLVM IR (-O2):
@func.x = internal unnamed_addr global i32 1
@.str = [4 x i8] c"%d\0A\00"
define void @func() {
%1 = load i32, i32* @func.x
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @func.x
%4 = shl nsw i32 %3, 1
store i32 %4, i32* @func.x
ret void
}
int acpi_sleep_proc_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @acpi_sleep_proc_init() {
ret i32 0
}
/* Variables and functions */
void create_stack(size_t size) {}


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

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

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

LLVM IR (-O2):
define void @create_stack(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "usage: %s <ppsdev> [<ppsdev> ...]\n", name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s <ppsdev> [<ppsdev> ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s <ppsdev> [<ppsdev> ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putstr(char const *str) {
  while (*str) {
    ft_putchar(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <ft_putstr+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ft_putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ft_putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call i32 @ft_putchar(i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @ft_putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVIOCGRAB;
int ioctl(int, int /*<<< orphan*/, void *);
int test_grab(int fd) {
  int rc;
  rc = ioctl(fd, EVIOCGRAB, (void *)1);
  if (!rc) {
    ioctl(fd, EVIOCGRAB, (void *)0);
  }
  return rc;
}


x86 assembly (clang, -O0):
<test_grab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1030 <ioctl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1153 <test_grab+0x43>
mov    -0x4(%rbp),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_grab>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ecb(%rip),%r14
mov    (%r14),%esi
mov    $0x1,%edx
call   1030 <ioctl@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113c <test_grab+0x2c>
mov    (%r14),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@EVIOCGRAB = global i32 0
define i32 @test_grab(i32 %0) {
%2 = load i32, i32* @EVIOCGRAB
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i8* inttoptr (i64 1 to i8*))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @EVIOCGRAB
%7 = tail call i32 @ioctl(i32 %0, i32 %6, i8* null)
br label %8
8: ; preds = %5, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ str_len(char const *);
unsigned int subhashb(char const *, int /*<<< orphan*/);
unsigned int subhashs(const char *s) { return subhashb(s, str_len(s)); }


x86 assembly (clang, -O0):
<subhashs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <str_len@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <subhashb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subhashs>:
push   %rbx
mov    %rdi,%rbx
call   1040 <str_len@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <subhashb@plt>

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

LLVM IR (-O2):
define i32 @subhashs(i8* %0) {
%2 = tail call i32 @str_len(i8* %0)
%3 = tail call i32 @subhashb(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ insstr(char *);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_insstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_return(insstr(args[0]));
}


x86 assembly (clang, -O0):
<cmd_insstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    116a <cmd_insstr+0x2a>
jmp    1187 <cmd_insstr+0x47>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <insstr@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_insstr>:
push   %rbx
mov    %rsi,%rbx
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1155 <cmd_insstr+0x15>
pop    %rbx
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    (%rbx),%rdi
call   1060 <insstr@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_insstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %16
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @insstr(i8* %13)
%15 = call i32 @report_return(i32 %14)
br label %16
16: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_insstr(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = load i8*, i8** %1
%8 = tail call i32 @insstr(i8* %7)
%9 = tail call i32 @report_return(i32 %8)
br label %10
10: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x9a() {
  Assert_real((isascii(154) == 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_isascii.c",
              775, ("isascii should be 0 for 0x9a"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9a\00"
define void @t_isascii_0x9a() {
%1 = call i64 @isascii(i32 154)
%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 775, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x9a\00"
define void @t_isascii_0x9a() {
%1 = tail call i64 @isascii(i32 154)
%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 775, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  struct S1 {
    int x;
  } a, *p1 = &a;
  struct S2 {
    long y;
  } b, *p2 = &b;
  p1 = (struct S1 *)p2;
  p2->y = 75;
  if (p1->x != 75)
    return 1;
  unsigned int c, d;
  d = 65536;
  c = (unsigned char)d;
  if (c != 0)
    return 2;
  unsigned char e = -10;
  int f = (signed char)e;
  if (f != -10)
    return 3;
  (void)5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
movq   $0x4b,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x4b,(%rax)
je     1147 <main+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1189 <main+0x89>
movl   $0x10000,-0x28(%rbp)
mov    -0x28(%rbp),%eax
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     116d <main+0x6d>
movl   $0x2,-0x4(%rbp)
jmp    1189 <main+0x89>
movb   $0xf6,-0x29(%rbp)
movsbl -0x29(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmpl   $0xfffffff6,-0x30(%rbp)
je     1189 <main+0x89>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S1 = type { i32 }
%struct.S2 = type { i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.S1
%3 = alloca %struct.S1*
%4 = alloca %struct.S2
%5 = alloca %struct.S2*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32
store i32 0, i32* %1
store %struct.S1* %2, %struct.S1** %3
store %struct.S2* %4, %struct.S2** %5
%10 = load %struct.S2*, %struct.S2** %5
%11 = bitcast %struct.S2* %10 to %struct.S1*
store %struct.S1* %11, %struct.S1** %3
%12 = load %struct.S2*, %struct.S2** %5
%13 = getelementptr inbounds %struct.S2, %struct.S2* %12, i32 0, i32 0
store i64 75, i64* %13
%14 = load %struct.S1*, %struct.S1** %3
%15 = getelementptr inbounds %struct.S1, %struct.S1* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 75
br i1 %17, label %18, label %19
18: ; preds = %0
store i32 1, i32* %1
br label %32
19: ; preds = %0
store i32 65536, i32* %7
%20 = load i32, i32* %7
%21 = trunc i32 %20 to i8
%22 = zext i8 %21 to i32
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 2, i32* %1
br label %32
26: ; preds = %19
store i8 -10, i8* %8
%27 = load i8, i8* %8
%28 = sext i8 %27 to i32
store i32 %28, i32* %9
%29 = load i32, i32* %9
%30 = icmp ne i32 %29, -10
br i1 %30, label %31, label %32
31: ; preds = %26
store i32 3, i32* %1
br label %32
32: ; preds = %18, %25, %31, %26
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
%struct.S1 = type { i32 }
%struct.S2 = type { i64 }
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct timeval {
  float tv_sec;
  float tv_usec;
};

/* Variables and functions */
float delta_msec(struct timeval t0, struct timeval t1) {
  return (t1.tv_sec - t0.tv_sec) * 1000.0f +
         (t1.tv_usec - t0.tv_usec) / 1000.0f;
}


x86 assembly (clang, -O0):
<delta_msec>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movlpd %xmm1,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
movss  0xed6(%rip),%xmm2
divss  %xmm2,%xmm1
movss  0xeca(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_msec>:
subps  %xmm0,%xmm1
movaps %xmm1,%xmm2
shufps $0x55,%xmm1,%xmm2
movss  0xeee(%rip),%xmm0
divss  %xmm0,%xmm2
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { float, float }
define float @delta_msec(<2 x float> %0, <2 x float> %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = bitcast %struct.timeval* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %5
%6 = bitcast %struct.timeval* %4 to <2 x float>*
store <2 x float> %1, <2 x float>* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%13 = load float, float* %12
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%15 = load float, float* %14
%16 = fsub float %13, %15
%17 = fdiv float %16, 1.000000e+03
%18 = call float @llvm.fmuladd.f32(float %11, float 1.000000e+03, float %17)
ret float %18
}

LLVM IR (-O2):
define float @delta_msec(<2 x float> %0, <2 x float> %1) {
%3 = fsub <2 x float> %1, %0
%4 = extractelement <2 x float> %3, i64 0
%5 = fsub <2 x float> %1, %0
%6 = extractelement <2 x float> %5, i64 1
%7 = fdiv float %6, 1.000000e+03
%8 = tail call float @llvm.fmuladd.f32(float %4, float 1.000000e+03, float %7)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void cli_write_prompt(void) { putc('>'); }


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

x86 assembly (clang, -O2):
<cli_write_prompt>:
mov    $0x3e,%edi
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @cli_write_prompt() {
%1 = call i32 @putc(i8 signext 62)
ret void
}

LLVM IR (-O2):
define void @cli_write_prompt() {
%1 = tail call i32 @putc(i8 signext 62)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mainloop_remove_timeout(int);
void timeout_remove(unsigned int id) {
  if (!id)
    return;
  mainloop_remove_timeout((int)id);
}


x86 assembly (clang, -O0):
<timeout_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <timeout_remove+0x1a>
jmp    1132 <timeout_remove+0x22>
mov    -0x4(%rbp),%edi
call   1030 <mainloop_remove_timeout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeout_remove>:
test   %edi,%edi
je     1119 <timeout_remove+0x9>
jmp    1030 <mainloop_remove_timeout@plt>
ret

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

LLVM IR (-O2):
define void @timeout_remove(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @mainloop_remove_timeout(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int);
int main() {
  baz(2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @baz(i32 2)
ret i32 0
}
/* Variables and functions */
int errno;
int symlink(char const *, char const *);
void symlink_f_(const char *name1, const char *name2, int *ierr) {
  if (*ierr = symlink(name1, name2))
    *ierr = errno;
}


x86 assembly (clang, -O0):
<symlink_f_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <symlink@plt>
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     114f <symlink_f_+0x3f>
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symlink_f_>:
push   %rbx
mov    %rdx,%rbx
call   1030 <symlink@plt>
mov    %eax,(%rbx)
test   %eax,%eax
je     112a <symlink_f_+0x1a>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define void @symlink_f_(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @symlink(i8* %0, i8* %1)
store i32 %4, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = load i32, i32* @errno
store i32 %7, i32* %2
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_132() {
  Assert_real((isqrt(132) == 11),
              "/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",
              665, ("Integer square root of 132 should be 11"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_132>:
push   %rax
mov    $0x84,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x299,%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 132 should be 11\00"
define void @t_sqrt_132() {
%1 = call i32 @isqrt(i32 132)
%2 = icmp eq i32 %1, 11
%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 665, 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 132 should be 11\00"
define void @t_sqrt_132() {
%1 = tail call i32 @isqrt(i32 132)
%2 = icmp eq i32 %1, 11
%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 665, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *strcpy(uint8_t *destination, const uint8_t *source) {
  uint8_t *retp = destination;
  do {
    *destination++ = *source;
  } while (*source++ != '\0');
  return retp;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
cmpl   $0x0,(%rax)
jne    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsi,%rcx,1),%edx
mov    %edx,(%rax,%rcx,1)
cmpl   $0x0,(%rsi,%rcx,1)
lea    0x4(%rcx),%rcx
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i32* @strcpy(i32* returned writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %1, %2 ], [ %8, %3 ]
%5 = phi i32* [ %0, %2 ], [ %7, %3 ]
%6 = load i32, i32* %4
%7 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %6, i32* %5
%8 = getelementptr inbounds i32, i32* %4, i64 1
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32* %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t is_esi_inuse(uint32_t bitmap) { return (bitmap & (0x1 << 5)); }


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

x86 assembly (clang, -O2):
<is_esi_inuse>:
mov    %edi,%eax
and    $0x20,%eax
ret

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

LLVM IR (-O2):
define i32 @is_esi_inuse(i32 %0) {
%2 = and i32 %0, 32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int list[], int size) {
  for (int i = 0; i < size; i++)
    printf("%d ", list[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
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    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

x86 assembly (clang, -O2):
<a>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"a\00"
define i32 @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 undef
}