xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ dup2(int, int /*<<< orphan*/);
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int open(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int fd = open("/proc/self/maps", O_RDONLY);
  dup2(fd, 0);
  execl("/usr/bin/chsh", "chsh", NULL);
  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)
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
lea    0xea1(%rip),%rdi
lea    0xea3(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <execl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <dup2@plt>
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
xor    %edx,%edx
call   1050 <execl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/proc/self/maps\00"
@O_RDONLY = global i32 0
@.str.1 = [14 x i8] c"/usr/bin/chsh\00"
@.str.2 = [5 x i8] c"chsh\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 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @dup2(i32 %9, i32 0)
%11 = call i32 @execl(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"/proc/self/maps\00"
@O_RDONLY = global i32 0
@.str.1 = [14 x i8] c"/usr/bin/chsh\00"
@.str.2 = [5 x i8] c"chsh\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @dup2(i32 %4, i32 0)
%6 = tail call i32 @execl(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}
void flash_clear_status_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @flash_clear_status_flags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  int age = 23;
  char name[] = "Sultan Alqahtani";
  printf("My name is %s I am %d years old \n", name, age);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
lea    0xee6(%rip),%rdi
mov    %rsp,%rsi
mov    $0x17,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.name = [17 x i8] c"Sultan Alqahtani\00"
@.str = [34 x i8] c"My name is %s I am %d years old \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [17 x i8]
store i32 0, i32* %1
store i32 23, i32* %2
%4 = bitcast [17 x i8]* %3 to i8*
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.name = [17 x i8] c"Sultan Alqahtani\00"
@.str = [34 x i8] c"My name is %s I am %d years old \0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2, i32 23)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void Reversify(char *str) {
  if (*str == '\0')
    return;
  else {
    Reversify(str + 1);
    printf("%c", *str);
  }
}


x86 assembly (clang, -O0):
<Reversify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1141 <Reversify+0x21>
jmp    1161 <Reversify+0x41>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <Reversify@plt>
mov    -0x8(%rbp),%rax
lea    0xea7(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reversify>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1142 <Reversify+0x22>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1040 <Reversify@plt>
movsbl (%rbx),%esi
lea    0xec4(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @Reversify(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
br label %14
14: ; preds = %7, %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @Reversify(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @Reversify(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR51_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR51_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR51_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_sra_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sra_epi32(__m128i A, __m128i B) { return _mm_sra_epi32(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sra_epi32>:
jmp    1030 <_mm_sra_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sra_epi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sra_epi32(i32 %0, i32 %1)
ret i32 %3
}
int find_length(char *operand) {
  int i = 0;
  if (operand[0] == 'X')
    return 1;
  else
    for (i = 2; operand[i] != '\''; i++)
      ;
  return i - 2;
}


x86 assembly (clang, -O0):
<find_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x58,%eax
jne    112b <find_length+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1168 <find_length+0x68>
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
je     115a <find_length+0x5a>
jmp    114c <find_length+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <find_length+0x32>
jmp    115f <find_length+0x5f>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_length>:
mov    $0x1,%eax
cmpb   $0x58,(%rdi)
je     112c <find_length+0x2c>
add    $0x2,%rdi
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%eax
cmpb   $0x27,(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <find_length+0x20>
ret

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

LLVM IR (-O2):
define i32 @find_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 88
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 2, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 39
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = add nsw i32 %11, -2
br label %13
13: ; preds = %1, %10
%14 = phi i32 [ %12, %10 ], [ 1, %1 ]
ret i32 %14
}
unsigned long insert_ras(unsigned long insn, long value, const char **errmsg) {
  if (value == 0)
    *errmsg = "invalid register operand when updating";
  return insn | ((value & 0x1f) << 16);
}


x86 assembly (clang, -O0):
<insert_ras>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1129 <insert_ras+0x29>
mov    -0x18(%rbp),%rax
lea    0xeda(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_ras>:
mov    %rsi,%rax
test   %rsi,%rsi
jne    1112 <insert_ras+0x12>
lea    0xef1(%rip),%rcx
mov    %rcx,(%rdx)
and    $0x1f,%eax
shl    $0x10,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"invalid register operand when updating\00"
define i64 @insert_ras(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i8**, i8*** %6
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %10
br label %11
11: ; preds = %9, %3
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = and i64 %13, 31
%15 = shl i64 %14, 16
%16 = or i64 %12, %15
ret i64 %16
}

LLVM IR (-O2):
@.str = [39 x i8] c"invalid register operand when updating\00"
define i64 @insert_ras(i64 %0, i64 %1, i8** nocapture writeonly %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %5, label %6
5: ; preds = %3
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %3
%7 = shl i64 %1, 16
%8 = and i64 %7, 2031616
%9 = or i64 %8, %0
ret i64 %9
}
int containsInt(int array[], int length, int value) {
  int i;
  for (i = 0; i < length; i++) {
    if (array[i] == value) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<containsInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <containsInt+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <containsInt+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <containsInt+0x5b>
jmp    1146 <containsInt+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <containsInt+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @containsInt(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** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%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, %21
%28 = load i32, i32* %4
ret i32 %28
}

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


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
push   %rax
mov    $0x1,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @t() {
%1 = call i32 @putint(i32 1)
%2 = call i32 @putchar(i32 10)
ret i32 1
}

LLVM IR (-O2):
define i32 @t() {
%1 = tail call i32 @putint(i32 1)
%2 = tail call i32 @putchar(i32 10)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned char);
void mov_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned char imm8) {
  put8(0xC6);
  put8(0x80 + reg32);
  put32(imm32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<mov_preg32pimm32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xc6,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%eax
movzbl %al,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg32pimm32_imm8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xc6,%edi
call   1030 <put8@plt>
xor    $0x80,%bl
movzbl %bl,%edi
call   1030 <put8@plt>
mov    %ebp,%edi
call   1040 <put32@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_preg32pimm32_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = call i32 @put8(i8 zeroext -58)
%8 = load i32, i32* %4
%9 = add nsw i32 128, %8
%10 = trunc i32 %9 to i8
%11 = call i32 @put8(i8 zeroext %10)
%12 = load i32, i32* %5
%13 = call i32 @put32(i32 %12)
%14 = load i8, i8* %6
%15 = call i32 @put8(i8 zeroext %14)
ret void
}

LLVM IR (-O2):
define void @mov_preg32pimm32_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = tail call i32 @put8(i8 zeroext -58)
%5 = trunc i32 %0 to i8
%6 = xor i8 %5, -128
%7 = tail call i32 @put8(i8 zeroext %6)
%8 = tail call i32 @put32(i32 %1)
%9 = tail call i32 @put8(i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "Usage: --addr ADDR -port PORT --seq SEQ --next --addr ADDR -port PORT "
      "--seq SEQ -- CMD ...\n"
      "\t Describe a source side of a connection, then set the --next option\n"
      "\t and describe a destination side.\n"
      "\t --reverse - swap source and destination sides\n"
      "\t The idea is that the same command line is execute on both sides,\n"
      "\t but the --reverse is added to one of them.\n"
      "\n"
      "\t CMD ... - a user command to handle a socket, which is the descriptor "
      "3.\n"
      "\n"
      "\t It prints the \"start\" on stdout when a socket is created and\n"
      "\t resumes it when you write \"start\" to stdin.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [541 x i8] c"Usage: --addr ADDR -port PORT --seq SEQ --next --addr ADDR -port PORT --seq SEQ -- CMD ...\0A\09 Describe a source side of a connection, then set the --next option\0A\09 and describe a destination side.\0A\09 --reverse - swap source and destination sides\0A\09 The idea is that the same command line is execute on both sides,\0A\09 but the --reverse is added to one of them.\0A\0A\09 CMD ... - a user command to handle a socket, which is the descriptor 3.\0A\0A\09 It prints the \22start\22 on stdout when a socket is created and\0A\09 resumes it when you write \22start\22 to stdin.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([541 x i8], [541 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [540 x i8] c"Usage: --addr ADDR -port PORT --seq SEQ --next --addr ADDR -port PORT --seq SEQ -- CMD ...\0A\09 Describe a source side of a connection, then set the --next option\0A\09 and describe a destination side.\0A\09 --reverse - swap source and destination sides\0A\09 The idea is that the same command line is execute on both sides,\0A\09 but the --reverse is added to one of them.\0A\0A\09 CMD ... - a user command to handle a socket, which is the descriptor 3.\0A\0A\09 It prints the \22start\22 on stdout when a socket is created and\0A\09 resumes it when you write \22start\22 to stdin.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([540 x i8], [540 x i8]* @str, i64 0, i64 0))
ret void
}
int min(int *pa, int *pb) {
  if (*pa <= *pb)
    return *pa;
  else
    return *pb;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jg     112c <min+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <min+0x35>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = select i1 %5, i32 %4, i32 %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strerr_die(int, char *, char *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void nomem(void) {
  strerr_die((111), ("rblsmtpd: fatal: "), ("out of memory"), 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<nomem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6f,%edi
lea    0xedc(%rip),%rsi
lea    0xee7(%rip),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nomem>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
mov    $0x6f,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"rblsmtpd: fatal: \00"
@.str.1 = [14 x i8] c"out of memory\00"
define void @nomem() {
%1 = call i32 @strerr_die(i32 111, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"rblsmtpd: fatal: \00"
@.str.1 = [14 x i8] c"out of memory\00"
define void @nomem() {
%1 = tail call i32 @strerr_die(i32 111, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
void freeUnknownOffsetPointer() {
  char *r = malloc(sizeof(char));
  r = r + arbitraryInt();
  free(r);
}


x86 assembly (clang, -O0):
<freeUnknownOffsetPointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <arbitraryInt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @freeUnknownOffsetPointer() {
%1 = alloca i8*
%2 = call i8* @malloc(i64 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 (...) @arbitraryInt()
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
store i8* %6, i8** %1
%7 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
define void @freeUnknownOffsetPointer() {
%1 = tail call i32 (...) @arbitraryInt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float pi = 3.1415926;
  printf("Pi is about %.5f\n", pi);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Pi is about %.5f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x400921FB40000000, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Pi is about %.5f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float 0x400921FB40000000)
ret i32 0
}
int is_space(char c) {
  switch (c) {
  case '\0':
  case ' ':
  case '\n':
  case '\r':
  case '\t':
  case ',':
  case '$':
  case '#':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1179 <is_space+0x79>
jmp    111e <is_space+0x1e>
mov    -0xc(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1179 <is_space+0x79>
jmp    1132 <is_space+0x32>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1179 <is_space+0x79>
jmp    1143 <is_space+0x43>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1179 <is_space+0x79>
jmp    1154 <is_space+0x54>
mov    -0xc(%rbp),%eax
add    $0xffffffdd,%eax
sub    $0x2,%eax
jb     1179 <is_space+0x79>
jmp    1168 <is_space+0x68>
mov    -0xc(%rbp),%eax
sub    $0x2c,%eax
jne    1185 <is_space+0x85>
jmp    1179 <is_space+0x79>
movl   $0x1,-0x4(%rbp)
jmp    118c <is_space+0x8c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
cmp    $0x2c,%edi
ja     111d <is_space+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x101900002601,%rdx
bt     %rcx,%rdx
jae    111d <is_space+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 0, label %6
i32 32, label %6
i32 10, label %6
i32 13, label %6
i32 9, label %6
i32 44, label %6
i32 36, label %6
i32 35, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 0, label %4
i32 32, label %4
i32 10, label %4
i32 13, label %4
i32 9, label %4
i32 44, label %4
i32 36, label %4
i32 35, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Practice 01\n");
  printf("Hello, World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Practice 01\00"
@str.2 = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float tanh(float);
float Float_tanh(float x) { return tanh(x); }


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

x86 assembly (clang, -O2):
<Float_tanh>:
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define float @Float_tanh(float %0) {
%2 = tail call float @tanh(float %0)
ret float %2
}
/* Variables and functions */
double DSlater_1S_6S(double, double, double);
double DSlater_6S_1S(double rij, double xii, double xij) {
  return DSlater_1S_6S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<DSlater_6S_1S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <DSlater_1S_6S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSlater_6S_1S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_1S_6S@plt>

LLVM IR (-O0):
define double @DSlater_6S_1S(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = call double @DSlater_1S_6S(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @DSlater_6S_1S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_1S_6S(double %0, double %2, double %1)
ret double %4
}
int ath10k_spectral_create(struct ath10k *ar) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ath10k = type opaque
define i32 @ath10k_spectral_create(%struct.ath10k* nocapture readnone %0) {
ret i32 0
}
double interpolate(double x, double x1, double y1, double x2, double y2) {
  if (x1 == x2)
    return (y1 + y2) / 2;
  else
    return y1 + (x - x1) * (y2 - y1) / (x2 - x1);
}


x86 assembly (clang, -O0):
<interpolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1153 <interpolate+0x53>
jp     1153 <interpolate+0x53>
movsd  -0x20(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1187 <interpolate+0x87>
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate>:
ucomisd %xmm3,%xmm1
jne    1119 <interpolate+0x19>
jp     1119 <interpolate+0x19>
addsd  %xmm4,%xmm2
mulsd  0xeec(%rip),%xmm2
movapd %xmm2,%xmm0
ret
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm4
mulsd  %xmm0,%xmm4
subsd  %xmm1,%xmm3
divsd  %xmm3,%xmm4
addsd  %xmm4,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @interpolate(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
%12 = load double, double* %8
%13 = load double, double* %10
%14 = fcmp oeq double %12, %13
br i1 %14, label %15, label %20
15: ; preds = %5
%16 = load double, double* %9
%17 = load double, double* %11
%18 = fadd double %16, %17
%19 = fdiv double %18, 2.000000e+00
store double %19, double* %6
br label %34
20: ; preds = %5
%21 = load double, double* %9
%22 = load double, double* %7
%23 = load double, double* %8
%24 = fsub double %22, %23
%25 = load double, double* %11
%26 = load double, double* %9
%27 = fsub double %25, %26
%28 = fmul double %24, %27
%29 = load double, double* %10
%30 = load double, double* %8
%31 = fsub double %29, %30
%32 = fdiv double %28, %31
%33 = fadd double %21, %32
store double %33, double* %6
br label %34
34: ; preds = %20, %15
%35 = load double, double* %6
ret double %35
}

LLVM IR (-O2):
define double @interpolate(double %0, double %1, double %2, double %3, double %4) {
%6 = fcmp oeq double %1, %3
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = fadd double %2, %4
%9 = fmul double %8, 5.000000e-01
br label %17
10: ; preds = %5
%11 = fsub double %0, %1
%12 = fsub double %4, %2
%13 = fmul double %11, %12
%14 = fsub double %3, %1
%15 = fdiv double %13, %14
%16 = fadd double %15, %2
br label %17
17: ; preds = %10, %7
%18 = phi double [ %9, %7 ], [ %16, %10 ]
ret double %18
}
/* Variables and functions */
int /*<<< orphan*/ CmdNewPage(int);
void CmdTitlepage(int code) { CmdNewPage(1); }


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

x86 assembly (clang, -O2):
<CmdTitlepage>:
mov    $0x1,%edi
jmp    1030 <CmdNewPage@plt>

LLVM IR (-O0):
define void @CmdTitlepage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @CmdNewPage(i32 1)
ret void
}

LLVM IR (-O2):
define void @CmdTitlepage(i32 %0) {
%2 = tail call i32 @CmdNewPage(i32 1)
ret void
}
void c_free_dbl_vector(double *m, int nl, int nh) {
  int nl_safe;
  nl_safe = (nl < 0) ? nl : 0;
  m += nl_safe;
  free(m);
  return;
}


x86 assembly (clang, -O0):
<c_free_dbl_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1137 <c_free_dbl_vector+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1141 <c_free_dbl_vector+0x31>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1141 <c_free_dbl_vector+0x31>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_free_dbl_vector>:
mov    %esi,%eax
sar    $0x1f,%eax
and    %esi,%eax
cltq
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @c_free_dbl_vector(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %13
12: ; preds = %3
br label %13
13: ; preds = %12, %10
%14 = phi i32 [ %11, %10 ], [ 0, %12 ]
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load double*, double** %4
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds double, double* %16, i64 %17
store double* %18, double** %4
%19 = load double*, double** %4
%20 = bitcast double* %19 to i8*
ret void
}

LLVM IR (-O2):
define void @c_free_dbl_vector(double* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds double, double* %0, i64 %6
%8 = bitcast double* %7 to i8*
tail call void @free(i8* %8)
ret void
}
unsigned long os_get_task_size(unsigned long shift) { return 0x7fc0000000; }


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

x86 assembly (clang, -O2):
<os_get_task_size>:
movabs $0x7fc0000000,%rax
ret

LLVM IR (-O0):
define i64 @os_get_task_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i64 548682072064
}

LLVM IR (-O2):
define i64 @os_get_task_size(i64 %0) {
ret i64 548682072064
}
/* Variables and functions */
int /*<<< orphan*/ xbdebug(char *, int);
void sigh(int nsig) { xbdebug("received signal: %d", nsig); }


x86 assembly (clang, -O0):
<sigh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <xbdebug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigh>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <xbdebug@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"received signal: %d\00"
define void @sigh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @xbdebug(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"received signal: %d\00"
define void @sigh(i32 %0) {
%2 = tail call i32 @xbdebug(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int linear_search(int value, int *arr, int length) {
  for (int i = 0; i < length; i++)
    if (arr[i] == value)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<linear_search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <linear_search+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <linear_search+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <linear_search+0x5b>
jmp    1146 <linear_search+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <linear_search+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_search>:
test   %edx,%edx
jle    113a <linear_search+0x3a>
mov    $0x1,%eax
cmp    %edi,(%rsi)
je     1139 <linear_search+0x39>
mov    %edx,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdx
cmp    %rax,%rcx
je     1131 <linear_search+0x31>
lea    0x1(%rdx),%rax
cmp    %edi,(%rsi,%rdx,4)
jne    1120 <linear_search+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @linear_search(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = zext i32 %2 to i64
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, %0
br i1 %9, label %21, label %10
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %1, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %0
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %10
18: ; preds = %10, %13
%19 = icmp ult i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %3
%22 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %20, %18 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void bmp_test_print_failed(const char *name) {
  printf("%s\t\tFAILED!\n", name);
}


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

x86 assembly (clang, -O2):
<bmp_test_print_failed>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09\09FAILED!\0A\00"
define void @bmp_test_print_failed(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430Usart0P__Usart__disableRxIntr();
void Msp430SpiNoDmaP__0__Usart__disableRxIntr(void) {
  HplMsp430Usart0P__Usart__disableRxIntr();
}


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

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

LLVM IR (-O0):
define void @Msp430SpiNoDmaP__0__Usart__disableRxIntr() {
%1 = call i32 (...) @HplMsp430Usart0P__Usart__disableRxIntr()
ret void
}

LLVM IR (-O2):
define void @Msp430SpiNoDmaP__0__Usart__disableRxIntr() {
%1 = tail call i32 (...) @HplMsp430Usart0P__Usart__disableRxIntr()
ret void
}
/* Type definitions */
struct evhttp_request {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void on_writer_sent_http(struct evhttp_request *req, void *ptr) {
  (void)req;
  (void)ptr;
  printf("sent write query\n");
}


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

x86 assembly (clang, -O2):
<on_writer_sent_http>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.evhttp_request = type { i32 }
@.str = [18 x i8] c"sent write query\0A\00"
define void @on_writer_sent_http(%struct.evhttp_request* %0, i8* %1) {
%3 = alloca %struct.evhttp_request*
%4 = alloca i8*
store %struct.evhttp_request* %0, %struct.evhttp_request** %3
store i8* %1, i8** %4
%5 = load %struct.evhttp_request*, %struct.evhttp_request** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.evhttp_request = type { i32 }
@str = [17 x i8] c"sent write query\00"
define void @on_writer_sent_http(%struct.evhttp_request* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x4f() {
  Assert_real((isgraph(79)),
              "/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_isgraph.c",
              400, ("isgraph should be 1 for O"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x4f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4f,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x190,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x4f>:
push   %rax
mov    $0x4f,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x190,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for O\00"
define void @t_isgraph_0x4f() {
%1 = call i32 @isgraph(i32 79)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for O\00"
define void @t_isgraph_0x4f() {
%1 = tail call i32 @isgraph(i32 79)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le64(int /*<<< orphan*/, void *);
void put_unaligned_le64(u_int64_t val, void *p) {
  __put_unaligned_le64(val, p);
}


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

x86 assembly (clang, -O2):
<put_unaligned_le64>:
jmp    1030 <__put_unaligned_le64@plt>

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

LLVM IR (-O2):
define void @put_unaligned_le64(i32 %0, i8* %1) {
%3 = tail call i32 @__put_unaligned_le64(i32 %0, i8* %1)
ret void
}