xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char digit2lowcase_hex(unsigned char digit) {
  assert(digit < 16);
  return "0123456789abcdef"[digit];
}


x86 assembly (clang, -O0):
<digit2lowcase_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x10,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
lea    0xec1(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit2lowcase_hex>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x10,%bl
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
lea    0xed6(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define signext i8 @digit2lowcase_hex(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp slt i32 %4, 16
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8, i8* %2
%9 = zext i8 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %9
%11 = load i8, i8* %10
ret i8 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define signext i8 @digit2lowcase_hex(i8 zeroext %0) {
%2 = icmp ult i8 %0, 16
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = zext i8 %0 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: %s <file>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float __nv_fast_log2f(float);
float __log2f(float __a) { return __nv_fast_log2f(__a); }


x86 assembly (clang, -O0):
<__log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_fast_log2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__log2f>:
jmp    1030 <__nv_fast_log2f@plt>

LLVM IR (-O0):
define float @__log2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__nv_fast_log2f(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__log2f(float %0) {
%2 = tail call float @__nv_fast_log2f(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ call_me_from_thumb();
void call_me_from_arm(void) { call_me_from_thumb(); }


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

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

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

LLVM IR (-O2):
define void @call_me_from_arm() {
%1 = tail call i32 (...) @call_me_from_thumb()
ret void
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_left() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_LEFT"
                                             : "INPUT_KEYB_LEFT");
}


x86 assembly (clang, -O0):
<f_input_left>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xeda(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_left>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xedd(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"INPUT_JOY_LEFT\00"
@.str.1 = [16 x i8] c"INPUT_KEYB_LEFT\00"
define i8* @f_input_left() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [15 x i8] c"INPUT_JOY_LEFT\00"
@.str.1 = [16 x i8] c"INPUT_KEYB_LEFT\00"
define i8* @f_input_left() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void hi() { puts("Hello, World!"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define void @hi() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define void @hi() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc12(int status, void *arg) {
  printf("Executing exitfunc"
         "12"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc12>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Executing exitfunc12 (status=%d, arg=%lu)\0A\00"
define void @exitfunc12(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 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"Executing exitfunc12 (status=%d, arg=%lu)\0A\00"
define void @exitfunc12(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
int perfect_hash(int n) { return (n ^ 28) % 13; }


x86 assembly (clang, -O0):
<perfect_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1c,%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perfect_hash>:
xor    $0x1c,%edi
movslq %edi,%rax
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @perfect_hash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 28
%5 = srem i32 %4, 13
ret i32 %5
}

LLVM IR (-O2):
define i32 @perfect_hash(i32 %0) {
%2 = xor i32 %0, 28
%3 = srem i32 %2, 13
ret i32 %3
}
void hdel(int (**e)[2]) {
  for (int i = 0; i < 1024; i++)
    free(e[i]);
  free(e);
}


x86 assembly (clang, -O0):
<hdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    114f <hdel+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <hdel+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdel>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1120 <hdel+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @hdel([2 x i32]** nocapture %0) {
br label %4
2: ; preds = %4
%3 = bitcast [2 x i32]** %0 to i8*
tail call void @free(i8* %3)
ret void
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %9, %4 ]
%6 = getelementptr inbounds [2 x i32]*, [2 x i32]** %0, i64 %5
%7 = bitcast [2 x i32]** %6 to i8**
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 1024
br i1 %10, label %2, label %4
}
void termop_report(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      411, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x19b,%r8d
lea    0xf37(%rip),%r9
lea    0xf3e(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_report>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf65(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x19b,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_report = [14 x i8] c"termop_report\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_report(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 411, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.termop_report, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_report = [14 x i8] c"termop_report\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_report(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 411, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.termop_report, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
void testFuncCompOpti1(void) {
  int a = 1U;
  int b = 2U;
}


x86 assembly (clang, -O0):
<testFuncCompOpti1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @testFuncCompOpti1() {
ret void
}
unsigned usum2(unsigned a, unsigned b) { return a + b; }


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

x86 assembly (clang, -O2):
<usum2>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @usum2(i32 %0, i32 %1) {
%3 = add i32 %1, %0
ret i32 %3
}
void hardware_init() {}


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

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

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

LLVM IR (-O2):
define void @hardware_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void my_signal_fun(int signum) {
  static int cnt = 0;
  printf("signal = %d, %d times\n", signum, ++cnt);
}


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

x86 assembly (clang, -O2):
<my_signal_fun>:
mov    %edi,%esi
mov    0x2f14(%rip),%edx
add    $0x1,%edx
mov    %edx,0x2f0b(%rip)
lea    0xed8(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@my_signal_fun.cnt = internal unnamed_addr global i32 0
@.str = [23 x i8] c"signal = %d, %d times\0A\00"
define void @my_signal_fun(i32 %0) {
%2 = load i32, i32* @my_signal_fun.cnt
%3 = add nsw i32 %2, 1
store i32 %3, i32* @my_signal_fun.cnt
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3)
ret void
}
int overflow(int a, int b) {
  return (a > 0 && b > 0 && a + b <= 0) || (a < 0 && b < 0 && a + b >= 0);
}


x86 assembly (clang, -O0):
<overflow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1132 <overflow+0x32>
cmpl   $0x0,-0x8(%rbp)
jle    1132 <overflow+0x32>
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jle    1165 <overflow+0x65>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xa(%rbp)
jge    115f <overflow+0x5f>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
jge    115f <overflow+0x5f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
setge  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<overflow>:
lea    (%rsi,%rdi,1),%ecx
test   %edi,%edi
jle    1115 <overflow+0x15>
test   %esi,%esi
jle    1115 <overflow+0x15>
mov    $0x1,%eax
test   %ecx,%ecx
jg     1115 <overflow+0x15>
ret
xor    %eax,%eax
test   %edi,%esi
jns    1114 <overflow+0x14>
not    %ecx
shr    $0x1f,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @overflow(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
%14 = icmp sle i32 %13, 0
br i1 %14, label %28, label %15
15: ; preds = %10, %7, %2
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %22, %23
%25 = icmp sge i32 %24, 0
br label %26
26: ; preds = %21, %18, %15
%27 = phi i1 [ false, %18 ], [ false, %15 ], [ %25, %21 ]
br label %28
28: ; preds = %26, %10
%29 = phi i1 [ true, %10 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @overflow(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = add nsw i32 %1, %0
%7 = icmp slt i32 %6, 1
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = and i32 %1, %0
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = xor i32 %6, -1
%14 = lshr i32 %13, 31
br label %15
15: ; preds = %2, %9, %12
%16 = phi i32 [ 0, %9 ], [ %14, %12 ], [ 1, %2 ]
ret i32 %16
}
int test_imm_93uint16_reg(unsigned short val) {
  return ((val) & (-0x93 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_93uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff6d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_93uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -147
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned long long _strtoxl(char const *, char **, int, int /*<<< orphan*/);
unsigned long long int strtoull(const char *nptr, char **endptr, int base) {
  return _strtoxl(nptr, endptr, base, 0);
}


x86 assembly (clang, -O0):
<strtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <_strtoxl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoull>:
xor    %ecx,%ecx
jmp    1030 <_strtoxl@plt>

LLVM IR (-O0):
define i64 @strtoull(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 = load i32, i32* %6
%10 = call i64 @_strtoxl(i8* %7, i8** %8, i32 %9, i32 0)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @_strtoxl(i8* %0, i8** %1, i32 %2, i32 0)
ret i64 %4
}
void handle_TSTP(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_TSTP(i32 %0) {
ret void
}
int __lngLessThan0(unsigned short l[2]) {
  return l[1] > (unsigned short)-1 / 2;
}


x86 assembly (clang, -O0):
<__lngLessThan0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%eax
cmp    $0x7fff,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lngLessThan0>:
movzwl 0x2(%rdi),%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @__lngLessThan0(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 1
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = icmp sgt i32 %6, 32767
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__lngLessThan0(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 1
%3 = load i16, i16* %2
%4 = lshr i16 %3, 15
%5 = zext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Sum = %d", add(328, 4238));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x148,%edi
mov    $0x108e,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Sum = %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @add(i32 328, i32 4238)
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Sum = %d\00"
define i32 @main() {
%1 = tail call i32 @add(i32 328, i32 4238)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: fixdep <depfile> <target> <cmdline>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: fixdep <depfile> <target> <cmdline>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: fixdep <depfile> <target> <cmdline>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int f246(int *);
int f247(int *p) { return f246(p); }


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

x86 assembly (clang, -O2):
<f247>:
jmp    1030 <f246@plt>

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

LLVM IR (-O2):
define i32 @f247(i32* %0) {
%2 = tail call i32 @f246(i32* %0)
ret i32 %2
}
void defMiddle() {
  enum __attribute__((deprecated(""))) T *p0;
  enum __attribute__((aligned(16))) T { E0, E1 } * p1;
  enum T *p2;
}


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

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

LLVM IR (-O0):
define void @defMiddle() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
ret void
}

LLVM IR (-O2):
define void @defMiddle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x30() {
  Assert_real((isupper(48) == 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_isupper.c",
              245, ("isupper should be 0 for 0"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x30>:
push   %rax
mov    $0x30,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf5,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 0\00"
define void @t_isupper_0x30() {
%1 = call i64 @isupper(i32 48)
%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 245, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 0\00"
define void @t_isupper_0x30() {
%1 = tail call i64 @isupper(i32 48)
%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 245, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic0() { panic(1); }


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

x86 assembly (clang, -O2):
<panic0>:
mov    $0x1,%edi
jmp    1030 <panic@plt>

LLVM IR (-O0):
define void @panic0() {
%1 = call i32 @panic(i32 1)
ret void
}

LLVM IR (-O2):
define void @panic0() {
%1 = tail call i32 @panic(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void traceCallback(void *NotUsed, const char *zMsg) {
  printf("TRACE: %s\n", zMsg);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<traceCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traceCallback>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"TRACE: %s\0A\00"
@stdout = global i32 0
define void @traceCallback(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"TRACE: %s\0A\00"
@stdout = global i32 0
define void @traceCallback(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add(char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *a = (char *)malloc(50 * sizeof(char));
  char *b = (char *)malloc(50 * sizeof(char));
  scanf("%s", a);
  scanf("%s", b);
  printf("\n");
  add(a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x32,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x32,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1060 <scanf@plt>
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <add@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x32,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    $0x32,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <add@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 50)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = call i64 @malloc(i32 50)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = call i32 @add(i8* %13, i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 50)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @malloc(i32 50)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @add(i8* %2, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int inc_and_wrap_index(unsigned int index, unsigned int max) {
  assert(index <= max);
  return index + 1 >= max ? 0 : index + 1;
}


x86 assembly (clang, -O0):
<inc_and_wrap_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jb     114a <inc_and_wrap_index+0x3a>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <inc_and_wrap_index+0x43>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_and_wrap_index>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    %esi,%ebp
setbe  %dil
call   1030 <assert@plt>
add    $0x1,%ebp
xor    %eax,%eax
cmp    %ebx,%ebp
cmovb  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inc_and_wrap_index(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 = icmp ule i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
%11 = add i32 %10, 1
%12 = load i32, i32* %4
%13 = icmp uge i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
br label %18
15: ; preds = %2
%16 = load i32, i32* %3
%17 = add i32 %16, 1
br label %18
18: ; preds = %15, %14
%19 = phi i32 [ 0, %14 ], [ %17, %15 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @inc_and_wrap_index(i32 %0, i32 %1) {
%3 = icmp ule i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = add i32 %0, 1
%7 = icmp ult i32 %6, %1
%8 = select i1 %7, i32 %6, i32 0
ret i32 %8
}
int is_month_legit(int month) {
  if (month % 20 <= 12 && month <= 52)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_month_legit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0xc,%edx
jg     1131 <is_month_legit+0x31>
cmpl   $0x34,-0x8(%rbp)
jg     1131 <is_month_legit+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <is_month_legit+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_month_legit>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
cmp    $0xd,%edx
setl   %cl
cmp    $0x35,%eax
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @is_month_legit(i32 %0) {
%2 = srem i32 %0, 20
%3 = icmp slt i32 %2, 13
%4 = icmp slt i32 %0, 53
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void SampleMenuStatus(int status, int x, int y) {
  printf("SampleMenu() callback executed, MenuStatus is %i at (%i,%i)\n",
         status, x, y);
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c"SampleMenu() callback executed, MenuStatus is %i at (%i,%i)\0A\00"
define void @SampleMenuStatus(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"SampleMenu() callback executed, MenuStatus is %i at (%i,%i)\0A\00"
define void @SampleMenuStatus(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
long double round(long double);
long double roundl(long double a1) { return round(a1); }


x86 assembly (clang, -O0):
<roundl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <round@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <roundl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @roundl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @round(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @roundl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.round.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
unsigned int arikkei_memory_hash(void const **, int);
unsigned int arikkei_pointer_hash(const void *data) {
  return arikkei_memory_hash(&data, sizeof(data));
}


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

x86 assembly (clang, -O2):
<arikkei_pointer_hash>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <arikkei_memory_hash@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @arikkei_pointer_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @arikkei_memory_hash(i8** %2, i32 8)
ret i32 %3
}

LLVM IR (-O2):
define i32 @arikkei_pointer_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @arikkei_memory_hash(i8** %2, i32 8)
ret i32 %3
}
/* Variables and functions */
char ascii2bits(char);
char hex2bin(char *val) {
  char ret;
  char hi;
  char lo;
  hi = ascii2bits(val[0]);
  lo = ascii2bits(val[1]);
  ret = (((hi << 4) & 0xF0) | (lo & 0x0F));
  return ret;
}


x86 assembly (clang, -O0):
<hex2bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ascii2bits@plt>
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <ascii2bits@plt>
mov    %al,-0xb(%rbp)
movsbl -0xa(%rbp),%eax
shl    $0x4,%eax
and    $0xf0,%eax
movsbl -0xb(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2bin>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <ascii2bits@plt>
mov    %eax,%ebx
movsbl 0x1(%r14),%edi
call   1030 <ascii2bits@plt>
shl    $0x4,%bl
and    $0xf,%al
or     %bl,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define signext i8 @hex2bin(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call signext i8 @ascii2bits(i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call signext i8 @ascii2bits(i8 signext %5)
%7 = shl i8 %3, 4
%8 = and i8 %6, 15
%9 = or i8 %8, %7
ret i8 %9
}
int GetPsMode(int bitRate) {
  int psMode = 0;
  ;
  ;
  ;
  ;
  if (bitRate < 21000) {
    ;
    psMode = (0x00020000);
  } else {
    ;
    ;
    if (bitRate < 128000) {
      ;
      psMode = 0;
    }
  };
  return psMode;
}


x86 assembly (clang, -O0):
<GetPsMode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5208,-0x4(%rbp)
jge    1127 <GetPsMode+0x27>
movl   $0x20000,-0x8(%rbp)
jmp    1140 <GetPsMode+0x40>
cmpl   $0x1f400,-0x4(%rbp)
jge    113b <GetPsMode+0x3b>
movl   $0x0,-0x8(%rbp)
jmp    1140 <GetPsMode+0x40>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPsMode>:
xor    %eax,%eax
cmp    $0x5208,%edi
setl   %al
shl    $0x11,%eax
ret

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

LLVM IR (-O2):
define i32 @GetPsMode(i32 %0) {
%2 = icmp slt i32 %0, 21000
%3 = select i1 %2, i32 131072, i32 0
ret i32 %3
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_vardir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_vardir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_vardir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_vardir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
char tolower(char);
void strtolower(char *string) {
  while ((*string = tolower(*string)))
    string++;
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1147 <strtolower+0x37>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strtolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <strtolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strtolower(i8* nocapture %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 @tolower(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 void
}
int main() {
  int a;
  if ((a == 10) && 23) {
    if (a == 20) {
      int b = 10;
      return b;
    }
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1136 <main+0x36>
cmpl   $0x14,-0x8(%rbp)
jne    1131 <main+0x31>
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <main+0x3c>
jmp    1136 <main+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
float maths_f_min(const float a, const float b) {
  if (a <= b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<maths_f_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1130 <maths_f_min+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <maths_f_min+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maths_f_min>:
movaps %xmm0,%xmm2
cmpless %xmm1,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @maths_f_min(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ test_dictstring_basic();
int /*<<< orphan*/ test_dictstring_removing();
int /*<<< orphan*/ tests_show_summary();
int main(void) {
  test_dictstring_basic();
  test_dictstring_removing();
  tests_show_summary();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_dictstring_basic()
%2 = tail call i32 (...) @test_dictstring_removing()
%3 = tail call i32 (...) @tests_show_summary()
ret i32 0
}