xunge/DecIR huggingface dataset:
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *dbIDParser(char *header) {
  return tokenParser(header, "|", 1, "dbIDParser");
}


x86 assembly (clang, -O0):
<dbIDParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x1,%edx
lea    0xecf(%rip),%rcx
call   1030 <tokenParser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbIDParser>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <tokenParser@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
@.str.1 = [11 x i8] c"dbIDParser\00"
define i8* @dbIDParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ opx_dreg(char *, char *);
void i_addx_dreg(void) { opx_dreg("adc", ""); }


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

x86 assembly (clang, -O2):
<i_addx_dreg>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <opx_dreg@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"adc\00"
@.str.1 = [1 x i8] zeroinitializer
define void @i_addx_dreg() {
%1 = call i32 @opx_dreg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"adc\00"
@.str.1 = [1 x i8] zeroinitializer
define void @i_addx_dreg() {
%1 = tail call i32 @opx_dreg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int uint64_compare(const void *a, const void *b) {
  uint64_t ai = *(uint64_t *)a;
  uint64_t bi = *(uint64_t *)b;
  if (ai < bi)
    return -1;
  else if (ai > bi)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<uint64_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <uint64_compare+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <uint64_compare+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1156 <uint64_compare+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <uint64_compare+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint64_compare>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @uint64_compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
store i64 %10, i64* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = icmp slt i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = icmp sgt i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @uint64_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
unsigned abs_diff(unsigned goal, unsigned cur) {
  if (goal > cur)
    return goal - cur;
  else
    return cur - goal;
}


x86 assembly (clang, -O0):
<abs_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1124 <abs_diff+0x24>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112d <abs_diff+0x2d>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_diff>:
mov    %esi,%eax
sub    %edi,%eax
neg    %eax
sub    %edi,%esi
cmovae %esi,%eax
ret

LLVM IR (-O0):
define i32 @abs_diff(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* %4
%7 = load i32, i32* %5
%8 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub i32 %10, %11
store i32 %12, i32* %3
br label %17
13: ; preds = %2
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = sub i32 %14, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @abs_diff(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = sub i32 %0, %1
%5 = sub i32 %1, %0
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
void ZthreadGC() {}


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

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

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

LLVM IR (-O2):
define void @ZthreadGC() {
ret void
}
unsigned int cvmx_get_core_num(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cvmx_get_core_num() {
ret i32 0
}
int ASAPInfo_AfterFF(unsigned char const *module, int moduleLen,
                     int currentOffset) {
  while (currentOffset < moduleLen) {
    if (module[currentOffset++] == 255)
      return currentOffset;
  }
  return -1;
}


x86 assembly (clang, -O0):
<ASAPInfo_AfterFF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114b <ASAPInfo_AfterFF+0x4b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xff,%eax
jne    1146 <ASAPInfo_AfterFF+0x46>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <ASAPInfo_AfterFF+0x52>
jmp    110e <ASAPInfo_AfterFF+0xe>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASAPInfo_AfterFF>:
mov    %edx,%eax
movslq %edx,%rdx
cmp    %esi,%edx
cmovg  %edx,%esi
movslq %esi,%rcx
sub    %rdx,%rcx
add    %rdx,%rdi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rdx,%rcx
je     1135 <ASAPInfo_AfterFF+0x35>
lea    0x1(%rdx),%rsi
cmpb   $0xff,(%rdi,%rdx,1)
mov    %rsi,%rdx
jne    1120 <ASAPInfo_AfterFF+0x20>
add    %esi,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ASAPInfo_AfterFF(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
br label %8
8: ; preds = %23, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 1
store i32 %15, i32* %7
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = icmp eq i32 %19, 255
br i1 %20, label %21, label %23
21: ; preds = %12
%22 = load i32, i32* %7
store i32 %22, i32* %4
br label %25
23: ; preds = %12
br label %8
24: ; preds = %8
store i32 -1, i32* %4
br label %25
25: ; preds = %24, %21
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @ASAPInfo_AfterFF(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = call i32 @llvm.smax.i32(i32 %2, i32 %1)
%6 = sext i32 %5 to i64
br label %7
7: ; preds = %10, %3
%8 = phi i64 [ %11, %10 ], [ %4, %3 ]
%9 = icmp eq i64 %8, %6
br i1 %9, label %17, label %10
10: ; preds = %7
%11 = add nsw i64 %8, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %8
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, -1
br i1 %14, label %15, label %7
15: ; preds = %10
%16 = trunc i64 %11 to i32
br label %17
17: ; preds = %7, %15
%18 = phi i32 [ %16, %15 ], [ -1, %7 ]
ret i32 %18
}
/* Variables and functions */
scalar_t__ f();
int main(void) {
  f() + 0;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @f()
%3 = add nsw i64 %2, 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @f()
ret i32 0
}
/* Variables and functions */
double atof(char *);
char *strchr(char *, char);
double readp1_double_withunit(char *line) {
  ;
  line = strchr(line, '(');
  line += sizeof(char);
  char *endvaluepos = strchr(line, '*');
  *endvaluepos = 0;
  return atof(line);
}


x86 assembly (clang, -O0):
<readp1_double_withunit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
call   1040 <strchr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2a,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readp1_double_withunit>:
push   %rbx
mov    $0x28,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%rbx
mov    %rbx,%rdi
mov    $0x2a,%esi
call   1040 <strchr@plt>
movb   $0x0,(%rax)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @readp1_double_withunit(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 40)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i8* @strchr(i8* %8, i8 signext 42)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
store i8 0, i8* %10
%11 = load i8*, i8** %2
%12 = call double @atof(i8* %11)
ret double %12
}

LLVM IR (-O2):
define double @readp1_double_withunit(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 40)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i8* @strchr(i8* %3, i8 signext 42)
store i8 0, i8* %4
%5 = tail call double @atof(i8* %3)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ test_001();
int /*<<< orphan*/ test_002();
void test_main(void) {
  test_001();
  test_002();
}


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

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

LLVM IR (-O0):
define void @test_main() {
%1 = call i32 (...) @test_001()
%2 = call i32 (...) @test_002()
ret void
}

LLVM IR (-O2):
define void @test_main() {
%1 = tail call i32 (...) @test_001()
%2 = tail call i32 (...) @test_002()
ret void
}
void once(void (*func)(void)) {
  static int done;
  if (!done) {
    func();
    done = 1;
  }
}


x86 assembly (clang, -O0):
<once>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2f11(%rip)
jne    1126 <once+0x26>
call   *-0x8(%rbp)
movl   $0x1,0x2efe(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<once>:
push   %rax
cmpb   $0x0,0x2f1c(%rip)
jne    1113 <once+0x13>
call   *%rdi
movb   $0x1,0x2f11(%rip)
pop    %rax
ret

LLVM IR (-O0):
@once.done = internal global i32 0
define void @once(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load i32, i32* @once.done
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load void ()*, void ()** %2
store i32 1, i32* @once.done
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@once.done = internal unnamed_addr global i1 false
define void @once(void ()* nocapture %0) {
%2 = load i1, i1* @once.done
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void %0()
store i1 true, i1* @once.done
br label %4
4: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_FLASH_IN_OUTPUT() { set_io_bit(0x36, 6); }


x86 assembly (clang, -O0):
<TOSH_MAKE_FLASH_IN_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
mov    $0x6,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_FLASH_IN_OUTPUT>:
mov    $0x36,%edi
mov    $0x6,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_FLASH_IN_OUTPUT() {
%1 = call i32 @set_io_bit(i32 54, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_FLASH_IN_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 54, i32 6)
ret void
}
/* Variables and functions */
int *min(int *array, size_t size) {
  int min_val = array[0];
  int i, *min_ptr;
  for (i = 0; i < size; i++) {
    if (array[i] < min_val) {
      min_val = array[i];
    }
  }
  min_ptr = &min_val;
  return min_ptr;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115f <min+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jge    114c <min+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <min+0x51>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <min+0x1c>
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i32* @min(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
store i32 %10, i32* %5
store i32 0, i32* %6
br label %11
11: ; preds = %31, %2
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = load i64, i64* %4
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %34
16: ; preds = %11
%17 = load i32*, i32** %3
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %5
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %30
24: ; preds = %16
%25 = load i32*, i32** %3
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
store i32 %29, i32* %5
br label %30
30: ; preds = %24, %16
br label %31
31: ; preds = %30
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
store i32 %33, i32* %6
br label %11
34: ; preds = %11
store i32* %5, i32** %7
%35 = load i32*, i32** %7
ret i32* %35
}

LLVM IR (-O2):
define noalias i32* @min(i32* nocapture %0, i64 %1) {
%3 = alloca i32
ret i32* %3
}
int conVertToInt32(char elem) { return elem - 48; }


x86 assembly (clang, -O0):
<conVertToInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conVertToInt32>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @conVertToInt32(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @conVertToInt32(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char *);
int /*<<< orphan*/ replace_cursor(int, int /*<<< orphan*/);
int ctrl_a(int i, char **result) {
  if (i != 0) {
    i = 0;
    replace_cursor(i, ft_strlen(*result));
  }
  return (i);
}


x86 assembly (clang, -O0):
<ctrl_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115c <ctrl_a+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <ft_strlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <replace_cursor@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctrl_a>:
test   %edi,%edi
je     113a <ctrl_a+0x1a>
push   %rax
mov    (%rsi),%rdi
call   1040 <ft_strlen@plt>
xor    %edi,%edi
mov    %eax,%esi
call   1030 <replace_cursor@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ctrl_a(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @ft_strlen(i8* %5)
%7 = tail call i32 @replace_cursor(i32 0, i32 %6)
br label %8
8: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *wormIDParser(char *header) {
  return tokenParser(header, " \t", 1, "wormIDParser");
}


x86 assembly (clang, -O0):
<wormIDParser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x1,%edx
lea    0xed0(%rip),%rcx
call   1030 <tokenParser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wormIDParser>:
lea    0xee9(%rip),%rsi
lea    0xee5(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <tokenParser@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
@.str.1 = [13 x i8] c"wormIDParser\00"
define i8* @wormIDParser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @tokenParser(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
@.str.1 = [13 x i8] c"wormIDParser\00"
define i8* @wormIDParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
int eul_rl_initialize() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @eul_rl_initialize() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *spalloc(size_t);
char *sp_strndup(const char *s, size_t n) {
  char *str = spalloc(n + 1);
  memcpy(str, s, n);
  str[n] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<sp_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <spalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1030 <spalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @sp_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @spalloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @sp_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @spalloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ mergeSort(int *, int /*<<< orphan*/, int);
int main() {
  int ar[9] = {45, 1, 2, 46, 1, 4, 7, 89, 9};
  mergeSort(ar, 0, 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1040 <mergeSort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <mergeSort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.ar = [9 x i32] [i32 45, i32 1, i32 2, i32 46, i32 1, i32 4, i32 7, i32 89, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
store i32 0, i32* %1
%3 = bitcast [9 x i32]* %2 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%5 = call i32 @mergeSort(i32* %4, i32 0, i32 9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ar = [9 x i32] [i32 45, i32 1, i32 2, i32 46, i32 1, i32 4, i32 7, i32 89, i32 9]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @mergeSort(i32* %3, i32 0, i32 9)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ si_signo;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ psignal(int /*<<< orphan*/, char const *);
void psiginfo(const siginfo_t *info, const char *s) {
  psignal(info->si_signo, s);
}


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

x86 assembly (clang, -O2):
<psiginfo>:
mov    (%rdi),%edi
jmp    1030 <psignal@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define void @psiginfo(%struct.TYPE_3__* %0, i8* %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i8*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i8* %1, i8** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = call i32 @psignal(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define void @psiginfo(%struct.TYPE_3__* nocapture %0, i8* %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32 @psignal(i32 %4, i8* %1)
ret void
}
unsigned int cmax(unsigned int num1, unsigned int num2) {
  unsigned int result;
  if (num1 > num2)
    result = num1;
  else
    result = num2;
  return result;
}


x86 assembly (clang, -O0):
<cmax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1121 <cmax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <cmax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmax>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cmax(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void USART6_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @USART6_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @USART6_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void bcopy(const void *s2, void *s1, size_t n) { memmove(s1, s2, n); }


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

x86 assembly (clang, -O2):
<bcopy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @bcopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %1, i8* %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __bitmap_and(unsigned long *, unsigned long const *,
                                unsigned long const *, int);
__attribute__((always_)) void bitmap_and(unsigned long *dst,
                                         const unsigned long *src1,
                                         const unsigned long *src2, int nbits) {
  if (nbits <= 32)
    *dst = *src1 & *src2;
  else
    __bitmap_and(dst, src1, src2, nbits);
}


x86 assembly (clang, -O0):
<bitmap_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jg     114b <bitmap_and+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
and    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    115f <bitmap_and+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__bitmap_and@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_and>:
cmp    $0x20,%ecx
jg     111f <bitmap_and+0xf>
mov    (%rdx),%rax
and    (%rsi),%rax
mov    %rax,(%rdi)
ret
jmp    1030 <__bitmap_and@plt>

LLVM IR (-O0):
define void @bitmap_and(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i32
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sle i32 %9, 32
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i64*, i64** %6
%13 = load i64, i64* %12
%14 = load i64*, i64** %7
%15 = load i64, i64* %14
%16 = and i64 %13, %15
%17 = load i64*, i64** %5
store i64 %16, i64* %17
br label %24
18: ; preds = %4
%19 = load i64*, i64** %5
%20 = load i64*, i64** %6
%21 = load i64*, i64** %7
%22 = load i32, i32* %8
%23 = call i32 @__bitmap_and(i64* %19, i64* %20, i64* %21, i32 %22)
br label %24
24: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
define void @bitmap_and(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = icmp slt i32 %3, 33
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = and i64 %8, %7
store i64 %9, i64* %0
br label %12
10: ; preds = %4
%11 = tail call i32 @__bitmap_and(i64* %0, i64* %1, i64* %2, i32 %3)
br label %12
12: ; preds = %10, %6
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_set_expect_reply(void *m, int b) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_set_expect_reply>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_set_expect_reply>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_set_expect_reply(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_set_expect_reply(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int strlen(const char *s) {
  register int __res;
  __asm__("cld\n\t"
          "repne\n\t"
          "scasb\n\t"
          "notl %0\n\t"
          "decl %0"
          : "=c"(__res)
          : "D"(s), "a"(0), "0"(0xffffffff));
  return __res;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cld
repnz scas %es:(%rdi),%al
not    %ecx
dec    %ecx
mov    %ecx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
mov    $0xffffffff,%ecx
cld
repnz scas %es:(%rdi),%al
not    %ecx
dec    %ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 asm "cld\0A\09repne\0A\09scasb\0A\09notl $0\0A\09decl $0", "={cx},{di},{ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %4, i32 0, i32 -1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @strlen(i8* readnone %0) {
%2 = tail call i32 asm "cld\0A\09repne\0A\09scasb\0A\09notl $0\0A\09decl $0", "={cx},{di},{ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 0, i32 -1)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ event;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xreparent_event(void *_p) {
  return (unsigned long)((XEvent *)_p)->xreparent.event;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xreparent_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ display(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  char *abc = "abc";
  char *test = NULL;
  printf("This is a test!\n");
  printf("%s\n", abc);
  display(test);
  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    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [17 x i8] c"This is a test!\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
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* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* null, i8** %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8*, i8** %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %7
%12 = call i32 @display(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@str = [16 x i8] c"This is a test!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @display(i8* null)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void help(char *name, FILE *f) {
  fprintf(f, "Usage: %s <path to topology directory>\n", name);
}


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

x86 assembly (clang, -O2):
<help>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: %s <path to topology directory>\0A\00"
define void @help(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Usage: %s <path to topology directory>\0A\00"
define void @help(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int ten();
int zero();
foo(int k, int j) {
  if (k >= ten()) {
    if (j > k) {
      if (j > zero())
        return j;
    }
  }
  return j + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ten@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jl     1183 <foo+0x63>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    117e <foo+0x5e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <zero@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    1179 <foo+0x59>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118c <foo+0x6c>
jmp    117e <foo+0x5e>
jmp    1183 <foo+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <ten@plt>
cmp    %ebp,%ebx
jle    1141 <foo+0x21>
cmp    %ebp,%eax
jg     1141 <foo+0x21>
xor    %eax,%eax
call   1040 <zero@plt>
cmp    %ebx,%eax
jl     1144 <foo+0x24>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @foo(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* %4
%7 = call i32 (...) @ten()
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i32, i32* %5
%15 = call i32 (...) @zero()
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %5
store i32 %18, i32* %3
br label %24
19: ; preds = %13
br label %20
20: ; preds = %19, %9
br label %21
21: ; preds = %20, %2
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ten()
%4 = icmp sle i32 %3, %0
%5 = icmp sgt i32 %1, %0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 (...) @zero()
%9 = icmp slt i32 %8, %1
br i1 %9, label %12, label %10
10: ; preds = %7, %2
%11 = add nsw i32 %1, 1
br label %12
12: ; preds = %7, %10
%13 = phi i32 [ %11, %10 ], [ %1, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ clrscr();
int /*<<< orphan*/ print(char const *);
void main() {
  const char *msg = "Pythonix!";
  clrscr();
  print(msg);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clrscr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <print@plt>
jmp    1143 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <clrscr@plt>
lea    0xed1(%rip),%rdi
call   1040 <print@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [10 x i8] c"Pythonix!\00"
define void @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 (...) @clrscr()
%3 = load i8*, i8** %1
%4 = call i32 @print(i8* %3)
br label %5
5: ; preds = %5, %0
br label %5
}

LLVM IR (-O2):
@.str = [10 x i8] c"Pythonix!\00"
define void @main() {
%1 = tail call i32 (...) @clrscr()
%2 = tail call i32 @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
br label %3
}
int good1(void) { return __builtin_constant_p("hi"); }


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

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

LLVM IR (-O0):
define i32 @good1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @good1() {
ret i32 1
}
void rop3_92_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S ^ *D;
  stk2 = T | stk3;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_92_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_92_0_0>:
mov    (%rdi),%al
xor    %al,%sil
or     %dl,%sil
xor    %al,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_92_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_92_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %5, %2
%7 = xor i8 %6, %4
store i8 %7, i8* %0
ret void
}
int sum(int n) {
  int sum = 0;
  int i = 1;
  while (i <= n) {
    sum += i;
    i++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1138 <sum+0x38>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sum+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
jle    1118 <sum+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
int isASpace(char c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<isASpace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isASpace+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isASpace>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isASpace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isASpace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void copia_con_i(void) {
  int i;
  extern char linea[], linea_max[];
  i = 0;
  while (linea_max[i] != '\0') {
    linea_max[i] = linea[i];
    i++;
  }
  linea_max[i] = '\0';
}


x86 assembly (clang, -O0):
<copia_con_i>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ec2(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114d <copia_con_i+0x4d>
movslq -0x4(%rbp),%rcx
mov    0x2ec2(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2e9c(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copia_con_i+0xb>
movslq -0x4(%rbp),%rcx
mov    0x2e80(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia_con_i>:
mov    0x2ed1(%rip),%rax
cmpb   $0x0,(%rax)
je     1133 <copia_con_i+0x33>
mov    0x2edd(%rip),%rcx
mov    0x2ebe(%rip),%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rcx),%edx
mov    %dl,(%rax)
add    $0x1,%rcx
cmpb   $0x0,0x1(%rax)
lea    0x1(%rax),%rax
jne    1120 <copia_con_i+0x20>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
@linea_max = external global [0 x i8]
@linea = external global [0 x i8]
define void @copia_con_i() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %8, %3 ], [ 0, %0 ]
%5 = phi i8* [ %9, %3 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), %0 ]
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %4
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = add nuw nsw i64 %4, 1
%9 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %0
%13 = phi i8* [ getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), %0 ], [ %9, %3 ]
store i8 0, i8* %13
ret void
}
int main() {
  int x;
  x = 1;
  x = x ^ 3;
  return x - 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}