xunge/DecIR huggingface dataset:
void swap(int *values, int i, int j) {
  if (i == j) {
    return;
  }
  int tmp = values[i];
  values[i] = values[j];
  values[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    111f <swap+0x1f>
jmp    1151 <swap+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %edx,%esi
je     1116 <swap+0x16>
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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* %5
%9 = load i32, i32* %6
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %32
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
%27 = load i32, i32* %7
%28 = load i32*, i32** %4
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 %27, i32* %31
br label %32
32: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
store i32 %8, i32* %10
br label %12
12: ; preds = %3, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int asciihex2int(char *str) {
  int val;
  sscanf(str, "%X", &val);
  return val;
}


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

x86 assembly (clang, -O2):
<asciihex2int>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%X\00"
define i32 @asciihex2int(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 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 /*<<< orphan*/ testdlr_lib1_func();
int testdlr_plugin_func() {
  printf("++ "
         "testdlr_plugin"
         ": START ++\n");
  testdlr_lib1_func();
  printf("++ "
         "testdlr_plugin"
         ": END ++\n");
  return 0;
}


x86 assembly (clang, -O0):
<testdlr_plugin_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <testdlr_lib1_func@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testdlr_plugin_func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <testdlr_lib1_func@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"++ testdlr_plugin: START ++\0A\00"
@.str.1 = [27 x i8] c"++ testdlr_plugin: END ++\0A\00"
define i32 @testdlr_plugin_func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @testdlr_lib1_func()
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"++ testdlr_plugin: START ++\00"
@str.2 = [26 x i8] c"++ testdlr_plugin: END ++\00"
define i32 @testdlr_plugin_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @testdlr_lib1_func()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
double time_to_double(struct timespec t) {
  double d = (double)t.tv_nsec;
  d /= 1000000000.0;
  d += (double)t.tv_sec;
  return d;
}


x86 assembly (clang, -O0):
<time_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_to_double>:
cvtsi2sd %rsi,%xmm1
divsd  0xef3(%rip),%xmm1
cvtsi2sd %rdi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @time_to_double(i64 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = alloca double
%5 = bitcast %struct.timespec* %3 to { i64, i64 }*
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 0
store i64 %0, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %5, i32 0, i32 1
store i64 %1, i64* %7
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
store double %10, double* %4
%11 = load double, double* %4
%12 = fdiv double %11, 1.000000e+09
store double %12, double* %4
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%14 = load i64, i64* %13
%15 = sitofp i64 %14 to double
%16 = load double, double* %4
%17 = fadd double %16, %15
store double %17, double* %4
%18 = load double, double* %4
ret double %18
}

LLVM IR (-O2):
define double @time_to_double(i64 %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fdiv double %3, 1.000000e+09
%5 = sitofp i64 %0 to double
%6 = fadd double %4, %5
ret double %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlADCSpeedSet(uint32_t ui32Speed) {

  ;
  (*((volatile uint32_t *)(0x400FE100))) =
      (((*((volatile uint32_t *)(0x400FE100))) & ~(0x00000C00 | 0x00000300)) |
       ui32Speed);
  (*((volatile uint32_t *)(0x400FE110))) =
      (((*((volatile uint32_t *)(0x400FE110))) & ~(0x00000F00)) | ui32Speed);
}


x86 assembly (clang, -O0):
<SysCtlADCSpeedSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x400fe100,%eax
mov    (%rax),%ecx
and    $0xfffff0ff,%ecx
or     -0x4(%rbp),%ecx
mov    $0x400fe100,%eax
mov    %ecx,(%rax)
mov    $0x400fe110,%eax
mov    (%rax),%ecx
and    $0xfffff0ff,%ecx
or     -0x4(%rbp),%ecx
mov    $0x400fe110,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlADCSpeedSet>:
mov    $0xfffff0ff,%eax
mov    0x400fe100,%ecx
and    %eax,%ecx
or     %edi,%ecx
mov    %ecx,0x400fe100
and    0x400fe110,%eax
or     %edi,%eax
mov    %eax,0x400fe110
ret

LLVM IR (-O0):
define void @SysCtlADCSpeedSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 1074782464 to i32*)
%4 = and i32 %3, -3841
%5 = load i32, i32* %2
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 1074782464 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1074782480 to i32*)
%8 = and i32 %7, -3841
%9 = load i32, i32* %2
%10 = or i32 %8, %9
store volatile i32 %10, i32* inttoptr (i64 1074782480 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlADCSpeedSet(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1074782464 to i32*)
%3 = and i32 %2, -3841
%4 = or i32 %3, %0
store volatile i32 %4, i32* inttoptr (i64 1074782464 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1074782480 to i32*)
%6 = and i32 %5, -3841
%7 = or i32 %6, %0
store volatile i32 %7, i32* inttoptr (i64 1074782480 to i32*)
ret void
}
/* Type definitions */
struct message_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ascii_lengthz(char *);
unsigned int message_putbuffer(struct message_data *, int /*<<< orphan*/,
                               char *, unsigned int);
unsigned int message_putstringz(struct message_data *data, char *string,
                                unsigned int offset) {
  return message_putbuffer(data, ascii_lengthz(string), string, offset);
}


x86 assembly (clang, -O0):
<message_putstringz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ascii_lengthz@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <message_putbuffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message_putstringz>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1040 <ascii_lengthz@plt>
mov    %rbp,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <message_putbuffer@plt>

LLVM IR (-O0):
%struct.message_data = type { i32 }
define i32 @message_putstringz(%struct.message_data* %0, i8* %1, i32 %2) {
%4 = alloca %struct.message_data*
%5 = alloca i8*
%6 = alloca i32
store %struct.message_data* %0, %struct.message_data** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.message_data*, %struct.message_data** %4
%8 = load i8*, i8** %5
%9 = call i32 @ascii_lengthz(i8* %8)
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @message_putbuffer(%struct.message_data* %7, i32 %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.message_data = type { i32 }
define i32 @message_putstringz(%struct.message_data* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ascii_lengthz(i8* %1)
%5 = tail call i32 @message_putbuffer(%struct.message_data* %0, i32 %4, i8* %1, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct okcash_h256 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sha3_256(int /*<<< orphan*/ *, int,
                            int /*<<< orphan*/ const *, size_t const);
void SHA3_256(struct okcash_h256 const *ret, uint8_t const *data,
              size_t const size) {
  sha3_256((uint8_t *)ret, 32, data, size);
}


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

x86 assembly (clang, -O2):
<SHA3_256>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x20,%esi
jmp    1030 <sha3_256@plt>

LLVM IR (-O0):
%struct.okcash_h256 = type { i32 }
define void @SHA3_256(%struct.okcash_h256* %0, i32* %1, i64 %2) {
%4 = alloca %struct.okcash_h256*
%5 = alloca i32*
%6 = alloca i64
store %struct.okcash_h256* %0, %struct.okcash_h256** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load %struct.okcash_h256*, %struct.okcash_h256** %4
%8 = bitcast %struct.okcash_h256* %7 to i32*
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = call i32 @sha3_256(i32* %8, i32 32, i32* %9, i64 %10)
ret void
}

LLVM IR (-O2):
%struct.okcash_h256 = type { i32 }
define void @SHA3_256(%struct.okcash_h256* %0, i32* %1, i64 %2) {
%4 = getelementptr %struct.okcash_h256, %struct.okcash_h256* %0, i64 0, i32 0
%5 = tail call i32 @sha3_256(i32* %4, i32 32, i32* %1, i64 %2)
ret void
}
unsigned char inb(const unsigned short port) {
  unsigned char val;
  __asm__ __volatile__("inb  %w1, %0" : "=a"(val) : "dN"(port));
  return val;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w}, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
int ValidType(int type) {
  switch (type) {
  case 1:
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
  case 7:
  case 8:
  case 9:
  case 10:
  case 11:
  case 12:
  case 13:
  case 14:
  case 15:
  case 16:
  case 17:
  case 18:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ValidType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x11,%eax
ja     1127 <ValidType+0x27>
jmp    111b <ValidType+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <ValidType+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValidType>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x12,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ValidType(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 18
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World 2!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello World 2!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cprintf(char *);
int /*<<< orphan*/ textattr(int);
void about() {
  textattr(0x0A);
  cprintf("\n\rAbout QFSemu\n\r");
  textattr(0x0F);
  cprintf("\n\rQFSemu v1.00\n\rQuick File System emulator\n\rWithout dynamic "
          "memory allocation\n\r");
  cprintf("\n\r(c) Copyright 2005, vbmacher");
}


x86 assembly (clang, -O0):
<about>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <textattr@plt>
lea    0xecb(%rip),%rdi
call   1040 <cprintf@plt>
mov    $0xf,%edi
call   1030 <textattr@plt>
lea    0xec6(%rip),%rdi
call   1040 <cprintf@plt>
lea    0xf0a(%rip),%rdi
call   1040 <cprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<about>:
push   %rax
mov    $0xa,%edi
call   1030 <textattr@plt>
lea    0xece(%rip),%rdi
call   1040 <cprintf@plt>
mov    $0xf,%edi
call   1030 <textattr@plt>
lea    0xec9(%rip),%rdi
call   1040 <cprintf@plt>
lea    0xf0d(%rip),%rdi
pop    %rax
jmp    1040 <cprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\0DAbout QFSemu\0A\0D\00"
@.str.1 = [80 x i8] c"\0A\0DQFSemu v1.00\0A\0DQuick File System emulator\0A\0DWithout dynamic memory allocation\0A\0D\00"
@.str.2 = [31 x i8] c"\0A\0D(c) Copyright 2005, vbmacher\00"
define void @about() {
%1 = call i32 @textattr(i32 10)
%2 = call i32 @cprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @textattr(i32 15)
%4 = call i32 @cprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @cprintf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\0DAbout QFSemu\0A\0D\00"
@.str.1 = [80 x i8] c"\0A\0DQFSemu v1.00\0A\0DQuick File System emulator\0A\0DWithout dynamic memory allocation\0A\0D\00"
@.str.2 = [31 x i8] c"\0A\0D(c) Copyright 2005, vbmacher\00"
define void @about() {
%1 = tail call i32 @textattr(i32 10)
%2 = tail call i32 @cprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @textattr(i32 15)
%4 = tail call i32 @cprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @cprintf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, i, count = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    count = count + i;
  }
  printf("%d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1170 <main+0x50>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
mov    -0x10(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    114f <main+0x2f>
lea    -0x1(%rax),%ecx
lea    -0x2(%rax),%edx
imul   %rcx,%rdx
shr    %rdx
lea    (%rdx,%rax,2),%esi
add    $0xffffffff,%esi
jmp    1151 <main+0x31>
xor    %esi,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %17, label %6
6: ; preds = %0
%7 = shl nuw i32 %4, 1
%8 = add nsw i32 %4, -1
%9 = zext i32 %8 to i33
%10 = add nsw i32 %4, -2
%11 = zext i32 %10 to i33
%12 = mul i33 %9, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = add i32 %7, %14
%16 = add i32 %15, -1
br label %17
17: ; preds = %6, %0
%18 = phi i32 [ 0, %0 ], [ %16, %6 ]
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_exit(int *);
void egs_exit_(int *status) { my_exit(status); }


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

x86 assembly (clang, -O2):
<egs_exit_>:
jmp    1030 <my_exit@plt>

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

LLVM IR (-O2):
define void @egs_exit_(i32* %0) {
%2 = tail call i32 @my_exit(i32* %0)
ret void
}
void funcSizeof() { int a = sizeof(int); }


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

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

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

LLVM IR (-O2):
define void @funcSizeof() {
ret void
}
void clearForeground(void) {
  int i;
  for (i = 0; i < 25 * 80 * 2; i += 2) {
    *((char *)((void *)0xB8000) + i) = ' ';
  }
}


x86 assembly (clang, -O0):
<clearForeground>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xfa0,-0x4(%rbp)
jge    1133 <clearForeground+0x33>
movslq -0x4(%rbp),%rcx
mov    $0xb8000,%eax
movb   $0x20,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <clearForeground+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearForeground>:
mov    $0xfffffffffffffffe,%rax
mov    $0xb800e,%ecx
nopl   0x0(%rax)
movb   $0x20,-0xc(%rcx,%rax,1)
movb   $0x20,-0xa(%rcx,%rax,1)
movb   $0x20,-0x8(%rcx,%rax,1)
movb   $0x20,-0x6(%rcx,%rax,1)
movb   $0x20,-0x4(%rcx,%rax,1)
movb   $0x20,-0x2(%rcx,%rax,1)
movb   $0x20,(%rcx,%rax,1)
movb   $0x20,0x2(%rcx,%rax,1)
add    $0x10,%rax
cmp    $0xf9e,%rax
jb     1110 <clearForeground+0x10>
ret

LLVM IR (-O0):
define void @clearForeground() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 4000
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %7
store i8 32, i8* %8
br label %9
9: ; preds = %5
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 2
store i32 %11, i32* %1
br label %2
12: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @clearForeground() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %18, %1 ]
%3 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %2
store i8 32, i8* %3
%4 = or i64 %2, 2
%5 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %4
store i8 32, i8* %5
%6 = or i64 %2, 4
%7 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %6
store i8 32, i8* %7
%8 = or i64 %2, 6
%9 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %8
store i8 32, i8* %9
%10 = or i64 %2, 8
%11 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %10
store i8 32, i8* %11
%12 = or i64 %2, 10
%13 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %12
store i8 32, i8* %13
%14 = or i64 %2, 12
%15 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %14
store i8 32, i8* %15
%16 = or i64 %2, 14
%17 = getelementptr inbounds i8, i8* inttoptr (i64 753664 to i8*), i64 %16
store i8 32, i8* %17
%18 = add nuw nsw i64 %2, 16
%19 = icmp ult i64 %16, 3998
br i1 %19, label %1, label %20
20: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Git World!");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Hello Git World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ sbox32_hash_with_state(unsigned char *,
                                          unsigned char const *, int const);
int /*<<< orphan*/ sbox32_seed_state96(unsigned char const *, unsigned char *);
uint32_t sbox32_hash96(const unsigned char *seed_ch, const unsigned char *key,
                       const int key_len) {
  uint32_t state[(1 + (256 * 256))];
  sbox32_seed_state96(seed_ch, (unsigned char *)state);
  return sbox32_hash_with_state((unsigned char *)state, key, key_len);
}


x86 assembly (clang, -O0):
<sbox32_hash96>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40020(%rbp),%rsi
call   1040 <sbox32_seed_state96@plt>
lea    -0x40020(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <sbox32_hash_with_state@plt>
add    $0x40020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbox32_hash96>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40010,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <sbox32_seed_state96@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <sbox32_hash_with_state@plt>
add    $0x40010,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sbox32_hash96(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [65537 x i32]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds [65537 x i32], [65537 x i32]* %7, i64 0, i64 0
%10 = bitcast i32* %9 to i8*
%11 = call i32 @sbox32_seed_state96(i8* %8, i8* %10)
%12 = getelementptr inbounds [65537 x i32], [65537 x i32]* %7, i64 0, i64 0
%13 = bitcast i32* %12 to i8*
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @sbox32_hash_with_state(i8* %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @sbox32_hash96(i8* %0, i8* %1, i32 %2) {
%4 = alloca [65537 x i32]
%5 = bitcast [65537 x i32]* %4 to i8*
%6 = call i32 @sbox32_seed_state96(i8* %0, i8* %5)
%7 = call i32 @sbox32_hash_with_state(i8* %5, i8* %1, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ mknod(char *, char, int /*<<< orphan*/);
int main() {
  mknod("testfile", 'b', 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x62,%esi
xor    %edx,%edx
call   1030 <mknod@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x62,%esi
xor    %edx,%edx
call   1030 <mknod@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"testfile\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext 98, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"testfile\00"
define i32 @main() {
%1 = tail call i32 @mknod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext 98, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void display_full_command(char *command) {
  char *cmdLine = malloc(514 * sizeof(char));
  sprintf(cmdLine, "%s", command);
  write(STDOUT_FILENO, cmdLine, strlen(cmdLine));
  free(cmdLine);
}


x86 assembly (clang, -O0):
<display_full_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x202,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1070 <sprintf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_full_command>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x202,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@STDOUT_FILENO = global i32 0
define void @display_full_command(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 514)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @STDOUT_FILENO
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @write(i32 %8, i8* %9, i32 %11)
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @display_full_command(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(514) i8* @malloc(i32 514)
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %2, i8* dereferenceable(1) %0)
%4 = load i32, i32* @STDOUT_FILENO
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call i32 @write(i32 %4, i8* %2, i32 %5)
%7 = tail call i32 @free(i8* %2)
ret void
}
int get_rank_int(char rank_chr) {
  if (rank_chr >= '1' && rank_chr <= '8')
    return 7 - (int)(rank_chr - '1');
  return -1;
}


x86 assembly (clang, -O0):
<get_rank_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jl     113a <get_rank_int+0x3a>
movsbl -0x5(%rbp),%eax
cmp    $0x38,%eax
jg     113a <get_rank_int+0x3a>
movsbl -0x5(%rbp),%ecx
sub    $0x31,%ecx
mov    $0x7,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <get_rank_int+0x41>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rank_int>:
lea    -0x31(%rdi),%eax
mov    $0x38,%ecx
sub    %edi,%ecx
cmp    $0x8,%al
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_rank_int(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 49
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, 56
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 49
%15 = sub nsw i32 7, %14
store i32 %15, i32* %2
br label %17
16: ; preds = %7, %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_rank_int(i8 signext %0) {
%2 = add i8 %0, -49
%3 = icmp ult i8 %2, 8
%4 = sext i8 %0 to i32
%5 = sub nsw i32 56, %4
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
/* Variables and functions */
int c(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, const char *argv[]) {
  int m, n;
  scanf("%d%d", &m, &n);
  printf("%d\n", c(m, n));
  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)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <c@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <c@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @c(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
unsigned char msg_send(int, unsigned char *, int);
unsigned char ANT_OpenChannel(unsigned char chan) {
  return msg_send(0x4b, &chan, 1);
}


x86 assembly (clang, -O0):
<ANT_OpenChannel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x4b,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <msg_send@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANT_OpenChannel>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x4b,%edi
mov    $0x1,%edx
call   1030 <msg_send@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @ANT_OpenChannel(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call zeroext i8 @msg_send(i32 75, i8* %2, i32 1)
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @ANT_OpenChannel(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call zeroext i8 @msg_send(i32 75, i8* %2, i32 1)
ret i8 %3
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int is_https(char *p) { return strncmp(p, "https://", 8) == 0; }


x86 assembly (clang, -O0):
<is_https>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_https>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"https://\00"
define i32 @is_https(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [9 x i8] c"https://\00"
define i32 @is_https(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void vec2_negate(float *dst) {
  dst[0] = -dst[0];
  dst[1] = -dst[1];
}


x86 assembly (clang, -O0):
<vec2_negate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_negate>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movaps 0xef0(%rip),%xmm2
xorps  %xmm2,%xmm0
movss  %xmm0,(%rdi)
xorps  %xmm2,%xmm1
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @vec2_negate(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = fneg float %5
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = fneg float %11
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
ret void
}

LLVM IR (-O2):
define void @vec2_negate(float* nocapture %0) {
%2 = load float, float* %0
%3 = fneg float %2
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fneg float %5
store float %6, float* %4
ret void
}
void __unlock() { asm volatile("sti" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @__unlock() {
tail call void asm sideeffect "sti", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GMP_RNDU;
int /*<<< orphan*/ mpfr_set_default_rounding_mode(int /*<<< orphan*/);
double sub_hi(double x, double y) {
  mpfr_set_default_rounding_mode(GMP_RNDU);
  ;
  return (x - y);
}


x86 assembly (clang, -O0):
<sub_hi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_hi>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@GMP_RNDU = global i32 0
define double @sub_hi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @GMP_RNDU
%6 = call i32 @mpfr_set_default_rounding_mode(i32 %5)
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
ret double %9
}

LLVM IR (-O2):
@GMP_RNDU = global i32 0
define double @sub_hi(double %0, double %1) {
%3 = load i32, i32* @GMP_RNDU
%4 = tail call i32 @mpfr_set_default_rounding_mode(i32 %3)
%5 = fsub double %0, %1
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *openFile(char *path, int binary) {
  return fopen(path, binary ? "rb" : "r");
}


x86 assembly (clang, -O0):
<openFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xed6(%rip),%rsi
lea    0xecc(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
call   1030 <fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFile>:
test   %esi,%esi
lea    0xeea(%rip),%rax
lea    0xee0(%rip),%rsi
cmove  %rax,%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [2 x i8] c"r\00"
define i32* @openFile(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%10 = call i32* @fopen(i8* %5, i8* %9)
ret i32* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [2 x i8] c"r\00"
define noalias i32* @openFile(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32* @fopen(i8* %0, i8* %4)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigalrm_handler(int signum) { exit(0); }


x86 assembly (clang, -O0):
<sigalrm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @sigalrm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigalrm_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ADCReferenceGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000038))) & 0x00000003);
}


x86 assembly (clang, -O0):
<ADCReferenceGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCReferenceGet>:
movslq %edi,%rax
mov    0x38(%rax),%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @ADCReferenceGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 56
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ADCReferenceGet(i32 %0) {
%2 = add nsw i32 %0, 56
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 3
ret i32 %6
}
/* Variables and functions */
scalar_t__ isalnum(char);
scalar_t__ isspace(char);
int is_directory_order(char character) {
  return (isalnum(character) || isspace(character)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_directory_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <is_directory_order+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_directory_order>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_directory_order+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_directory_order(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @isspace(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_directory_order(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isspace(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
outhexb(number) int number;
{
  leaderx();
  hexb(number & 255);
}


x86 assembly (clang, -O0):
<outhexb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <leaderx@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
mov    $0x0,%al
call   1040 <hexb@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outhexb>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <leaderx@plt>
movzbl %bl,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <hexb@plt>

LLVM IR (-O0):
define i32 @outhexb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @leaderx()
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = call i32 (i32, ...) bitcast (i32 (...)* @hexb to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @outhexb(i32 %0) {
%2 = tail call i32 (...) @leaderx()
%3 = and i32 %0, 255
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @hexb to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
void onHourChanged() {}


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

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

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

LLVM IR (-O2):
define void @onHourChanged() {
ret void
}