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

/* Variables and functions */
void EPIIntErrorClear(uint32_t ui32Base, uint32_t ui32ErrFlags) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000021C))) = ui32ErrFlags;
}


x86 assembly (clang, -O0):
<EPIIntErrorClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x21c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntErrorClear>:
mov    %rsi,0x21c(%rdi)
ret

LLVM IR (-O0):
define void @EPIIntErrorClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 540
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIIntErrorClear(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 540
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
size_t rev_addr_hashset_index(void *data_block) {
  return (size_t)data_block / (size_t)(16 * 4 * 1024);
}


x86 assembly (clang, -O0):
<rev_addr_hashset_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_addr_hashset_index>:
mov    %rdi,%rax
shr    $0x10,%rax
ret

LLVM IR (-O0):
define i64 @rev_addr_hashset_index(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = udiv i64 %4, 65536
ret i64 %5
}

LLVM IR (-O2):
define i64 @rev_addr_hashset_index(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 16
ret i64 %3
}
/* Variables and functions */
scalar_t__ DeleteFile(char const *);
int wbt_delete_file(const char *name) {
  if (DeleteFile(name)) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<wbt_delete_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <DeleteFile@plt>
cmp    $0x0,%rax
je     113b <wbt_delete_file+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <wbt_delete_file+0x32>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wbt_delete_file>:
push   %rax
call   1030 <DeleteFile@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wbt_delete_file(i8* %0) {
%2 = tail call i64 @DeleteFile(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
int __BNF_str_flush(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__BNF_str_flush() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void int_handler(int signo) {
  if (signo == SIGINT) {
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    113b <int_handler+0x2b>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
je     111e <int_handler+0xe>
pop    %rax
ret
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@EXIT_SUCCESS = global i32 0
define void @int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@EXIT_SUCCESS = global i32 0
define void @int_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
char get_chr_crsr(int /*<<< orphan*/);
char get_chr_mnr_crsr(void) { return get_chr_crsr(0); }


x86 assembly (clang, -O0):
<get_chr_mnr_crsr>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <get_chr_crsr@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_chr_mnr_crsr>:
xor    %edi,%edi
jmp    1030 <get_chr_crsr@plt>

LLVM IR (-O0):
define signext i8 @get_chr_mnr_crsr() {
%1 = call signext i8 @get_chr_crsr(i32 0)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @get_chr_mnr_crsr() {
%1 = tail call signext i8 @get_chr_crsr(i32 0)
ret i8 %1
}
/* Variables and functions */
int xbee_setuplogAPI(char *, int, int /*<<< orphan*/, char, int);
int xbee_setupAPI(char *path, int baudrate, char cmdSeq, int cmdTime) {
  return xbee_setuplogAPI(path, baudrate, 0, cmdSeq, cmdTime);
}


x86 assembly (clang, -O0):
<xbee_setupAPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xd(%rbp),%al
mov    -0x14(%rbp),%r8d
xor    %edx,%edx
movsbl %al,%ecx
call   1030 <xbee_setuplogAPI@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xbee_setupAPI>:
mov    %ecx,%r8d
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <xbee_setuplogAPI@plt>

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

LLVM IR (-O2):
define i32 @xbee_setupAPI(i8* %0, i32 %1, i8 signext %2, i32 %3) {
%5 = tail call i32 @xbee_setuplogAPI(i8* %0, i32 %1, i32 0, i8 signext %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
scalar_t__ param_get(char *, char *, char *, int *);
int iatom(char *conf_name, char *atom_name) {
  int val, i_atom;
  if (param_get("IATOM", conf_name, atom_name, &val) < 0) {
    return -1;
  } else {
    return val;
  }
}


x86 assembly (clang, -O0):
<iatom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rdi
lea    -0x1c(%rbp),%rcx
call   1030 <param_get@plt>
cmp    $0x0,%rax
jge    114e <iatom+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <iatom+0x44>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iatom>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rcx
call   1030 <param_get@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1139 <iatom+0x29>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"IATOM\00"
define i32 @iatom(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @param_get(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32* %3)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %3
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
int /*<<< orphan*/ pmu_set_adc_period(int);
void pmu_set_clk_init() {
  pmu_reg_write(0x05, ((0 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                       (0 << 9) | (0 << 8) | (0 << 7) | (47)));
  pmu_reg_write(0x05, ((1 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                       (1 << 9) | (0 << 8) | (1 << 7) | (47)));
  pmu_set_adc_period(1);
}


x86 assembly (clang, -O0):
<pmu_set_clk_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x82f,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x5,%edi
mov    $0x2aaf,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x1,%edi
call   1040 <pmu_set_adc_period@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_clk_init>:
push   %rax
mov    $0x5,%edi
mov    $0x82f,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x5,%edi
mov    $0x2aaf,%esi
call   1030 <pmu_reg_write@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <pmu_set_adc_period@plt>

LLVM IR (-O0):
define void @pmu_set_clk_init() {
%1 = call i32 @pmu_reg_write(i32 5, i32 2095)
%2 = call i32 @pmu_reg_write(i32 5, i32 10927)
%3 = call i32 @pmu_set_adc_period(i32 1)
ret void
}

LLVM IR (-O2):
define void @pmu_set_clk_init() {
%1 = tail call i32 @pmu_reg_write(i32 5, i32 2095)
%2 = tail call i32 @pmu_reg_write(i32 5, i32 10927)
%3 = tail call i32 @pmu_set_adc_period(i32 1)
ret void
}
/* Variables and functions */
int car(int *);
int cdr(int *);
float divideApply(void *functionOne, void *functionTwo, int *pairOfInts) {
  int (*lambda_1)(int);
  int (*lambda_2)(int);
  lambda_1 = functionOne;
  lambda_2 = functionTwo;
  return ((float)(lambda_1(car(pairOfInts)))) / (lambda_2(cdr(pairOfInts)));
}


x86 assembly (clang, -O0):
<divideApply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <car@plt>
mov    %eax,%edi
mov    -0x40(%rbp),%rax
call   *%rax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <cdr@plt>
mov    %eax,%edi
mov    -0x38(%rbp),%rax
call   *%rax
movss  -0x2c(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divideApply>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <car@plt>
mov    %eax,%edi
call   *%r15
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <cdr@plt>
mov    %eax,%edi
call   *%r14
cvtsi2ss %eax,%xmm1
movss  0xc(%rsp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @divideApply(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32 (i32)*
%8 = alloca i32 (i32)*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32 (i32)*
store i32 (i32)* %10, i32 (i32)** %7
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32 (i32)*
store i32 (i32)* %12, i32 (i32)** %8
%13 = load i32 (i32)*, i32 (i32)** %7
%14 = load i32*, i32** %6
%15 = call i32 @car(i32* %14)
%16 = call i32 %13(i32 %15)
%17 = sitofp i32 %16 to float
%18 = load i32 (i32)*, i32 (i32)** %8
%19 = load i32*, i32** %6
%20 = call i32 @cdr(i32* %19)
%21 = call i32 %18(i32 %20)
%22 = sitofp i32 %21 to float
%23 = fdiv float %17, %22
ret float %23
}

LLVM IR (-O2):
define float @divideApply(i8* nocapture %0, i8* nocapture %1, i32* %2) {
%4 = bitcast i8* %0 to i32 (i32)*
%5 = bitcast i8* %1 to i32 (i32)*
%6 = tail call i32 @car(i32* %2)
%7 = tail call i32 %4(i32 %6)
%8 = sitofp i32 %7 to float
%9 = tail call i32 @cdr(i32* %2)
%10 = tail call i32 %5(i32 %9)
%11 = sitofp i32 %10 to float
%12 = fdiv float %8, %11
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void help_text(char *cmd) {
  char *help_str =
      "Usage:\n\t%s [options] [file]\n\nfile\t\tfile to read the puzzle from "
      "[default=STDIN]\n\n-s, --show\tshow the solution\n-s2, --show2\tshow "
      "the solution with every character doubled\n-p, --print\tprint the "
      "mosaic before solving\n--help\t\tshow this help\n";
  printf(help_str, cmd);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<help_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help_text>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [238 x i8] c"Usage:\0A\09%s [options] [file]\0A\0Afile\09\09file to read the puzzle from [default=STDIN]\0A\0A-s, --show\09show the solution\0A-s2, --show2\09show the solution with every character doubled\0A-p, --print\09print the mosaic before solving\0A--help\09\09show this help\0A\00"
@EXIT_SUCCESS = global i32 0
define void @help_text(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* %4, i8* %5)
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [238 x i8] c"Usage:\0A\09%s [options] [file]\0A\0Afile\09\09file to read the puzzle from [default=STDIN]\0A\0A-s, --show\09show the solution\0A-s2, --show2\09show the solution with every character doubled\0A-p, --print\09print the mosaic before solving\0A--help\09\09show this help\0A\00"
@EXIT_SUCCESS = global i32 0
define void @help_text(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solve_by_standard_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(16, &number_of_tasks, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_standard_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x10,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_by_standard_homotopy_continuation>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x10,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solve_by_standard_homotopy_continuation(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 16, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @solve_by_standard_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 16, i32* %2, i32* undef, double* undef)
ret i32 %3
}
int ascii_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    c |= 0x20;
  return c;
}


x86 assembly (clang, -O0):
<ascii_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <ascii_tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <ascii_tolower+0x24>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_tolower>:
lea    -0x41(%rdi),%ecx
mov    %edi,%eax
or     $0x20,%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ascii_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = or i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ascii_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xf2() {
  Assert_real((islower(242) == 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_islower.c",
              1215, ("islower should be 0 for 0xf2"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xf2>:
push   %rax
mov    $0xf2,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4bf,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xf2\00"
define void @t_islower_0xf2() {
%1 = call i64 @islower(i32 242)
%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 1215, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xf2\00"
define void @t_islower_0xf2() {
%1 = tail call i64 @islower(i32 242)
%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 1215, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *ft_strnew(size_t size) {
  size_t i;
  char *str;
  i = 0;
  str = NULL;
  str = (char *)malloc(sizeof(char) * size);
  if (str == NULL)
    return (NULL);
  while (i < size) {
    str[i] = '\0';
    i++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1157 <ft_strnew+0x47>
movq   $0x0,-0x8(%rbp)
jmp    118f <ft_strnew+0x7f>
jmp    115c <ft_strnew+0x4c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1187 <ft_strnew+0x77>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    115c <ft_strnew+0x4c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
test   %rax,%rax
je     1148 <ft_strnew+0x28>
mov    %rax,%rbx
test   %r14,%r14
je     114a <ft_strnew+0x2a>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
jmp    114a <ft_strnew+0x2a>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strnew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 0, i64* %4
store i8* null, i8** %5
%6 = load i64, i64* %3
%7 = mul i64 1, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %1
store i8* null, i8** %2
br label %27
14: ; preds = %1
br label %15
15: ; preds = %19, %14
%16 = load i64, i64* %4
%17 = load i64, i64* %3
%18 = icmp ult i64 %16, %17
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i8*, i8** %5
%21 = load i64, i64* %4
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8 0, i8* %22
%23 = load i64, i64* %4
%24 = add i64 %23, 1
store i64 %24, i64* %4
br label %15
25: ; preds = %15
%26 = load i8*, i8** %5
store i8* %26, i8** %2
br label %27
27: ; preds = %25, %13
%28 = load i8*, i8** %2
ret i8* %28
}

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = icmp eq i64 %0, 0
br i1 %7, label %9, label %8
8: ; preds = %6
br label %9
9: ; preds = %8, %6, %1
%10 = phi i8* [ null, %1 ], [ %4, %6 ], [ %4, %8 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_215() {
  Assert_real((isqrt(215) == 14),
              "/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",
              1080, ("Integer square root of 215 should be 14"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_215>:
push   %rax
mov    $0xd7,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x438,%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 215 should be 14\00"
define void @t_sqrt_215() {
%1 = call i32 @isqrt(i32 215)
%2 = icmp eq i32 %1, 14
%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 1080, 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 215 should be 14\00"
define void @t_sqrt_215() {
%1 = tail call i32 @isqrt(i32 215)
%2 = icmp eq i32 %1, 14
%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 1080, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Fuck you Mendez.\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 = [18 x i8] c"Fuck you Mendez.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Fuck you Mendez.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_ptr_mm(int /*<<< orphan*/);
void xor_by_ptr_mm(uint32_t x) {
  by_ptr_mm(x);
  xor();
}


x86 assembly (clang, -O0):
<xor_by_ptr_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <by_ptr_mm@plt>
mov    $0x0,%al
call   1030 <xor@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @xor_by_ptr_mm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr_mm(i32 %3)
%5 = call i32 (...) @xor()
ret void
}

LLVM IR (-O2):
define void @xor_by_ptr_mm(i32 %0) {
%2 = tail call i32 @by_ptr_mm(i32 %0)
%3 = tail call i32 (...) @xor()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *strcpy(char *, char const *);
int strlen(char const *);
char *ath_strdup(const char *in) {
  char *out = (char *)malloc((1 + strlen(in)) * sizeof(char));
  if (out == NULL) {
    return NULL;
  }
  return strcpy(out, in);
}


x86 assembly (clang, -O0):
<ath_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1171 <ath_strdup+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1182 <ath_strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ath_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1159 <ath_strdup+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115b <ath_strdup+0x2b>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ath_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = inttoptr i64 %4 to i8*
%8 = tail call i8* @strcpy(i8* %7, i8* dereferenceable(1) %0)
br label %9
9: ; preds = %1, %6
%10 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int strlen(char *);
void append(char s[], char n) {
  int len = strlen(s);
  s[len] = n;
  s[len + 1] = '\0';
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @append(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @append(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = add nsw i32 %3, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
void __attribute__((cdecl)) ctest0() {}


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

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

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

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

/* Variables and functions */
int32_t FixedToInt(int32_t val) { return val >> 12; }


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

x86 assembly (clang, -O2):
<FixedToInt>:
mov    %edi,%eax
sar    $0xc,%eax
ret

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

LLVM IR (-O2):
define i32 @FixedToInt(i32 %0) {
%2 = ashr i32 %0, 12
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int hour, sum;
  scanf("%d", &hour);
  if (hour <= 40) {
    sum = hour * 20;
  } else {
    sum = 20 * 40 + (hour - 40) * 30;
  }
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x28,-0x8(%rbp)
jg     1155 <main+0x35>
imul   $0x14,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <main+0x46>
mov    -0x8(%rbp),%eax
sub    $0x28,%eax
imul   $0x1e,%eax,%eax
add    $0x320,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    0x0(,%rax,4),%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
sub    %eax,%edx
add    $0xfffffe70,%edx
cmp    $0x29,%eax
lea    (%rcx,%rcx,4),%esi
cmovge %edx,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 41
%6 = mul nsw i32 %4, 20
%7 = mul i32 %4, 30
%8 = add i32 %7, -400
%9 = select i1 %5, i32 %6, i32 %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
int ar_cnt_get(int my_cid, int cnt) {}


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

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

LLVM IR (-O0):
define i32 @ar_cnt_get(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @ar_cnt_get(i32 %0, i32 %1) {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ button;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned get_XEvent_xbutton_button(void *_p) {
  return (unsigned)((XEvent *)_p)->xbutton.button;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xbutton_button>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define i32 @get_XEvent_xbutton_button(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEvent_xbutton_button(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(4, "DONE!\n", 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
lea    0xed5(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x4,%edi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"DONE!\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
int test_imm_ADuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xAD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ADuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xad,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ADuint64_midword_reg>:
test   $0xad0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ADuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11337728
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char toupper(char);
char *strupr(char *s) {
  char *p = s;
  while (*p = toupper(*p))
    p++;
  return s;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114f <strupr+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupr+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @toupper(i8 signext %4)
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %0
}
int test_imm_01uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x01 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_01uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_01uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 1
%7 = icmp ne i64 %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_01uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 65536
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void store_head_SL(void) {
  glPushMatrix();
  glTranslatef(0.0, 0.8 + 0.2, 0.0);
  glScalef(0.2, 0.2, 0.08);
  glutSolidSphere(1.0, 10, 10);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<store_head_SL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
xorps  %xmm2,%xmm2
movsd  0xe9a(%rip),%xmm1
movaps %xmm2,%xmm0
call   1070 <glTranslatef@plt>
movsd  0xe92(%rip),%xmm1
movsd  0xe92(%rip),%xmm2
movaps %xmm1,%xmm0
call   1040 <glScalef@plt>
movsd  0xe72(%rip),%xmm0
mov    $0xa,%esi
mov    %esi,%edi
call   1060 <glutSolidSphere@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_head_SL>:
push   %rax
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
movsd  0xea0(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1070 <glTranslatef@plt>
movsd  0xe95(%rip),%xmm0
movsd  0xe95(%rip),%xmm2
movaps %xmm0,%xmm1
call   1040 <glScalef@plt>
movsd  0xe75(%rip),%xmm0
mov    $0xa,%edi
mov    $0xa,%esi
call   1060 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @store_head_SL() {
%1 = call i32 (...) @glPushMatrix()
%2 = call i32 @glTranslatef(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%3 = call i32 @glScalef(double 2.000000e-01, double 2.000000e-01, double 8.000000e-02)
%4 = call i32 @glutSolidSphere(double 1.000000e+00, i32 10, i32 10)
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @store_head_SL() {
%1 = tail call i32 (...) @glPushMatrix()
%2 = tail call i32 @glTranslatef(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%3 = tail call i32 @glScalef(double 2.000000e-01, double 2.000000e-01, double 8.000000e-02)
%4 = tail call i32 @glutSolidSphere(double 1.000000e+00, i32 10, i32 10)
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
int ptr_value(const int *p) { return *p; }


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

x86 assembly (clang, -O2):
<ptr_value>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ptr_value(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
struct lxt2_wr_trace {
  int dummy;
};

/* Variables and functions */
int lxt2_wr_emit_u8z(struct lxt2_wr_trace *, char);
int lxt2_wr_emit_stringz(struct lxt2_wr_trace *lt, char *value) {
  int rc = 1;
  do {
    rc &= lxt2_wr_emit_u8z(lt, *value);
  } while (*(value++));
  return (rc);
}


x86 assembly (clang, -O0):
<lxt2_wr_emit_stringz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <lxt2_wr_emit_u8z@plt>
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1127 <lxt2_wr_emit_stringz+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lxt2_wr_emit_stringz>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x1,%ebp
nop
movsbl (%rbx),%esi
mov    %r14,%rdi
call   1030 <lxt2_wr_emit_u8z@plt>
and    %eax,%ebp
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <lxt2_wr_emit_stringz+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.lxt2_wr_trace = type { i32 }
define i32 @lxt2_wr_emit_stringz(%struct.lxt2_wr_trace* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = phi i32 [ 1, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
%7 = tail call i32 @lxt2_wr_emit_u8z(%struct.lxt2_wr_trace* %0, i8 signext %6)
%8 = and i32 %7, %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ get_all_grid_addresses(int **, int const *);
void kgd_get_all_grid_addresses(int grid_address[][3], const int mesh[3]) {
  get_all_grid_addresses(grid_address, mesh);
}


x86 assembly (clang, -O0):
<kgd_get_all_grid_addresses>:
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   1030 <get_all_grid_addresses@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kgd_get_all_grid_addresses>:
jmp    1030 <get_all_grid_addresses@plt>

LLVM IR (-O0):
define void @kgd_get_all_grid_addresses([3 x i32]* %0, i32* %1) {
%3 = alloca [3 x i32]*
%4 = alloca i32*
store [3 x i32]* %0, [3 x i32]** %3
store i32* %1, i32** %4
%5 = load [3 x i32]*, [3 x i32]** %3
%6 = bitcast [3 x i32]* %5 to i32**
%7 = load i32*, i32** %4
%8 = call i32 @get_all_grid_addresses(i32** %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @kgd_get_all_grid_addresses([3 x i32]* %0, i32* %1) {
%3 = bitcast [3 x i32]* %0 to i32**
%4 = tail call i32 @get_all_grid_addresses(i32** %3, i32* %1)
ret void
}
/* Variables and functions */
scalar_t__ OPENSSL_init_crypto(int /*<<< orphan*/, int /*<<< orphan*/ *);
scalar_t__ ossl_store_file_loader_init();
int do_store_init(void) {
  return OPENSSL_init_crypto(0, NULL) && ossl_store_file_loader_init();
}


x86 assembly (clang, -O0):
<do_store_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <OPENSSL_init_crypto@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1156 <do_store_init+0x36>
mov    $0x0,%al
call   1030 <ossl_store_file_loader_init@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_store_init>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <OPENSSL_init_crypto@plt>
test   %rax,%rax
je     1140 <do_store_init+0x20>
xor    %eax,%eax
call   1030 <ossl_store_file_loader_init@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @do_store_init() {
%1 = call i64 @OPENSSL_init_crypto(i32 0, i32* null)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 (...) @ossl_store_file_loader_init()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @do_store_init() {
%1 = tail call i64 @OPENSSL_init_crypto(i32 0, i32* null)
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @ossl_store_file_loader_init()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}