xunge/DecIR huggingface dataset:
char xconfigToLower(char c) {
  if ((c >= 'A') && (c <= 'Z')) {
    return c + ('a' - 'A');
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<xconfigToLower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <xconfigToLower+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <xconfigToLower+0x33>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <xconfigToLower+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xconfigToLower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @xconfigToLower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
const char *picosat_config(void) { return "configured with dReal"; }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"configured with dReal\00"
define i8* @picosat_config() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"configured with dReal\00"
define i8* @picosat_config() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteLong(int);
int /*<<< orphan*/ S9xSetPCBase(int /*<<< orphan*/);
void Op5C(void) { S9xSetPCBase(AbsoluteLong(5)); }


x86 assembly (clang, -O0):
<Op5C>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1040 <AbsoluteLong@plt>
mov    %eax,%edi
call   1030 <S9xSetPCBase@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op5C>:
push   %rax
mov    $0x5,%edi
call   1040 <AbsoluteLong@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <S9xSetPCBase@plt>

LLVM IR (-O0):
define void @Op5C() {
%1 = call i32 @AbsoluteLong(i32 5)
%2 = call i32 @S9xSetPCBase(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op5C() {
%1 = tail call i32 @AbsoluteLong(i32 5)
%2 = tail call i32 @S9xSetPCBase(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PushMarkArgumentSyntaxMapping(int /*<<< orphan*/, long);
void PushInMarkArgumentSyntaxMapping(long p_index) {
  PushMarkArgumentSyntaxMapping(0, p_index);
}


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

x86 assembly (clang, -O2):
<PushInMarkArgumentSyntaxMapping>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <PushMarkArgumentSyntaxMapping@plt>

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

LLVM IR (-O2):
define void @PushInMarkArgumentSyntaxMapping(i64 %0) {
%2 = tail call i32 @PushMarkArgumentSyntaxMapping(i32 0, i64 %0)
ret void
}
int do_423() { return 423; }


x86 assembly (clang, -O0):
<do_423>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a7,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_423() {
ret i32 423
}

LLVM IR (-O2):
define i32 @do_423() {
ret i32 423
}
void pari_free() {}


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

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

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

LLVM IR (-O2):
define void @pari_free() {
ret void
}
__attribute__((no, noclone)) int foo2(int x, int y) {
  unsigned int xa = (unsigned int)x - (0x7fffffff - 3);
  xa &= 3;
  x = 0x7fffffff - 3 + xa;
  unsigned int ya = y + 1U;
  ya &= 1;
  y = ya - 1;
  return x - y;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x7ffffffc,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x7ffffffc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
and    $0x3,%edi
and    $0x1,%esi
lea    (%rsi,%rdi,1),%eax
add    $0x7ffffffc,%eax
ret

LLVM IR (-O0):
define i32 @foo2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = sub i32 %7, 2147483644
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 3
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = add i32 2147483644, %11
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = add i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = and i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = sub i32 %17, 1
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = sub nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @foo2(i32 %0, i32 %1) {
%3 = and i32 %0, 3
%4 = or i32 %3, 2147483644
%5 = and i32 %1, 1
%6 = add nuw nsw i32 %4, %5
ret i32 %6
}
/* Type definitions */
struct timespec {
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long round(double);
long current_time_millis() {
  struct timespec spec;
  clock_gettime(CLOCK_REALTIME, &spec);
  return round(spec.tv_nsec / 1.0e6);
}


x86 assembly (clang, -O0):
<current_time_millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time_millis>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
movsd  (%rsp),%xmm0
divsd  0xec1(%rip),%xmm0
call   1040 <round@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { double }
@CLOCK_REALTIME = global i32 0
define i64 @current_time_millis() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = fdiv double %5, 1.000000e+06
%7 = call i64 @round(double %6)
ret i64 %7
}

LLVM IR (-O2):
%struct.timespec = type { double }
@CLOCK_REALTIME = global i32 0
define i64 @current_time_millis() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = call i64 @round(double %7)
ret i64 %8
}
/* Variables and functions */
double **matriz_valores(int, int, double *);
double **matriz_valores_quadrada(int dim, double *m) {
  return matriz_valores(dim, dim, m);
}


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

x86 assembly (clang, -O2):
<matriz_valores_quadrada>:
mov    %rsi,%rdx
mov    %edi,%esi
jmp    1030 <matriz_valores@plt>

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

LLVM IR (-O2):
define double** @matriz_valores_quadrada(i32 %0, double* %1) {
%3 = tail call double** @matriz_valores(i32 %0, i32 %0, double* %1)
ret double** %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safe_free(void *ptr) {
  void **p = (void **)ptr;
  if (*p) {
    free(*p);
    *p = 0;
  }
}


x86 assembly (clang, -O0):
<safe_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1149 <safe_free+0x39>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <safe_free+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @safe_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @free(i8* %3)
store i8* null, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ Off_Reg_Bank(int);
void Move_Ret_To_Reg_X(int index) {
  Inst_Printf("movq", "%%rax,%s", Off_Reg_Bank(index * 8));
}


x86 assembly (clang, -O0):
<Move_Ret_To_Reg_X>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
call   1040 <Off_Reg_Bank@plt>
mov    %eax,%edx
lea    0xec1(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Reg_X>:
push   %rax
shl    $0x3,%edi
call   1040 <Off_Reg_Bank@plt>
lea    0xed0(%rip),%rdi
lea    0xece(%rip),%rsi
mov    %eax,%edx
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"movq\00"
@.str.1 = [9 x i8] c"%%rax,%s\00"
define void @Move_Ret_To_Reg_X(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
%5 = call i32 @Off_Reg_Bank(i32 %4)
%6 = call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"movq\00"
@.str.1 = [9 x i8] c"%%rax,%s\00"
define void @Move_Ret_To_Reg_X(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = tail call i32 @Off_Reg_Bank(i32 %2)
%4 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int core2_safe(char const *);
int U_EMRPOLYPOLYLINE_safe(const char *record) { return (core2_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRPOLYPOLYLINE_safe>:
jmp    1030 <core2_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYPOLYLINE_safe(i8* %0) {
%2 = tail call i32 @core2_safe(i8* %0)
ret i32 %2
}
void foo737(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo737(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_any(char const *, int, char const *);
void log_error(const char *type, int code, const char *msg) {
  log_any(type, code, msg);
}


x86 assembly (clang, -O0):
<log_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <log_any@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_error>:
jmp    1030 <log_any@plt>

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

LLVM IR (-O2):
define void @log_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @log_any(i8* %0, i32 %1, i8* %2)
ret void
}
void arch_irq_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_irq_disable() {
ret void
}
/* Variables and functions */
int raise(int);
__attribute__((__weak__, __always___)) int softboundmpx_raise(int sig) {
  return raise(sig);
}


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

x86 assembly (clang, -O2):
<softboundmpx_raise>:
jmp    1030 <raise@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_raise(i32 %0) {
%2 = tail call i32 @raise(i32 %0)
ret i32 %2
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getTemperatureLimit(unsigned char id) {
  return dxl_read_byte(id, (11));
}


x86 assembly (clang, -O0):
<getTemperatureLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xb,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTemperatureLimit>:
mov    $0xb,%esi
jmp    1030 <dxl_read_byte@plt>

LLVM IR (-O0):
define zeroext i8 @getTemperatureLimit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @dxl_read_byte(i8 zeroext %3, i32 11)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @getTemperatureLimit(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 11)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ ShowMap();
int /*<<< orphan*/ ShowUnits();
int /*<<< orphan*/ curs_set(int);
void RefreshView() {
  curs_set(0);
  ShowMap();
  ShowUnits();
  curs_set(2);
}


x86 assembly (clang, -O0):
<RefreshView>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <curs_set@plt>
mov    $0x0,%al
call   1040 <ShowMap@plt>
mov    $0x0,%al
call   1030 <ShowUnits@plt>
mov    $0x2,%edi
call   1050 <curs_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RefreshView>:
push   %rax
xor    %edi,%edi
call   1050 <curs_set@plt>
xor    %eax,%eax
call   1040 <ShowMap@plt>
xor    %eax,%eax
call   1030 <ShowUnits@plt>
mov    $0x2,%edi
pop    %rax
jmp    1050 <curs_set@plt>

LLVM IR (-O0):
define void @RefreshView() {
%1 = call i32 @curs_set(i32 0)
%2 = call i32 (...) @ShowMap()
%3 = call i32 (...) @ShowUnits()
%4 = call i32 @curs_set(i32 2)
ret void
}

LLVM IR (-O2):
define void @RefreshView() {
%1 = tail call i32 @curs_set(i32 0)
%2 = tail call i32 (...) @ShowMap()
%3 = tail call i32 (...) @ShowUnits()
%4 = tail call i32 @curs_set(i32 2)
ret void
}
double FloatNoSwap(double f) { return f; }


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

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

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

LLVM IR (-O2):
define double @FloatNoSwap(double returned %0) {
ret double %0
}
/* Variables and functions */
char *vstrcat(char const *, char *, char const *, int /*<<< orphan*/ *);
extern char *mkoldfn(const char *fn, const char *ext) {
  return vstrcat(fn, ".", ext, NULL);
}


x86 assembly (clang, -O0):
<mkoldfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <vstrcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkoldfn>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
xor    %ecx,%ecx
jmp    1030 <vstrcat@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @mkoldfn(i8* %0, i8* %1) {
%3 = tail call i8* @vstrcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %1, i32* null)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ do_cleanup();
void cleanup_handler(int sig __attribute__((unused))) {
  do_cleanup();
  _exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<cleanup_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <do_cleanup@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<cleanup_handler>:
push   %rax
xor    %eax,%eax
call   1040 <do_cleanup@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @cleanup_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @do_cleanup()
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @_exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @cleanup_handler(i32 %0) {
%2 = tail call i32 (...) @do_cleanup()
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @_exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Matrixsetup(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void main(int argc, char **argv) {
  const char *filename;
  char str1[40];
  printf("Enter in the filename \n");
  scanf("%s", str1);
  Matrixsetup(str1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <Matrixsetup@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <Matrixsetup@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter in the filename \0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca [40 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%11 = call i32 @Matrixsetup(i8* %10)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [23 x i8] c"Enter in the filename \00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [40 x i8]
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @Matrixsetup(i8* %4)
ret void
}
int __attribute__((no, noclone)) foo(int x, int y) { return x + y; }


x86 assembly (clang, -O0):
<foo>:
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):
<foo>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int get_left(i) { return 2 * i + 1; }


x86 assembly (clang, -O0):
<get_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_left(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void convert(int n) {
  int i;
  if ((i = n / 10) != 0)
    convert(i);
  putchar(n % 10 + '0');
  putchar(32);
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     114a <convert+0x2a>
mov    -0x8(%rbp),%edi
call   1040 <convert@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rbx
lea    0x9(%rdi),%eax
movslq %edi,%rbx
cmp    $0x13,%eax
jb     1145 <convert+0x25>
imul   $0x66666667,%rbx,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
call   1040 <convert@plt>
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%rbx,%rax,1),%edi
add    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @convert(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 10
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = add nsw i32 %11, 48
%13 = call i32 @putchar(i32 %12)
%14 = call i32 @putchar(i32 32)
ret void
}

LLVM IR (-O2):
define void @convert(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 10
tail call void @convert(i32 %5)
br label %6
6: ; preds = %4, %1
%7 = srem i32 %0, 10
%8 = add nsw i32 %7, 48
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 @putchar(i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ playTextAs(char, int);
int rand();
void playTextRandomColor(int depth) {
  char colors[] = {(0), (1 << 3)};
  char color = colors[rand() % 2];
  playTextAs(color, depth);
}


x86 assembly (clang, -O0):
<playTextRandomColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x6(%rbp,%rax,1),%al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
mov    -0x4(%rbp),%esi
movsbl %al,%edi
call   1030 <playTextAs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playTextRandomColor>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cltq
lea    0xec1(%rip),%rcx
movsbl (%rax,%rcx,1),%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <playTextAs@plt>

LLVM IR (-O0):
@__const.playTextRandomColor.colors = [2 x i8] c"\00\08"
define void @playTextRandomColor(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
%4 = alloca i8
store i32 %0, i32* %2
%5 = bitcast [2 x i8]* %3 to i8*
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %4
%11 = load i8, i8* %4
%12 = load i32, i32* %2
%13 = call i32 @playTextAs(i8 signext %11, i32 %12)
ret void
}

LLVM IR (-O2):
@__const.playTextRandomColor.colors = [2 x i8] c"\00\08"
define void @playTextRandomColor(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [2 x i8], [2 x i8]* @__const.playTextRandomColor.colors, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @playTextAs(i8 signext %6, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  swap(&a, &b);
  printf("\n%d %d", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"\0A%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
void __module_get(struct module *module) {}


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

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

LLVM IR (-O0):
%struct.module = type opaque
define void @__module_get(%struct.module* %0) {
%2 = alloca %struct.module*
store %struct.module* %0, %struct.module** %2
ret void
}

LLVM IR (-O2):
%struct.module = type opaque
define void @__module_get(%struct.module* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]...\n\nOptions:\n    -h, --help\t\tdisplay this "
         "help\n    -V, --version\tdisplay version information\n\nReport bugs "
         "to <bulliver@gmail.com>\n",
         "sync");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0xf78(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [150 x i8] c"Usage: %s [OPTION]...\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"sync\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [150 x i8] c"Usage: %s [OPTION]...\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"sync\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long long neg64(long long a) { return 0 - a; }


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

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

LLVM IR (-O0):
define i64 @neg64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 0, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @neg64(i64 %0) {
%2 = sub nsw i64 0, %0
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ two();
void *three(void) {
  if (malloc(1003) == NULL) {
    exit(-1);
  }
  free(two());
  return malloc(2003);
}


x86 assembly (clang, -O0):
<three>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3eb,%edi
call   1050 <malloc@plt>
cmp    $0x0,%rax
jne    1162 <three+0x22>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1040 <two@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    $0x7d3,%edi
call   1050 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<three>:
push   %rax
xor    %eax,%eax
call   1040 <two@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    $0x7d3,%edi
pop    %rax
jmp    1050 <malloc@plt>

LLVM IR (-O0):
define i8* @three() {
%1 = call i8* @malloc(i32 1003)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 -1)
unreachable
5: ; preds = %0
%6 = call i32 (...) @two()
%7 = call i32 @free(i32 %6)
%8 = call i8* @malloc(i32 2003)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @three() {
%1 = tail call i32 (...) @two()
%2 = tail call i32 @free(i32 %1)
%3 = tail call dereferenceable_or_null(2003) i8* @malloc(i32 2003)
ret i8* %3
}
const char *Size_Brief(void) { return "Type Size"; }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Type Size\00"
define i8* @Size_Brief() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ isspace(char);
void skip_space(char **str) {
  while ((isspace(**str) || (**str) == '\r') && (**str) != '\n') {
    ++(*str);
  }
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    114d <skip_space+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
jne    1160 <skip_space+0x50>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1170 <skip_space+0x60>
jmp    1183 <skip_space+0x73>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <skip_space+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rcx
jmp    112c <skip_space+0x1c>
nopl   0x0(%rax)
cmp    $0xd,%dl
jne    1144 <skip_space+0x34>
add    $0x1,%rcx
mov    %rcx,(%rbx)
movsbl (%rcx),%edi
call   1030 <isspace@plt>
mov    (%rbx),%rcx
movzbl (%rcx),%edx
test   %rax,%rax
je     1120 <skip_space+0x10>
cmp    $0xa,%dl
jne    1125 <skip_space+0x15>
pop    %rbx
ret

LLVM IR (-O0):
define void @skip_space(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %23, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = call i64 @isspace(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 13
br i1 %14, label %15, label %21
15: ; preds = %9, %3
%16 = load i8**, i8*** %2
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 10
br label %21
21: ; preds = %15, %9
%22 = phi i1 [ false, %9 ], [ %20, %15 ]
br i1 %22, label %23, label %27
23: ; preds = %21
%24 = load i8**, i8*** %2
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %24
br label %3
27: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @skip_space(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %14, %1
%4 = phi i8* [ %15, %14 ], [ %2, %1 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = load i8*, i8** %0
%9 = load i8, i8* %8
br i1 %7, label %10, label %12
10: ; preds = %3
%11 = icmp eq i8 %9, 13
br i1 %11, label %14, label %16
12: ; preds = %3
%13 = icmp eq i8 %9, 10
br i1 %13, label %16, label %14
14: ; preds = %10, %12
%15 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %15, i8** %0
br label %3
16: ; preds = %10, %12
ret void
}
/* Variables and functions */
double arcsin4(double);
double arcsin(double x) { return arcsin4(x); }


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

x86 assembly (clang, -O2):
<arcsin>:
jmp    1030 <arcsin4@plt>

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

LLVM IR (-O2):
define double @arcsin(double %0) {
%2 = tail call double @arcsin4(double %0)
ret double %2
}
/* Variables and functions */
char *malloc(int);
int main(int argc, char *argv[]) {
  char *pointer1 = 0;
  pointer1 = malloc(64);
  {
    char *pointer2 = (char *)&pointer1;
    pointer2[1] = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x1,0x1(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%8 = call i8* @malloc(i32 64)
store i8* %8, i8** %6
%9 = bitcast i8** %6 to i8*
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 1, i8* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int INT_MIN;
signed int ov_ineg(signed int a, int *ov) {
  if (*ov || a == INT_MIN) {
    *ov = 1;
    return INT_MIN;
  }
  return -a;
}


x86 assembly (clang, -O0):
<ov_ineg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    112a <ov_ineg+0x2a>
mov    -0x8(%rbp),%eax
mov    0x2ec6(%rip),%rcx
cmp    (%rcx),%eax
jne    1145 <ov_ineg+0x45>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <ov_ineg+0x4d>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ov_ineg>:
cmpl   $0x0,(%rsi)
mov    0x2ede(%rip),%rcx
jne    1115 <ov_ineg+0x15>
mov    %edi,%eax
cmp    %edi,(%rcx)
je     1115 <ov_ineg+0x15>
neg    %eax
ret
movl   $0x1,(%rsi)
mov    (%rcx),%eax
ret

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

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @ov_ineg(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
%5 = load i32, i32* @INT_MIN
%6 = icmp eq i32 %5, %0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %10
8: ; preds = %2
store i32 1, i32* %1
%9 = load i32, i32* @INT_MIN
br label %12
10: ; preds = %2
%11 = sub nsw i32 0, %0
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ fdread_ex(int, char *, size_t, int, int, int);
ssize_t fdread(int fd, char *buf, size_t buf_size) {
  return fdread_ex(fd, buf, buf_size, 1500, 7, 1);
}


x86 assembly (clang, -O0):
<fdread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x5dc,%ecx
mov    $0x7,%r8d
mov    $0x1,%r9d
call   1030 <fdread_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdread>:
mov    $0x5dc,%ecx
mov    $0x7,%r8d
mov    $0x1,%r9d
jmp    1030 <fdread_ex@plt>

LLVM IR (-O0):
define i32 @fdread(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @fdread_ex(i32 %7, i8* %8, i64 %9, i32 1500, i32 7, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fdread(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @fdread_ex(i32 %0, i8* %1, i64 %2, i32 1500, i32 7, i32 1)
ret i32 %4
}
/* Variables and functions */
char *_strstr_word(char const *, char const *, int, int /*<<< orphan*/,
                   int /*<<< orphan*/);
char *strcasestr_word(const char *haystack, const char *needle) {
  return _strstr_word(haystack, needle, 1, 0, 0);
}


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

x86 assembly (clang, -O2):
<strcasestr_word>:
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <_strstr_word@plt>

LLVM IR (-O0):
define i8* @strcasestr_word(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @_strstr_word(i8* %5, i8* %6, i32 1, i32 0, i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strcasestr_word(i8* %0, i8* %1) {
%3 = tail call i8* @_strstr_word(i8* %0, i8* %1, i32 1, i32 0, i32 0)
ret i8* %3
}
void local_irq_disable(void) { __asm__ __volatile__("cli" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @local_irq_disable() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int getwordsize() {
  int i = 1;
  int j = 1;
  while ((i <<= 1) != 0) {
    j++;
  }
}


x86 assembly (clang, -O0):
<getwordsize>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1132 <getwordsize+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1112 <getwordsize+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getwordsize() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xb9() {
  Assert_real((isxdigit(185) == 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_isxdigit.c",
              930, ("isxdigit should be 0 for 0xb9"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xb9>:
push   %rax
mov    $0xb9,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3a2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xb9\00"
define void @t_isxdigit_0xb9() {
%1 = call i64 @isxdigit(i32 185)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 930, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xb9\00"
define void @t_isxdigit_0xb9() {
%1 = tail call i64 @isxdigit(i32 185)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 930, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTFDoGroup(int /*<<< orphan*/, int);
int RTFGetBraceLevel();
void RTFSkipGroup(void) {
  int level = RTFGetBraceLevel();
  RTFDoGroup(0, level);
}


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

x86 assembly (clang, -O2):
<RTFSkipGroup>:
push   %rax
xor    %eax,%eax
call   1030 <RTFGetBraceLevel@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <RTFDoGroup@plt>

LLVM IR (-O0):
define void @RTFSkipGroup() {
%1 = alloca i32
%2 = call i32 (...) @RTFGetBraceLevel()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @RTFDoGroup(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @RTFSkipGroup() {
%1 = tail call i32 (...) @RTFGetBraceLevel()
%2 = tail call i32 @RTFDoGroup(i32 0, i32 %1)
ret void
}
int DSoundGetDistance(int maxDSBufferLen, int pos1, int pos2) {
  int distance = pos2 - pos1;
  if (distance < 0)
    distance = distance + maxDSBufferLen;
  return distance;
}


x86 assembly (clang, -O0):
<DSoundGetDistance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1129 <DSoundGetDistance+0x29>
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSoundGetDistance>:
sub    %esi,%edx
mov    %edx,%eax
sar    $0x1f,%eax
and    %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @DSoundGetDistance(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = icmp slt i32 %4, 0
%6 = select i1 %5, i32 %0, i32 0
%7 = add nsw i32 %6, %4
ret i32 %7
}