xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main(int argc, char *argv[]) {
  int hoge;
  int *hoge_p;
  hoge_p = &hoge;
  printf("hoge_p.. %p\n", hoge_p);
  hoge_p++;
  printf("hoge_p.. %p\n", hoge_p);
  printf("hoge_p.. %p\n", hoge_p + 3);
  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    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
add    $0xc,%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hoge_p.. %p\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
store i32* %6, i32** %7
%8 = load i32*, i32** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = load i32*, i32** %7
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %7
%12 = load i32*, i32** %7
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %12)
%14 = load i32*, i32** %7
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"hoge_p.. %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = getelementptr inbounds i32, i32* %3, i64 1
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = getelementptr inbounds i32, i32* %3, i64 4
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %8)
ret i32 0
}
/* Variables and functions */
int fakultaet(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int eingabe;
  printf("Bitte eine Zahl eingeben\n");
  scanf("%d", &eingabe);
  printf("%d\n", fakultaet(eingabe));
  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
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1030 <fakultaet@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fakultaet@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Bitte eine Zahl eingeben\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @fakultaet(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [25 x i8] c"Bitte eine Zahl eingeben\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @fakultaet(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
struct decision {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_modes(struct decision *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  struct decision *p = 0;
  clear_modes(p);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <clear_modes@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%struct.decision = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.decision*
store i32 0, i32* %1
store %struct.decision* null, %struct.decision** %2
%3 = load %struct.decision*, %struct.decision** %2
%4 = call i32 @clear_modes(%struct.decision* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.decision = type { i32 }
define i32 @main() {
%1 = tail call i32 @clear_modes(%struct.decision* null)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outcomma();
int /*<<< orphan*/ outnl();
int /*<<< orphan*/ outstackreg();
void outncspregname() {
  outcomma();
  outstackreg();
  outnl();
}


x86 assembly (clang, -O0):
<outncspregname>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <outcomma@plt>
mov    $0x0,%al
call   1050 <outstackreg@plt>
mov    $0x0,%al
call   1040 <outnl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outncspregname>:
push   %rax
xor    %eax,%eax
call   1030 <outcomma@plt>
xor    %eax,%eax
call   1050 <outstackreg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <outnl@plt>

LLVM IR (-O0):
define void @outncspregname() {
%1 = call i32 (...) @outcomma()
%2 = call i32 (...) @outstackreg()
%3 = call i32 (...) @outnl()
ret void
}

LLVM IR (-O2):
define void @outncspregname() {
%1 = tail call i32 (...) @outcomma()
%2 = tail call i32 (...) @outstackreg()
%3 = tail call i32 (...) @outnl()
ret void
}
char Down(char c) { return ('A' <= c && c <= 'Z') ? c + 32 : c; }


x86 assembly (clang, -O0):
<Down>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1137 <Down+0x37>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1137 <Down+0x37>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <Down+0x3e>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @Down(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
unsigned char gmul_inverse(unsigned char);
unsigned char sbox(unsigned char in) {
  unsigned char c, s, x;
  s = x = gmul_inverse(in);
  for (c = 0; c < 4; c++) {
    s = (s << 1) | (s >> 7);
    x ^= s;
  }
  x ^= 99;
  return x;
}


x86 assembly (clang, -O0):
<sbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <gmul_inverse@plt>
mov    %al,-0x4(%rbp)
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x4,%eax
jge    116b <sbox+0x5b>
movzbl -0x3(%rbp),%eax
shl    $0x1,%eax
movzbl -0x3(%rbp),%ecx
sar    $0x7,%ecx
or     %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%ecx
movzbl -0x4(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x4(%rbp)
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1131 <sbox+0x21>
movzbl -0x4(%rbp),%eax
xor    $0x63,%eax
mov    %al,-0x4(%rbp)
movzbl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbox>:
push   %rax
call   1030 <gmul_inverse@plt>
mov    %eax,%ecx
rol    %cl
xor    %al,%cl
mov    %eax,%esi
rol    $0x2,%sil
mov    %eax,%edx
rol    $0x3,%dl
xor    %sil,%dl
xor    %cl,%dl
rol    $0x4,%al
xor    %dl,%al
xor    $0x63,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @sbox(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %2
%6 = load i8, i8* %2
%7 = call zeroext i8 @gmul_inverse(i8 zeroext %6)
store i8 %7, i8* %5
store i8 %7, i8* %4
store i8 0, i8* %3
br label %8
8: ; preds = %27, %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %30
12: ; preds = %8
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 1
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = ashr i32 %17, 7
%19 = or i32 %15, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %4
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = xor i32 %24, %22
%26 = trunc i32 %25 to i8
store i8 %26, i8* %5
br label %27
27: ; preds = %12
%28 = load i8, i8* %3
%29 = add i8 %28, 1
store i8 %29, i8* %3
br label %8
30: ; preds = %8
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, 99
%34 = trunc i32 %33 to i8
store i8 %34, i8* %5
%35 = load i8, i8* %5
ret i8 %35
}

LLVM IR (-O2):
define zeroext i8 @sbox(i8 zeroext %0) {
%2 = tail call zeroext i8 @gmul_inverse(i8 zeroext %0)
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 1)
%4 = xor i8 %2, %3
%5 = tail call i8 @llvm.fshl.i8(i8 %3, i8 %3, i8 1)
%6 = xor i8 %4, %5
%7 = tail call i8 @llvm.fshl.i8(i8 %5, i8 %5, i8 1)
%8 = xor i8 %6, %7
%9 = tail call i8 @llvm.fshl.i8(i8 %7, i8 %7, i8 1)
%10 = xor i8 %8, %9
%11 = xor i8 %10, 99
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x23() {
  Assert_real((isalpha(35) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              180, ("isalpha should be 0 for #"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x23>:
push   %rax
mov    $0x23,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xb4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for #\00"
define void @t_isalpha_0x23() {
%1 = call i64 @isalpha(i32 35)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for #\00"
define void @t_isalpha_0x23() {
%1 = tail call i64 @isalpha(i32 35)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void cmp_ori_deinit(struct CmpOri *ori) { (void)ori; }


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

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

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

LLVM IR (-O2):
%struct.CmpOri = type opaque
define void @cmp_ori_deinit(%struct.CmpOri* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void rtp2435_set_q(uint8_t *header, uint8_t q) { header[5] = q; }


x86 assembly (clang, -O0):
<rtp2435_set_q>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp2435_set_q>:
mov    %esi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @rtp2435_set_q(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 5
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @rtp2435_set_q(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void __attribute__((__noreturn__)) error(void) {
  if (errno) {
    perror("tee");
  } else {
    fprintf(stderr, "Unknown error\n");
  }
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     1156 <error+0x26>
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
jmp    116b <error+0x3b>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    0x2ea0(%rip),%rax
cmpq   $0x0,(%rax)
je     1158 <error+0x28>
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
jmp    114a <error+0x1a>

LLVM IR (-O0):
@errno = global i64 0
@.str = [4 x i8] c"tee\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"Unknown error\0A\00"
@EXIT_FAILURE = global i32 0
define void @error() {
%1 = load i64, i64* @errno
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %3
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [4 x i8] c"tee\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"Unknown error\0A\00"
@EXIT_FAILURE = global i32 0
define void @error() {
%1 = load i64, i64* @errno
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %3
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int ls_cost_nm10_f0(double const **, double **, int *, double *, int);
int ls_cost_nm10(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return ls_cost_nm10_f0(arg, res, iw, w, mem);
}


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

x86 assembly (clang, -O2):
<ls_cost_nm10>:
jmp    1030 <ls_cost_nm10_f0@plt>

LLVM IR (-O0):
define i32 @ls_cost_nm10(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @ls_cost_nm10_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ls_cost_nm10(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @ls_cost_nm10_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ testInit();
int main() {
  if (!testInit()) {
    return 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 <testInit@plt>
cmp    $0x0,%eax
jne    113b <main+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <main+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testInit()
ret i32 0
}
/* Variables and functions */
scalar_t__ lc_MEASUREMENT();
int Ada_lc_MEASUREMENT() {
  int jresult;
  int result;
  result = (int)lc_MEASUREMENT();
  jresult = result;
  return jresult;
}


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

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

LLVM IR (-O0):
define i32 @Ada_lc_MEASUREMENT() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @lc_MEASUREMENT()
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @Ada_lc_MEASUREMENT() {
%1 = tail call i64 (...) @lc_MEASUREMENT()
%2 = trunc i64 %1 to i32
ret i32 %2
}
int do_746() { return 746; }


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

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

LLVM IR (-O0):
define i32 @do_746() {
ret i32 746
}

LLVM IR (-O2):
define i32 @do_746() {
ret i32 746
}
void eglWaitNative(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglWaitNative() {
ret void
}
float f(void) { return 0; }


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

x86 assembly (clang, -O2):
<f>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f() {
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @f() {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void work_a_3219856015_3777409210_init() {
  xsi_register_didat(
      "work_a_3219856015_3777409210",
      "isim/Inst_Mem_ts_isim_beh.exe.sim/work/a_3219856015_3777409210.didat");
}


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

x86 assembly (clang, -O2):
<work_a_3219856015_3777409210_init>:
lea    0xee9(%rip),%rdi
lea    0xeff(%rip),%rsi
jmp    1030 <xsi_register_didat@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"work_a_3219856015_3777409210\00"
@.str.1 = [69 x i8] c"isim/Inst_Mem_ts_isim_beh.exe.sim/work/a_3219856015_3777409210.didat\00"
define void @work_a_3219856015_3777409210_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"work_a_3219856015_3777409210\00"
@.str.1 = [69 x i8] c"isim/Inst_Mem_ts_isim_beh.exe.sim/work/a_3219856015_3777409210.didat\00"
define void @work_a_3219856015_3777409210_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spawn_square();
void init_grid() {
  spawn_square();
  spawn_square();
}


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

x86 assembly (clang, -O2):
<init_grid>:
push   %rax
xor    %eax,%eax
call   1030 <spawn_square@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <spawn_square@plt>

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

LLVM IR (-O2):
define void @init_grid() {
%1 = tail call i32 (...) @spawn_square()
%2 = tail call i32 (...) @spawn_square()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ diminuto_fd_readable_generic(int, int /*<<< orphan*/);
ssize_t diminuto_fd_readable(int fd) {
  return diminuto_fd_readable_generic(fd, 0);
}


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

x86 assembly (clang, -O2):
<diminuto_fd_readable>:
xor    %esi,%esi
jmp    1030 <diminuto_fd_readable_generic@plt>

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

LLVM IR (-O2):
define i32 @diminuto_fd_readable(i32 %0) {
%2 = tail call i32 @diminuto_fd_readable_generic(i32 %0, i32 0)
ret i32 %2
}
void test2() {
  int i;
  double d = i;
  double _Complex a = 5;
  test1(a);
  a = 5;
  d = i;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    $0x2,%al
call   1030 <test1@plt>
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
movsd  0xee8(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
jmp    1030 <test1@plt>

LLVM IR (-O0):
define void @test2() {
%1 = alloca i32
%2 = alloca double
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = load i32, i32* %1
%6 = sitofp i32 %5 to double
store double %6, double* %2
%7 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double 5.000000e+00, double* %7
store double 0.000000e+00, double* %8
%9 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%10 = load double, double* %9
%11 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%12 = load double, double* %11
%13 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%14 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %10, double* %13
store double %12, double* %14
%15 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%16 = load double, double* %15
%17 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%18 = load double, double* %17
%19 = call i32 (double, double, ...) bitcast (i32 (...)* @test1 to i32 (double, double, ...)*)(double %16, double %18)
%20 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double 5.000000e+00, double* %20
store double 0.000000e+00, double* %21
%22 = load i32, i32* %1
%23 = sitofp i32 %22 to double
store double %23, double* %2
ret void
}

LLVM IR (-O2):
define void @test2() {
%1 = tail call i32 (double, double, ...) bitcast (i32 (...)* @test1 to i32 (double, double, ...)*)(double 5.000000e+00, double 0.000000e+00)
ret void
}
int do_045() { return 45; }


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

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

LLVM IR (-O0):
define i32 @do_045() {
ret i32 45
}

LLVM IR (-O2):
define i32 @do_045() {
ret i32 45
}
int fun1299() { return 1299; }


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

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

LLVM IR (-O0):
define i32 @fun1299() {
ret i32 1299
}

LLVM IR (-O2):
define i32 @fun1299() {
ret i32 1299
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void check_path(char *path) {
  if (access(path, F_OK) == -1) {
    fprintf(stderr, "%s is not a valid path\n", path);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    117a <check_path+0x4a>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_path>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
je     1149 <check_path+0x19>
pop    %rbx
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@F_OK = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"%s is not a valid path\0A\00"
define void @check_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@F_OK = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"%s is not a valid path\0A\00"
define void @check_path(i8* %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
int _set_color(char character, int color) {
  return (((int)character) & 0xFF) | (color << 8);
}


x86 assembly (clang, -O0):
<_set_color>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_color>:
movzbl %dil,%eax
shl    $0x8,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @_set_color(i8 signext %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 = sext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i32, i32* %4
%9 = shl i32 %8, 8
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @_set_color(i8 signext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
int test_imm_FBint16_reg(short val) {
  return ((val) & (0xFB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FBint16_reg(i16 signext %0) {
%2 = and i16 %0, 251
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int bar_int(void) { return __real__(foo_int(2 - 3i)); }


x86 assembly (clang, -O0):
<bar_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <foo_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_int>:
movabs $0xfffffffd00000002,%rdi
ff ff ff
xor    %eax,%eax
jmp    1030 <foo_int@plt>

LLVM IR (-O0):
define i32 @bar_int() {
%1 = alloca { i32, i32 }
%2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 1
store i32 2, i32* %2
store i32 -3, i32* %3
%4 = bitcast { i32, i32 }* %1 to i64*
%5 = load i64, i64* %4
%6 = call i32 (i64, ...) bitcast (i32 (...)* @foo_int to i32 (i64, ...)*)(i64 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @bar_int() {
%1 = tail call i32 (i64, ...) bitcast (i32 (...)* @foo_int to i32 (i64, ...)*)(i64 -12884901886)
ret i32 %1
}
char *findWhitespace(char *p) {
  while (*p && *p != ' ' && *p != '\t')
    p++;
  return p;
}


x86 assembly (clang, -O0):
<findWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <findWhitespace+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1142 <findWhitespace+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <findWhitespace+0x52>
jmp    1163 <findWhitespace+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <findWhitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findWhitespace>:
mov    %rdi,%rax
movabs $0x100000201,%rcx
jmp    1114 <findWhitespace+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1110 <findWhitespace+0x10>
bt     %rdx,%rcx
jae    1110 <findWhitespace+0x10>
ret

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

LLVM IR (-O2):
define i8* @findWhitespace(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t si470x_getfreq() {}


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

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

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

LLVM IR (-O2):
define i32 @si470x_getfreq() {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t le32getv(void *p) {
  uint8_t *a;
  uint32_t v;
  a = p;
  v = a[0];
  v |= a[1] << 8;
  v |= a[2] << 16;
  v |= a[3] << 24;
  return v;
}


x86 assembly (clang, -O0):
<le32getv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le32getv>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @le32getv(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = load i32, i32* %4
%15 = or i32 %14, %13
store i32 %15, i32* %4
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = shl i32 %18, 16
%20 = load i32, i32* %4
%21 = or i32 %20, %19
store i32 %21, i32* %4
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
%24 = load i32, i32* %23
%25 = shl i32 %24, 24
%26 = load i32, i32* %4
%27 = or i32 %26, %25
store i32 %27, i32* %4
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @le32getv(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Helloe"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [7 x i8] c"Helloe\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Helloe\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void misc(void) {
  unsigned x = 0;
  x = x ? (unsigned)sizeof(x) : 1;
  x++, x++;
}


x86 assembly (clang, -O0):
<misc>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
mov    $0x4,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @misc() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 4, i32 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = add i32 %8, 1
store i32 %9, i32* %1
ret void
}

LLVM IR (-O2):
define void @misc() {
ret void
}
/* Variables and functions */
int UINT_MAX;
int urand();
int brand(void) { return (urand() > UINT_MAX / 2) ? 1 : 0; }


x86 assembly (clang, -O0):
<brand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <urand@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x4(%rbp),%edx
mov    %eax,%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brand>:
push   %rax
xor    %eax,%eax
call   1030 <urand@plt>
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
xor    %ecx,%ecx
cmp    %edx,%eax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @brand() {
%1 = call i32 (...) @urand()
%2 = load i32, i32* @UINT_MAX
%3 = sdiv i32 %2, 2
%4 = icmp sgt i32 %1, %3
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @brand() {
%1 = tail call i32 (...) @urand()
%2 = load i32, i32* @UINT_MAX
%3 = sdiv i32 %2, 2
%4 = icmp sgt i32 %1, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ printf(char *);
struct timespec GetTime() {
  struct timespec tp = {0, 0};
  if (clock_gettime(CLOCK_REALTIME, &tp)) {
    printf("clock_gettime error!\n");
  } else {
  }
  return tp;
}


x86 assembly (clang, -O0):
<GetTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     1175 <GetTime+0x45>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
jmp    117a <GetTime+0x4a>
jmp    117a <GetTime+0x4a>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTime>:
push   %rax
movq   $0x0,(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1040 <clock_gettime@plt>
test   %rax,%rax
je     114b <GetTime+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
@.str = [22 x i8] c"clock_gettime error!\0A\00"
define i64 @GetTime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %6
%10 = bitcast %struct.timespec* %1 to i64*
%11 = load i64, i64* %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
@str = [21 x i8] c"clock_gettime error!\00"
define i64 @GetTime() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.timespec*
store i64 0, i64* %1
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
%9 = load i64, i64* %1
ret i64 %9
}
unsigned long long int hashFunction(const char *s) {
  unsigned long long int hashVal = 0l;
  while (*s) {
    hashVal = hashVal * 31 + *s++;
  }
  return hashVal;
}


x86 assembly (clang, -O0):
<hashFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hashFunction+0x41>
imul   $0x1f,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashFunction+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashFunction>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hashFunction+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashFunction+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @hashFunction(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i64, i64* %3
%10 = mul i64 %9, 31
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i64
%15 = add i64 %10, %14
store i64 %15, i64* %3
br label %4
16: ; preds = %4
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @hashFunction(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 31
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i64
%11 = add i64 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void convert_ARGB_copy_32(uint8_t *src, uint8_t *dst, uint32_t w, uint32_t h) {
  memcpy(dst, src, w * h * 4);
  return;
}


x86 assembly (clang, -O0):
<convert_ARGB_copy_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
shl    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_ARGB_copy_32>:
mov    %rdi,%rax
imul   %ecx,%edx
shl    $0x2,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @convert_ARGB_copy_32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %6
%10 = load i32*, i32** %5
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = mul nsw i32 %11, %12
%14 = mul nsw i32 %13, 4
%15 = call i32 @memcpy(i32* %9, i32* %10, i32 %14)
ret void
}

LLVM IR (-O2):
define void @convert_ARGB_copy_32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = shl i32 %2, 2
%6 = mul i32 %5, %3
%7 = tail call i32 @memcpy(i32* %1, i32* %0, i32 %6)
ret void
}
int test_imm_5Dint8_mem(signed char *val) {
  return ((*val) & (-0x5D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Dint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffa3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Dint8_mem>:
testb  $0xa3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -93
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int LSBFirst;
int MSBFirst;
int alock_native_byte_order() {
  int x = 1;
  return (*((char *)&x) == 1) ? LSBFirst : MSBFirst;
}


x86 assembly (clang, -O0):
<alock_native_byte_order>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
cmp    $0x1,%eax
jne    1129 <alock_native_byte_order+0x29>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <alock_native_byte_order+0x35>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alock_native_byte_order>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@LSBFirst = global i32 0
@MSBFirst = global i32 0
define i32 @alock_native_byte_order() {
%1 = load i32, i32* @LSBFirst
ret i32 %1
}