xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_bss_stop_usage(void) {
  printf("\nUsage : bss_stop\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"\0AUsage : bss_stop\0A\00"
define void @print_bss_stop_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"\0AUsage : bss_stop\00"
define void @print_bss_stop_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_10835() {
  Assert_real((isqrt(10835) == 104),
              "/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",
              1505, ("Integer square root of 10835 should be 104"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_10835>:
push   %rax
mov    $0x2a53,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x68,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5e1,%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 = [43 x i8] c"Integer square root of 10835 should be 104\00"
define void @t_sqrt_10835() {
%1 = call i32 @isqrt(i32 10835)
%2 = icmp eq i32 %1, 104
%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 1505, i8* getelementptr inbounds ([43 x i8], [43 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 = [43 x i8] c"Integer square root of 10835 should be 104\00"
define void @t_sqrt_10835() {
%1 = tail call i32 @isqrt(i32 10835)
%2 = icmp eq i32 %1, 104
%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 1505, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCMHz() {
  long int stat = 99;
  BNCIO(10);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCMHz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCMHz>:
push   %rax
mov    $0xa,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCMHz() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 10)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCMHz() {
%1 = tail call i32 @BNCIO(i32 10)
ret i64 99
}
void foo(unsigned int ui, int i) {
  const unsigned char uc = 0;
  _Bool b;
  b = 0 != ~uc;
  b = 2 != ~uc;
  b = uc == ~uc;
  b = i == ui;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movb   $0x1,-0xa(%rbp)
movb   $0x1,-0xa(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8 0, i8* %5
store i8 1, i8* %6
store i8 1, i8* %6
store i8 0, i8* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int atoi_len(const char *buf, int len) {
  char tmp[32];
  memcpy(tmp, buf, len);
  tmp[len] = '\0';
  return atoi(tmp);
}


x86 assembly (clang, -O0):
<atoi_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x30(%rbp,%rax,1)
lea    -0x30(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi_len>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,(%rsp,%rax,1)
mov    %r14,%rdi
call   1040 <atoi@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @atoi_len(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @memcpy(i8* %6, i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 %11
store i8 0, i8* %12
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%14 = call i32 @atoi(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @atoi_len(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 %6
store i8 0, i8* %7
%8 = call i32 @atoi(i8* %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: mmountd timeout mountopt device mountpoint [helper]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"usage: mmountd timeout mountopt device mountpoint [helper]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"usage: mmountd timeout mountopt device mountpoint [helper]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(double, double);
double q5(double f) {
  double q6;
  if (f > 10) {
    q6 = 5;
  } else {
    q6 = 79.7 * (pow(f + 0.821, -1.15));
  }
  return q6;
}


x86 assembly (clang, -O0):
<q5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <q5+0x36>
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <q5+0x64>
movsd  0xeca(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q5>:
push   %rax
ucomisd 0xeef(%rip),%xmm0
jbe    1125 <q5+0x15>
movsd  0xedd(%rip),%xmm0
pop    %rax
ret
addsd  0xee3(%rip),%xmm0
movsd  0xee3(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @q5(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, 1.000000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 5.000000e+00, double* %3
br label %12
7: ; preds = %1
%8 = load double, double* %2
%9 = fadd double %8, 0x3FEA45A1CAC08312
%10 = call double @pow(double %9, double -1.150000e+00)
%11 = fmul double 7.970000e+01, %10
store double %11, double* %3
br label %12
12: ; preds = %7, %6
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @q5(double %0) {
%2 = fcmp ogt double %0, 1.000000e+01
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fadd double %0, 0x3FEA45A1CAC08312
%5 = tail call double @pow(double %4, double -1.150000e+00)
%6 = fmul double %5, 7.970000e+01
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 5.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RAL();
void do0x17() { _I8080_RAL(); }


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

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

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

LLVM IR (-O2):
define void @do0x17() {
%1 = tail call i32 (...) @_I8080_RAL()
ret void
}
int isLetter(unsigned char c) {
  if ((c >= 16 && c <= 25) || (c >= 30 && c <= 38) || (c >= 44 && c <= 50))
    return !0;
  return 0;
}


x86 assembly (clang, -O0):
<isLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x10,%eax
jl     1124 <isLetter+0x24>
movzbl -0x5(%rbp),%eax
cmp    $0x19,%eax
jle    1158 <isLetter+0x58>
movzbl -0x5(%rbp),%eax
cmp    $0x1e,%eax
jl     113e <isLetter+0x3e>
movzbl -0x5(%rbp),%eax
cmp    $0x26,%eax
jle    1158 <isLetter+0x58>
movzbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
jl     1164 <isLetter+0x64>
movzbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jg     1164 <isLetter+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <isLetter+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLetter>:
lea    -0x10(%rdi),%eax
cmp    $0xa,%al
setb   %al
lea    -0x1e(%rdi),%ecx
cmp    $0x9,%cl
setb   %cl
or     %al,%cl
add    $0xd4,%dil
cmp    $0x7,%dil
setb   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isLetter(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 16
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 25
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp sge i32 %13, 30
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = icmp sle i32 %17, 38
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = zext i8 %20 to i32
%22 = icmp sge i32 %21, 44
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = zext i8 %24 to i32
%26 = icmp sle i32 %25, 50
br i1 %26, label %27, label %28
27: ; preds = %23, %15, %7
store i32 1, i32* %2
br label %29
28: ; preds = %23, %19
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @isLetter(i8 zeroext %0) {
%2 = add i8 %0, -16
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -30
%5 = icmp ult i8 %4, 9
%6 = or i1 %3, %5
%7 = add i8 %0, -44
%8 = icmp ult i8 %7, 7
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
void bits_add_bit(int *bits_byte, int *bits_position, int *bits_to_define,
                  int data) {
  int bit = (data >> (*bits_to_define - 1)) & 1;
  *bits_to_define = *bits_to_define - 1;
  *bits_byte = *bits_byte | (bit << (7 - *bits_position));
  *bits_position = *bits_position + 1;
}


x86 assembly (clang, -O0):
<bits_add_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x10(%rbp),%rdx
mov    $0x7,%ecx
sub    (%rdx),%ecx
shl    %cl,%eax
mov    -0x24(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_add_bit>:
mov    %ecx,%eax
mov    (%rdx),%ecx
add    $0xffffffff,%ecx
shr    %cl,%eax
mov    %ecx,(%rdx)
mov    $0x7,%cl
sub    (%rsi),%cl
and    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @bits_add_bit(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = load i32*, i32** %7
%12 = load i32, i32* %11
%13 = sub nsw i32 %12, 1
%14 = ashr i32 %10, %13
%15 = and i32 %14, 1
store i32 %15, i32* %9
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
%18 = sub nsw i32 %17, 1
%19 = load i32*, i32** %7
store i32 %18, i32* %19
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = load i32, i32* %9
%23 = load i32*, i32** %6
%24 = load i32, i32* %23
%25 = sub nsw i32 7, %24
%26 = shl i32 %22, %25
%27 = or i32 %21, %26
%28 = load i32*, i32** %5
store i32 %27, i32* %28
%29 = load i32*, i32** %6
%30 = load i32, i32* %29
%31 = add nsw i32 %30, 1
%32 = load i32*, i32** %6
store i32 %31, i32* %32
ret void
}

LLVM IR (-O2):
define void @bits_add_bit(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
%7 = lshr i32 %3, %6
%8 = and i32 %7, 1
store i32 %6, i32* %2
%9 = load i32, i32* %0
%10 = load i32, i32* %1
%11 = sub nsw i32 7, %10
%12 = shl nuw i32 %8, %11
%13 = or i32 %12, %9
store i32 %13, i32* %0
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
ret void
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ _times(struct tms *);
clock_t clock() { return _times((struct tms *)0); }


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

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

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @clock() {
%1 = call i32 @_times(%struct.tms* null)
ret i32 %1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @clock() {
%1 = tail call i32 @_times(%struct.tms* null)
ret i32 %1
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int /*<<< orphan*/ _FPU_SETCW(int);
int fesetexceptflag(const fexcept_t *flagp, int excepts) {
  fexcept_t temp;
  _FPU_GETCW(temp);
  temp &= ~(excepts & FE_ALL_EXCEPT);
  temp |= (*flagp & excepts & FE_ALL_EXCEPT);
  _FPU_SETCW(temp);
  return 0;
}


x86 assembly (clang, -O0):
<fesetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0xc(%rbp),%eax
mov    0x2e9f(%rip),%rcx
and    (%rcx),%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
mov    0x2e84(%rip),%rcx
and    (%rcx),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetexceptflag>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <_FPU_GETCW@plt>
mov    0x2eab(%rip),%rax
and    (%rax),%ebx
and    (%r14),%ebx
mov    %ebx,%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fesetexceptflag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 @_FPU_GETCW(i32 %6)
%8 = load i32, i32* %4
%9 = load i32, i32* @FE_ALL_EXCEPT
%10 = and i32 %8, %9
%11 = xor i32 %10, -1
%12 = load i32, i32* %5
%13 = and i32 %12, %11
store i32 %13, i32* %5
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32, i32* %4
%17 = and i32 %15, %16
%18 = load i32, i32* @FE_ALL_EXCEPT
%19 = and i32 %17, %18
%20 = load i32, i32* %5
%21 = or i32 %20, %19
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = call i32 @_FPU_SETCW(i32 %22)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fesetexceptflag(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @_FPU_GETCW(i32 undef)
%4 = load i32, i32* @FE_ALL_EXCEPT
%5 = load i32, i32* %0
%6 = and i32 %4, %1
%7 = and i32 %6, %5
%8 = tail call i32 @_FPU_SETCW(i32 %7)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void IcsAppendChar(char *Line, char ch) {
  int len = strlen(Line);
  Line[len] = ch;
  Line[len + 1] = '\0';
}


x86 assembly (clang, -O0):
<IcsAppendChar>:
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):
<IcsAppendChar>:
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 @IcsAppendChar(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 @IcsAppendChar(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 test_test_1() {
  ;
  { return; };
}


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

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

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

LLVM IR (-O2):
define void @test_test_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ suffix();
void f_empty_goto_loop_suffix() {
f_empty_goto_loop_suffix_label:
  goto f_empty_goto_loop_suffix_label;
  suffix();
}


x86 assembly (clang, -O0):
<f_empty_goto_loop_suffix>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f_empty_goto_loop_suffix+0x9>
jmp    1109 <f_empty_goto_loop_suffix+0x9>

x86 assembly (clang, -O2):
<f_empty_goto_loop_suffix>:
jmp    1100 <f_empty_goto_loop_suffix>

LLVM IR (-O0):
define void @f_empty_goto_loop_suffix() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @f_empty_goto_loop_suffix() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct bs_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buf_window_size(struct bs_buffer const *);
int /*<<< orphan*/ buf_window_start(struct bs_buffer const *);
int /*<<< orphan*/ buf_write(struct bs_buffer *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void buf_extend(const struct bs_buffer *source, struct bs_buffer *target) {
  buf_write(target, buf_window_start(source), buf_window_size(source));
}


x86 assembly (clang, -O0):
<buf_extend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <buf_window_start@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <buf_window_size@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1050 <buf_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_extend>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <buf_window_start@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <buf_window_size@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <buf_write@plt>

LLVM IR (-O0):
%struct.bs_buffer = type { i32 }
define void @buf_extend(%struct.bs_buffer* %0, %struct.bs_buffer* %1) {
%3 = alloca %struct.bs_buffer*
%4 = alloca %struct.bs_buffer*
store %struct.bs_buffer* %0, %struct.bs_buffer** %3
store %struct.bs_buffer* %1, %struct.bs_buffer** %4
%5 = load %struct.bs_buffer*, %struct.bs_buffer** %4
%6 = load %struct.bs_buffer*, %struct.bs_buffer** %3
%7 = call i32 @buf_window_start(%struct.bs_buffer* %6)
%8 = load %struct.bs_buffer*, %struct.bs_buffer** %3
%9 = call i32 @buf_window_size(%struct.bs_buffer* %8)
%10 = call i32 @buf_write(%struct.bs_buffer* %5, i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.bs_buffer = type { i32 }
define void @buf_extend(%struct.bs_buffer* %0, %struct.bs_buffer* %1) {
%3 = tail call i32 @buf_window_start(%struct.bs_buffer* %0)
%4 = tail call i32 @buf_window_size(%struct.bs_buffer* %0)
%5 = tail call i32 @buf_write(%struct.bs_buffer* %1, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
bool is_leap_year(int yy) {
  int yyyy = yy + 1900;
  bool bLeap = false;
  if (yyyy % 100 == 0) {
    return yyyy % 400 == 0;
  }
  return yyyy % 4 == 0;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114b <is_leap_year+0x4b>
mov    -0xc(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <is_leap_year+0x64>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
lea    0x76c(%rdi),%ecx
imul   $0xc28f5c29,%ecx,%eax
add    $0x51eb850,%eax
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
jbe    1122 <is_leap_year+0x22>
and    $0x3,%edi
mov    %edi,%ecx
jmp    1141 <is_leap_year+0x41>
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rax
add    %edx,%eax
imul   $0x190,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1900
store i32 %7, i32* %4
store i32 0, i32* %5
%8 = load i32, i32* %4
%9 = srem i32 %8, 100
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i32, i32* %4
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
store i32 %15, i32* %2
br label %21
16: ; preds = %1
%17 = load i32, i32* %4
%18 = srem i32 %17, 4
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
store i32 %20, i32* %2
br label %21
21: ; preds = %16, %11
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = add nsw i32 %0, 1900
%3 = srem i32 %2, 100
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = srem i32 %2, 400
br label %9
7: ; preds = %1
%8 = and i32 %0, 3
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
int test_imm_60int8_reg(signed char val) {
  return ((val) & (-0x60 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_60int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffa0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_60int8_reg>:
test   $0xa0,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_60int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -96
%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_60int8_reg(i8 signext %0) {
%2 = and i8 %0, -96
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void key_4_handler(void) {
  if ((*(volatile unsigned int *)(0x7F008824)) & 8) {
    (*(volatile unsigned int *)(0x7F008824)) &= ~8;
  } else {
    (*(volatile unsigned int *)(0x7F008824)) |= 8;
  }
  return;
}


x86 assembly (clang, -O0):
<key_4_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     112d <key_4_handler+0x2d>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    113e <key_4_handler+0x3e>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_4_handler>:
mov    0x7f008824,%eax
and    $0x8,%eax
mov    0x7f008824,%ecx
and    $0xfffffff7,%ecx
or     %eax,%ecx
xor    $0x8,%ecx
mov    %ecx,0x7f008824
ret

LLVM IR (-O0):
define void @key_4_handler() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, 8
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%6 = and i32 %5, -9
store volatile i32 %6, i32* inttoptr (i64 2130741284 to i32*)
br label %10
7: ; preds = %0
%8 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%9 = or i32 %8, 8
store volatile i32 %9, i32* inttoptr (i64 2130741284 to i32*)
br label %10
10: ; preds = %7, %4
ret void
}

LLVM IR (-O2):
define void @key_4_handler() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, 8
%3 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%4 = and i32 %3, -9
%5 = or i32 %2, %4
%6 = xor i32 %5, 8
store volatile i32 %6, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ const *);
int /*<<< orphan*/ const *label_is_normal(int /*<<< orphan*/ const *);
uint8_t label_length(const uint8_t *label) {
  assert(label);
  assert(label_is_normal(label));
  return label[0];
}


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

x86 assembly (clang, -O2):
<label_length>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <label_is_normal@plt>
mov    %rax,%rdi
call   1040 <assert@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @label_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @assert(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32* @label_is_normal(i32* %5)
%7 = call i32 @assert(i32* %6)
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @label_length(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = tail call i32* @label_is_normal(i32* %0)
%4 = tail call i32 @assert(i32* %3)
%5 = load i32, i32* %0
ret i32 %5
}
/* Variables and functions */
scalar_t__ dialer_view_init();
int /*<<< orphan*/ dialer_view_is_init();
int /*<<< orphan*/ dialer_view_show();
void phoneui_backend_dialer_show() {
  if (!dialer_view_is_init()) {
    if (dialer_view_init()) {
      return;
    }
  }
  dialer_view_show();
}


x86 assembly (clang, -O0):
<phoneui_backend_dialer_show>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dialer_view_is_init@plt>
cmp    $0x0,%eax
jne    115f <phoneui_backend_dialer_show+0x2f>
mov    $0x0,%al
call   1030 <dialer_view_init@plt>
cmp    $0x0,%rax
je     115a <phoneui_backend_dialer_show+0x2a>
jmp    1166 <phoneui_backend_dialer_show+0x36>
jmp    115f <phoneui_backend_dialer_show+0x2f>
mov    $0x0,%al
call   1050 <dialer_view_show@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<phoneui_backend_dialer_show>:
push   %rax
xor    %eax,%eax
call   1040 <dialer_view_is_init@plt>
test   %eax,%eax
je     1144 <phoneui_backend_dialer_show+0x14>
xor    %eax,%eax
pop    %rcx
jmp    1050 <dialer_view_show@plt>
xor    %eax,%eax
call   1030 <dialer_view_init@plt>
test   %rax,%rax
je     113c <phoneui_backend_dialer_show+0xc>
pop    %rax
ret

LLVM IR (-O0):
define void @phoneui_backend_dialer_show() {
%1 = call i32 (...) @dialer_view_is_init()
%2 = icmp ne i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = call i64 (...) @dialer_view_init()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %10
7: ; preds = %3
br label %8
8: ; preds = %7, %0
%9 = call i32 (...) @dialer_view_show()
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @phoneui_backend_dialer_show() {
%1 = tail call i32 (...) @dialer_view_is_init()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i64 (...) @dialer_view_init()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3, %0
%7 = tail call i32 (...) @dialer_view_show()
br label %8
8: ; preds = %3, %6
ret void
}
void *mcsp_guardexphook_copy(void *chook) { return chook; }


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

x86 assembly (clang, -O2):
<mcsp_guardexphook_copy>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @mcsp_guardexphook_copy(i8* readnone returned %0) {
ret i8* %0
}
int to_lowercase(const char c) {
  int lc = c;
  if (lc >= 'A' && lc <= 'Z') {
    lc += 'a' - 'A';
  }
  if (lc < 'a' || c > 'z') {
    return -1;
  }
  return lc;
}


x86 assembly (clang, -O0):
<to_lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x41,-0xc(%rbp)
jl     112e <to_lowercase+0x2e>
cmpl   $0x5a,-0xc(%rbp)
jg     112e <to_lowercase+0x2e>
mov    -0xc(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x61,-0xc(%rbp)
jl     1145 <to_lowercase+0x45>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1151 <to_lowercase+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <to_lowercase+0x57>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lowercase>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%cl
cmovae %edi,%eax
cmp    $0x61,%eax
mov    $0xffffffff,%ecx
cmovl  %ecx,%eax
cmp    $0x7b,%dil
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @to_lowercase(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 32
store i32 %14, i32* %4
br label %15
15: ; preds = %12, %9, %1
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 97
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp sgt i32 %20, 122
br i1 %21, label %22, label %23
22: ; preds = %18, %15
store i32 -1, i32* %2
br label %25
23: ; preds = %18
%24 = load i32, i32* %4
store i32 %24, i32* %2
br label %25
25: ; preds = %23, %22
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @to_lowercase(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = add nsw i32 %2, 32
%6 = select i1 %4, i32 %5, i32 %2
%7 = icmp slt i32 %6, 97
%8 = icmp sgt i8 %0, 122
%9 = or i1 %8, %7
%10 = select i1 %9, i32 -1, i32 %6
ret i32 %10
}
const char *get_prefix() { return "./data/"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"./data/\00"
define i8* @get_prefix() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_is_negative(int n) {
  char c;
  char d;
  c = 'N';
  d = 'P';
  if (n < 0) {
    ft_putchar(c);
  } else {
    ft_putchar(d);
  }
}


x86 assembly (clang, -O0):
<ft_is_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x4e,-0x5(%rbp)
movb   $0x50,-0x6(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113b <ft_is_negative+0x2b>
movsbl -0x5(%rbp),%edi
call   1030 <ft_putchar@plt>
jmp    1144 <ft_is_negative+0x34>
movsbl -0x6(%rbp),%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_negative>:
not    %edi
shr    $0x1f,%edi
add    %edi,%edi
add    $0x4e,%edi
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @ft_is_negative(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i8 78, i8 80
%4 = tail call i32 @ft_putchar(i8 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Lcd4_Write_Char(char);
void Lcd4_Write_String(char *a) {
  int i;
  for (i = 0; a[i] != '\0'; i++)
    Lcd4_Write_Char(a[i]);
}


x86 assembly (clang, -O0):
<Lcd4_Write_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <Lcd4_Write_String+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <Lcd4_Write_Char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <Lcd4_Write_String+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Lcd4_Write_String(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @Lcd4_Write_Char(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int PrimeCounter(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int arr[5] = {3, 4, 1, 2, 5};
  printf("the number of odd number in the array is %d\n", PrimeCounter(arr, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <PrimeCounter@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <PrimeCounter@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 3, i32 4, i32 1, i32 2, i32 5]
@.str = [45 x i8] c"the number of odd number in the array is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @PrimeCounter(i32* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 3, i32 4, i32 1, i32 2, i32 5]
@.str = [45 x i8] c"the number of odd number in the array is %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @PrimeCounter(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void hander(int sinal) { return; }


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

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

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

LLVM IR (-O2):
define void @hander(i32 %0) {
ret void
}
/* Variables and functions */
int binarySearch(int *, int /*<<< orphan*/, int, int);
int searchInsert(int *nums, int numsSize, int target) {
  return binarySearch(nums, 0, numsSize - 1, target);
}


x86 assembly (clang, -O0):
<searchInsert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x10(%rbp),%ecx
xor    %esi,%esi
call   1030 <binarySearch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchInsert>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <binarySearch@plt>

LLVM IR (-O0):
define i32 @searchInsert(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 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @binarySearch(i32* %7, i32 0, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @searchInsert(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @binarySearch(i32* %0, i32 0, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int random(int i) {
  srand(time(NULL));
  return rand() % i;
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @random(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
ret i32 %5
}
/* Type definitions */
struct t_infolist {
  int dummy;
};

/* Variables and functions */
char const *infolist_fields(struct t_infolist *);
int /*<<< orphan*/ infolist_valid(struct t_infolist *);
const char *plugin_api_infolist_fields(struct t_infolist *infolist) {
  if (!infolist || !infolist_valid(infolist))
    return NULL;
  return infolist_fields(infolist);
}


x86 assembly (clang, -O0):
<plugin_api_infolist_fields>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <plugin_api_infolist_fields+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <infolist_valid@plt>
cmp    $0x0,%eax
jne    1156 <plugin_api_infolist_fields+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1163 <plugin_api_infolist_fields+0x43>
mov    -0x10(%rbp),%rdi
call   1040 <infolist_fields@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_infolist_fields>:
push   %rbx
test   %rdi,%rdi
je     113b <plugin_api_infolist_fields+0x1b>
mov    %rdi,%rbx
call   1030 <infolist_valid@plt>
test   %eax,%eax
je     113b <plugin_api_infolist_fields+0x1b>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <infolist_fields@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.t_infolist = type { i32 }
define i8* @plugin_api_infolist_fields(%struct.t_infolist* %0) {
%2 = icmp eq %struct.t_infolist* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @infolist_valid(%struct.t_infolist* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @infolist_fields(%struct.t_infolist* %0)
br label %8
8: ; preds = %1, %3, %6
%9 = phi i8* [ %7, %6 ], [ null, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int get_date_macro_year(const char *d) {
  int year = -1;
  sscanf(d, "%*s %*d %d", &year);
  return year;
}


x86 assembly (clang, -O0):
<get_date_macro_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_date_macro_year>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xee0(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%*s %*d %d\00"
define i32 @get_date_macro_year(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 -1, i32* %2
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void xmlDebugInt(int n, int dbg) {
  printf("    <dbg%d>%d</dbg%d>\n", n, dbg, n);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c" <dbg%d>%d</dbg%d>\0A\00"
define void @xmlDebugInt(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 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c" <dbg%d>%d</dbg%d>\0A\00"
define void @xmlDebugInt(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allprint();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void endit() {
  allprint();
  exit(0);
}


x86 assembly (clang, -O0):
<endit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <allprint@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<endit>:
push   %rax
xor    %eax,%eax
call   1030 <allprint@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @endit() {
%1 = call i32 (...) @allprint()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @endit() {
%1 = tail call i32 (...) @allprint()
%2 = tail call i32 @exit(i32 0)
unreachable
}