xunge/DecIR huggingface dataset:
int is_in_bound(int *arr, int size, int *ptr) {
  int i = 0;
  while (i < size) {
    if (*ptr == *(arr + i)) {
      return 1;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <is_in_bound+0x53>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1145 <is_in_bound+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115a <is_in_bound+0x5a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <is_in_bound+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
test   %esi,%esi
jle    111e <is_in_bound+0x1e>
mov    (%rdx),%eax
mov    %esi,%ecx
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    (%rdi,%rdx,4),%eax
je     1121 <is_in_bound+0x21>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <is_in_bound+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = load i32, i32* %2
%7 = zext i32 %1 to i64
br label %10
8: ; preds = %10
%9 = icmp eq i64 %15, %7
br i1 %9, label %16, label %10
10: ; preds = %5, %8
%11 = phi i64 [ 0, %5 ], [ %15, %8 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %6, %13
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %16, label %8
16: ; preds = %10, %8, %3
%17 = phi i32 [ 0, %3 ], [ 0, %8 ], [ 1, %10 ]
ret i32 %17
}
int id(int x) { return x; }


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

x86 assembly (clang, -O2):
<id>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @id(i32 returned %0) {
ret i32 %0
}
void RTReqQueueCallEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTReqQueueCallEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nand_chip_enable();
int /*<<< orphan*/ nand_clear_Rnb();
int /*<<< orphan*/ nand_wait_Rnb_ready();
int /*<<< orphan*/ nand_write_cmmd(int);
void nand_reset(void) {
  nand_chip_enable();
  nand_clear_Rnb();
  nand_write_cmmd(0xff);
  nand_wait_Rnb_ready();
}


x86 assembly (clang, -O0):
<nand_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <nand_chip_enable@plt>
mov    $0x0,%al
call   1050 <nand_clear_Rnb@plt>
mov    $0xff,%edi
call   1060 <nand_write_cmmd@plt>
mov    $0x0,%al
call   1030 <nand_wait_Rnb_ready@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_reset>:
push   %rax
xor    %eax,%eax
call   1040 <nand_chip_enable@plt>
xor    %eax,%eax
call   1050 <nand_clear_Rnb@plt>
mov    $0xff,%edi
call   1060 <nand_write_cmmd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nand_wait_Rnb_ready@plt>

LLVM IR (-O0):
define void @nand_reset() {
%1 = call i32 (...) @nand_chip_enable()
%2 = call i32 (...) @nand_clear_Rnb()
%3 = call i32 @nand_write_cmmd(i32 255)
%4 = call i32 (...) @nand_wait_Rnb_ready()
ret void
}

LLVM IR (-O2):
define void @nand_reset() {
%1 = tail call i32 (...) @nand_chip_enable()
%2 = tail call i32 (...) @nand_clear_Rnb()
%3 = tail call i32 @nand_write_cmmd(i32 255)
%4 = tail call i32 (...) @nand_wait_Rnb_ready()
ret void
}
void asd_dump_frame_rcvd(struct asd_phy *phy, struct done_list_struct *dl) {}


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

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

LLVM IR (-O0):
%struct.asd_phy = type opaque
%struct.done_list_struct = type opaque
define void @asd_dump_frame_rcvd(%struct.asd_phy* %0, %struct.done_list_struct* %1) {
%3 = alloca %struct.asd_phy*
%4 = alloca %struct.done_list_struct*
store %struct.asd_phy* %0, %struct.asd_phy** %3
store %struct.done_list_struct* %1, %struct.done_list_struct** %4
ret void
}

LLVM IR (-O2):
%struct.asd_phy = type opaque
%struct.done_list_struct = type opaque
define void @asd_dump_frame_rcvd(%struct.asd_phy* nocapture %0, %struct.done_list_struct* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msgFlusherr(int *);
void msg_flusherr_(int *const STATUS) {
  int status;
  msgFlusherr(&status);
  *STATUS = status;
}


x86 assembly (clang, -O0):
<msg_flusherr_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <msgFlusherr@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_flusherr_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1030 <msgFlusherr@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @msg_flusherr_(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @msgFlusherr(i32* %2)
%5 = load i32, i32* %2
store i32 %5, i32* %0
ret void
}
void switch_row_and_colVEC(int *b, int i, int j) {
  int id;
  id = b[i];
  b[i] = b[j];
  b[j] = id;
}


x86 assembly (clang, -O0):
<switch_row_and_colVEC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_row_and_colVEC>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @switch_row_and_colVEC(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int /*<<< orphan*/);
void TOSH_MAKE_RADIO_CCA_INPUT() { clear_io_bit(-6, 0); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RADIO_CCA_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffa,%edi
xor    %esi,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RADIO_CCA_INPUT>:
mov    $0xfffffffa,%edi
xor    %esi,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RADIO_CCA_INPUT() {
%1 = call i32 @clear_io_bit(i32 -6, i32 0)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RADIO_CCA_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 -6, i32 0)
ret void
}
/* Variables and functions */
int retournerEtatBouton(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int RetournerEtatBouton(int identifiantBouton, char *resultat) {
  int codeRetour = retournerEtatBouton(identifiantBouton);
  if (codeRetour == 1 || codeRetour == 0) {
    sprintf(resultat, "%d", codeRetour);
    codeRetour = 200;
  }
  return codeRetour;
}


x86 assembly (clang, -O0):
<RetournerEtatBouton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <retournerEtatBouton@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
je     114e <RetournerEtatBouton+0x2e>
cmpl   $0x0,-0x14(%rbp)
jne    1168 <RetournerEtatBouton+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xea4(%rip),%rsi
call   1030 <sprintf@plt>
movl   $0xc8,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RetournerEtatBouton>:
push   %rbx
mov    %rsi,%rbx
call   1040 <retournerEtatBouton@plt>
cmp    $0x1,%eax
ja     1144 <RetournerEtatBouton+0x24>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <sprintf@plt>
mov    $0xc8,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @RetournerEtatBouton(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @retournerEtatBouton(i32 %0)
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 200, %5 ], [ %3, %2 ]
ret i32 %8
}
void c64_sid_block_start(void) {}


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

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

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

LLVM IR (-O2):
define void @c64_sid_block_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readEntireFile();
int /*<<< orphan*/ readUntilMarker(char);
int /*<<< orphan*/ writeToFile();
int main(void) {
  readEntireFile();
  printf("---------\n");
  readUntilMarker('p');
  writeToFile();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <readEntireFile@plt>
lea    0xeae(%rip),%rdi
call   1050 <printf@plt>
mov    $0x70,%edi
call   1040 <readUntilMarker@plt>
mov    $0x0,%al
call   1030 <writeToFile@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <readEntireFile@plt>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x70,%edi
call   1050 <readUntilMarker@plt>
xor    %eax,%eax
call   1040 <writeToFile@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"---------\0A\00"
define i32 @main() {
%1 = call i32 (...) @readEntireFile()
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @readUntilMarker(i8 signext 112)
%4 = call i32 (...) @writeToFile()
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"---------\00"
define i32 @main() {
%1 = tail call i32 (...) @readEntireFile()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @readUntilMarker(i8 signext 112)
%4 = tail call i32 (...) @writeToFile()
ret i32 0
}
void StreamWriter_Seek(struct StreamWriter *self, int offset) {}


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

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

LLVM IR (-O0):
%struct.StreamWriter = type opaque
define void @StreamWriter_Seek(%struct.StreamWriter* %0, i32 %1) {
%3 = alloca %struct.StreamWriter*
%4 = alloca i32
store %struct.StreamWriter* %0, %struct.StreamWriter** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.StreamWriter = type opaque
define void @StreamWriter_Seek(%struct.StreamWriter* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doit(int, int, int);
int /*<<< orphan*/ printtime(char *, int /*<<< orphan*/);
int main() {
  printtime("Call only", doit(1, 1, 1));
  printtime("60-by-60-by-2", doit(60, 60, 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <doit@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
call   1030 <printtime@plt>
mov    $0x3c,%esi
mov    $0x2,%edx
mov    %esi,%edi
call   1040 <doit@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printtime@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <doit@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printtime@plt>
mov    $0x3c,%edi
mov    $0x3c,%esi
mov    $0x2,%edx
call   1040 <doit@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1030 <printtime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Call only\00"
@.str.1 = [14 x i8] c"60-by-60-by-2\00"
define i32 @main() {
%1 = call i32 @doit(i32 1, i32 1, i32 1)
%2 = call i32 @printtime(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @doit(i32 60, i32 60, i32 2)
%4 = call i32 @printtime(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Call only\00"
@.str.1 = [14 x i8] c"60-by-60-by-2\00"
define i32 @main() {
%1 = tail call i32 @doit(i32 1, i32 1, i32 1)
%2 = tail call i32 @printtime(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @doit(i32 60, i32 60, i32 2)
%4 = tail call i32 @printtime(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M453_f(char *s) {
  debug("M453_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M453_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M453_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M453_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M453_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M453_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M453_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ dump_rts_cts(int);
int rpi_gpio_header_type(int);
int rpi_version();
int main(int argc, char **argv) {
  int version, header_type;
  version = rpi_version();
  header_type = rpi_gpio_header_type(version);
  dump_rts_cts(header_type);
  return EXIT_SUCCESS;
}


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)
mov    $0x0,%al
call   1040 <rpi_version@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <rpi_gpio_header_type@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <dump_rts_cts@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rpi_version@plt>
mov    %eax,%edi
call   1050 <rpi_gpio_header_type@plt>
mov    %eax,%edi
call   1030 <dump_rts_cts@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @rpi_version()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @rpi_gpio_header_type(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @dump_rts_cts(i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rpi_version()
%4 = tail call i32 @rpi_gpio_header_type(i32 %3)
%5 = tail call i32 @dump_rts_cts(i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int maxBall(int);
int /*<<< orphan*/ printf(char *, int, int);
void testequal(int v0, int exp) {
  int act = maxBall(v0);
  if (act != exp)
    printf("Error. Expected %d but got %d\n", exp, act);
  assert(exp == act);
}


x86 assembly (clang, -O0):
<testequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <maxBall@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1167 <testequal+0x37>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testequal>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1050 <maxBall@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
je     1150 <testequal+0x20>
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %edi,%edi
cmp    %ebx,%ebp
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error. Expected %d but got %d\0A\00"
define void @testequal(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 = call i32 @maxBall(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error. Expected %d but got %d\0A\00"
define void @testequal(i32 %0, i32 %1) {
%3 = tail call i32 @maxBall(i32 %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
br label %7
7: ; preds = %5, %2
%8 = zext i1 %4 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
int simple(int i) { return (i > 4) && (i < 10); }


x86 assembly (clang, -O0):
<simple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <simple+0x20>
cmpl   $0xa,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple>:
add    $0xfffffffb,%edi
xor    %eax,%eax
cmp    $0x5,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @simple(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 4
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @simple(i32 %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t aeron_semantic_version_compose(uint8_t major, uint8_t minor,
                                       uint8_t patch) {
  return (major << 16) | (minor << 8) | patch;
}


x86 assembly (clang, -O0):
<aeron_semantic_version_compose>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_semantic_version_compose>:
mov    %esi,%eax
shl    $0x10,%edi
shl    $0x8,%eax
or     %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @aeron_semantic_version_compose(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 16
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = or i32 %8, %10
%12 = load i32, i32* %6
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @aeron_semantic_version_compose(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = shl i32 %1, 8
%6 = or i32 %5, %4
%7 = or i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int *find(int *, int, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  int arr[3] = {5, 4, 2};
  int *find_result = find(arr, 3, 3);
  printf("is find_result null? %d\n", find_result == NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   1040 <find@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1040 <find@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [3 x i32] [i32 5, i32 4, i32 2]
@.str = [25 x i8] c"is find_result null? %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = call i32* @find(i32* %5, i32 3, i32 3)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp eq i32* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [3 x i32] [i32 5, i32 4, i32 2]
@.str = [25 x i8] c"is find_result null? %d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32* @find(i32* %3, i32 3, i32 3)
%5 = icmp eq i32* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x;
  printf("x value:     %d\n", x);
  printf("x address:   %p\n", &x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"x value: %d\0A\00"
@.str.1 = [17 x i8] c"x address: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 undef)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Type definitions */
struct dns_ptr {
  int dummy;
};
struct dns_packet {
  int dummy;
};
struct dns_ns {
  int dummy;
};

/* Variables and functions */
int dns_ns_push(struct dns_packet *, struct dns_ns *);
int dns_ptr_push(struct dns_packet *P, struct dns_ptr *ptr) {
  return dns_ns_push(P, (struct dns_ns *)ptr);
}


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

x86 assembly (clang, -O2):
<dns_ptr_push>:
jmp    1030 <dns_ns_push@plt>

LLVM IR (-O0):
%struct.dns_packet = type { i32 }
%struct.dns_ptr = type { i32 }
%struct.dns_ns = type { i32 }
define i32 @dns_ptr_push(%struct.dns_packet* %0, %struct.dns_ptr* %1) {
%3 = alloca %struct.dns_packet*
%4 = alloca %struct.dns_ptr*
store %struct.dns_packet* %0, %struct.dns_packet** %3
store %struct.dns_ptr* %1, %struct.dns_ptr** %4
%5 = load %struct.dns_packet*, %struct.dns_packet** %3
%6 = load %struct.dns_ptr*, %struct.dns_ptr** %4
%7 = bitcast %struct.dns_ptr* %6 to %struct.dns_ns*
%8 = call i32 @dns_ns_push(%struct.dns_packet* %5, %struct.dns_ns* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.dns_packet = type { i32 }
%struct.dns_ptr = type { i32 }
%struct.dns_ns = type { i32 }
define i32 @dns_ptr_push(%struct.dns_packet* %0, %struct.dns_ptr* %1) {
%3 = bitcast %struct.dns_ptr* %1 to %struct.dns_ns*
%4 = tail call i32 @dns_ns_push(%struct.dns_packet* %0, %struct.dns_ns* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _get_offset_word(int);
short *capar_word(int /*<<< orphan*/);
signed short *get_offset_word(int m) {
  return (capar_word(_get_offset_word(m)));
}


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

x86 assembly (clang, -O2):
<get_offset_word>:
push   %rax
call   1030 <_get_offset_word@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <capar_word@plt>

LLVM IR (-O0):
define i16* @get_offset_word(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_get_offset_word(i32 %3)
%5 = call i16* @capar_word(i32 %4)
ret i16* %5
}

LLVM IR (-O2):
define i16* @get_offset_word(i32 %0) {
%2 = tail call i32 @_get_offset_word(i32 %0)
%3 = tail call i16* @capar_word(i32 %2)
ret i16* %3
}
unsigned hash(const char *str) {
  unsigned h = 0;
  while (*str)
    h = (h << 1) + *str++;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <hash+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <hash+0x22>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %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 i32, i32* %3
%10 = shl i32 %9, 1
%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 i32
%15 = add i32 %10, %14
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @hash(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 i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %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 i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
struct ListNode *deleteNode(struct ListNode *);
struct ListNode *deleteList(struct ListNode *head) {
  while (head != NULL) {
    head = deleteNode(head);
  }
  return head;
}


x86 assembly (clang, -O0):
<deleteList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <deleteList+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <deleteNode@plt>
mov    %rax,-0x8(%rbp)
jmp    111c <deleteList+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteList>:
push   %rax
test   %rdi,%rdi
je     112d <deleteList+0x1d>
mov    %rdi,%rax
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <deleteNode@plt>
test   %rax,%rax
jne    1120 <deleteList+0x10>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define %struct.ListNode* @deleteList(%struct.ListNode* %0) {
%2 = alloca %struct.ListNode*
store %struct.ListNode* %0, %struct.ListNode** %2
br label %3
3: ; preds = %6, %1
%4 = load %struct.ListNode*, %struct.ListNode** %2
%5 = icmp ne %struct.ListNode* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load %struct.ListNode*, %struct.ListNode** %2
%8 = call %struct.ListNode* @deleteNode(%struct.ListNode* %7)
store %struct.ListNode* %8, %struct.ListNode** %2
br label %3
9: ; preds = %3
%10 = load %struct.ListNode*, %struct.ListNode** %2
ret %struct.ListNode* %10
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define noalias %struct.ListNode* @deleteList(%struct.ListNode* %0) {
%2 = icmp eq %struct.ListNode* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi %struct.ListNode* [ %5, %3 ], [ %0, %1 ]
%5 = tail call %struct.ListNode* @deleteNode(%struct.ListNode* %4)
%6 = icmp eq %struct.ListNode* %5, null
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret %struct.ListNode* null
}
/* Variables and functions */
void sample(int i) {
  i += 1;
  int j = 0;
  j += 1;
}


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

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

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

LLVM IR (-O2):
define void @sample(i32 %0) {
ret void
}
void swap_cpy(int a, int b) {
  int c = a;
  a = b;
  b = c;
}


x86 assembly (clang, -O0):
<swap_cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap_cpy(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
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @swap_cpy(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_absx();
int /*<<< orphan*/ e_sta();
int /*<<< orphan*/ e_writeback();
void e_sta_absx() {
  e_absx();
  e_sta();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_sta_absx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <e_absx@plt>
mov    $0x0,%al
call   1040 <e_sta@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_sta_absx>:
push   %rax
xor    %eax,%eax
call   1050 <e_absx@plt>
xor    %eax,%eax
call   1040 <e_sta@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_sta_absx() {
%1 = call i32 (...) @e_absx()
%2 = call i32 (...) @e_sta()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_sta_absx() {
%1 = tail call i32 (...) @e_absx()
%2 = tail call i32 (...) @e_sta()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ BN_clear_free(int /*<<< orphan*/ *);
void BN_free(BIGNUM *a) { BN_clear_free(a); }


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

x86 assembly (clang, -O2):
<BN_free>:
jmp    1030 <BN_clear_free@plt>

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

LLVM IR (-O2):
define void @BN_free(i32* %0) {
%2 = tail call i32 @BN_clear_free(i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ M_PI;
double degrees(double rad) { return rad * 180.0 / (double)M_PI; }


x86 assembly (clang, -O0):
<degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degrees>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i64 0
define double @degrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load i64, i64* @M_PI
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
ret double %7
}

LLVM IR (-O2):
@M_PI = global i64 0
define double @degrees(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load i64, i64* @M_PI
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
int g() {
  static int x = 19;
  return x += 14;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0xe,%eax
mov    %eax,0x2f0d(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    0x2f1a(%rip),%eax
add    $0xe,%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@g.x = internal global i32 19
define i32 @g() {
%1 = load i32, i32* @g.x
%2 = add nsw i32 %1, 14
store i32 %2, i32* @g.x
ret i32 %2
}

LLVM IR (-O2):
@g.x = internal unnamed_addr global i32 19
define i32 @g() {
%1 = load i32, i32* @g.x
%2 = add nsw i32 %1, 14
store i32 %2, i32* @g.x
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ genericError(char *, int, char const *);
void errorCSPNodesNumber(const char *filename) {
  genericError("We couldn't fetch the number of nodes inside the CSP from the "
               "filename \"%s\"",
               6, filename);
}


x86 assembly (clang, -O0):
<errorCSPNodesNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
mov    $0x6,%esi
call   1030 <genericError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorCSPNodesNumber>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    $0x6,%esi
jmp    1030 <genericError@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"We couldn't fetch the number of nodes inside the CSP from the filename \22%s\22\00"
define void @errorCSPNodesNumber(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @genericError(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 6, i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"We couldn't fetch the number of nodes inside the CSP from the filename \22%s\22\00"
define void @errorCSPNodesNumber(i8* %0) {
%2 = tail call i32 @genericError(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 6, i8* %0)
ret void
}
/* Variables and functions */
int maxNumber(int, int);
int arrayMax(int *array, int n) {
  if (n == 1)
    return array[0];
  return (maxNumber(arrayMax(array, n - 1), array[n - 1]));
}


x86 assembly (clang, -O0):
<arrayMax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1147 <arrayMax+0x27>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <arrayMax+0x50>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1040 <arrayMax@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <maxNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayMax>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmp    $0x1,%esi
jne    1137 <arrayMax+0x17>
mov    (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %esi,%ebx
lea    -0x1(%rbx),%esi
mov    %r14,%rdi
call   1040 <arrayMax@plt>
movslq %ebx,%rcx
mov    -0x4(%r14,%rcx,4),%esi
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <maxNumber@plt>

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

LLVM IR (-O2):
define i32 @arrayMax(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* %0
br label %6
6: ; preds = %4, %8
%7 = phi i32 [ %14, %8 ], [ %5, %4 ]
ret i32 %7
8: ; preds = %2
%9 = add nsw i32 %1, -1
%10 = tail call i32 @arrayMax(i32* %0, i32 %9)
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = tail call i32 @maxNumber(i32 %10, i32 %13)
br label %6
}
int test_imm_51uint8_reg(unsigned char val) {
  return ((val) & (0x51 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_51uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 81
%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_51uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 81
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int __pipe(int *);
int pipe(int *pipefds) { return __pipe(pipefds); }


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

x86 assembly (clang, -O2):
<pipe>:
jmp    1030 <__pipe@plt>

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

LLVM IR (-O2):
define i32 @pipe(i32* %0) {
%2 = tail call i32 @__pipe(i32* %0)
ret i32 %2
}
void f2(int *arr) {}


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

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

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

LLVM IR (-O2):
define void @f2(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void print_vertexsignature(unsigned int sig) {
  int label, index;
  index = sig & 0xffff;
  label = sig >> 16;
  printf(" label of the edge %d, index of the vertex %d \n", label, index);
}


x86 assembly (clang, -O0):
<print_vertexsignature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vertexsignature>:
mov    %edi,%esi
movzwl %si,%edx
shr    $0x10,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c" label of the edge %d, index of the vertex %d \0A\00"
define void @print_vertexsignature(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 65535
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = lshr i32 %7, 16
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c" label of the edge %d, index of the vertex %d \0A\00"
define void @print_vertexsignature(i32 %0) {
%2 = and i32 %0, 65535
%3 = lshr i32 %0, 16
%4 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
ret void
}
int main() {
  int i;
  i = 12;
  if (i == 12 || i == 13 || (i >= 15 && i <= 17)) {
    i = 0;
  } else {
    i = 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
je     113a <main+0x3a>
cmpl   $0xd,-0x8(%rbp)
je     113a <main+0x3a>
cmpl   $0xf,-0x8(%rbp)
jl     1146 <main+0x46>
cmpl   $0x11,-0x8(%rbp)
jg     1146 <main+0x46>
movl   $0x0,-0x8(%rbp)
jmp    114d <main+0x4d>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%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 12, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 12
br i1 %4, label %14, label %5
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 13
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 15
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 17
br i1 %13, label %14, label %15
14: ; preds = %11, %5, %0
store i32 0, i32* %2
br label %16
15: ; preds = %11, %8
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void loop(char *string) {
  char c;
  while (1) {
    c = *string;
    if (c) {
      *(volatile char *)0x101f1000 = c;
      string++;
    } else {
      break;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1136 <loop+0x36>
mov    -0x9(%rbp),%cl
mov    $0x101f1000,%eax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113b <loop+0x3b>
jmp    1140 <loop+0x40>
jmp    1108 <loop+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
mov    (%rdi),%al
test   %al,%al
je     1122 <loop+0x22>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,0x101f1000
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <loop+0x10>
ret

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

LLVM IR (-O2):
define void @loop(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
store volatile i8 %5, i8* inttoptr (i64 270471168 to i8*)
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}