xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void print_int_arr(int *arr, size_t size_of_arr) {
  int i;
  for (i = 0; i < size_of_arr; i++) {
    printf("%d ", arr[i]);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_int_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116a <print_int_arr+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <print_int_arr+0x17>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <print_int_arr+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_int_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_int_arr(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
int execute_shmctl() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_shmctl() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_to_le32(int /*<<< orphan*/);
void cpu_to_le32w(uint32_t *p, uint32_t v) { *p = cpu_to_le32(v); }


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

x86 assembly (clang, -O2):
<cpu_to_le32w>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <cpu_to_le32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cpu_to_le32w(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @cpu_to_le32(i32 %1)
store i32 %3, i32* %0
ret void
}
void test_keywords(int i) {
  __emit_expression_range(0, __FUNCTION__[i]);
  __emit_expression_range(0, __PRETTY_FUNCTION__);
  __emit_expression_range(0, __func__);
}


x86 assembly (clang, -O0):
<test_keywords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeda(%rip),%rax
movsbl (%rax,%rcx,1),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_keywords>:
push   %rbx
movslq %edi,%rax
lea    0xee5(%rip),%rbx
movsbl (%rax,%rbx,1),%esi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <__emit_expression_range@plt>
lea    0xedf(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
@__FUNCTION__.test_keywords = [14 x i8] c"test_keywords\00"
@__PRETTY_FUNCTION__.test_keywords = [24 x i8] c"void test_keywords(int)\00"
define void @test_keywords(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [14 x i8], [14 x i8]* @__FUNCTION__.test_keywords, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %7)
%9 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__PRETTY_FUNCTION__.test_keywords, i64 0, i64 0))
%10 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.test_keywords, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.test_keywords = [14 x i8] c"test_keywords\00"
@__PRETTY_FUNCTION__.test_keywords = [24 x i8] c"void test_keywords(int)\00"
define void @test_keywords(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [14 x i8], [14 x i8]* @__FUNCTION__.test_keywords, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i32, ...)*)(i32 0, i32 %5)
%7 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__PRETTY_FUNCTION__.test_keywords, i64 0, i64 0))
%8 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @__emit_expression_range to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.test_keywords, i64 0, i64 0))
ret void
}
/* Type definitions */
struct field {
  int dummy;
};

/* Variables and functions */
int __update_bin(struct field *, char *, int);
int update_bin(struct field *field, char *value) {
  return __update_bin(field, value, false);
}


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

x86 assembly (clang, -O2):
<update_bin>:
xor    %edx,%edx
jmp    1030 <__update_bin@plt>

LLVM IR (-O0):
%struct.field = type { i32 }
define i32 @update_bin(%struct.field* %0, i8* %1) {
%3 = alloca %struct.field*
%4 = alloca i8*
store %struct.field* %0, %struct.field** %3
store i8* %1, i8** %4
%5 = load %struct.field*, %struct.field** %3
%6 = load i8*, i8** %4
%7 = call i32 @__update_bin(%struct.field* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.field = type { i32 }
define i32 @update_bin(%struct.field* %0, i8* %1) {
%3 = tail call i32 @__update_bin(%struct.field* %0, i8* %1, i32 0)
ret i32 %3
}
void destroy_key(void *data) {
  int *key = data;
  *key = 1;
}


x86 assembly (clang, -O0):
<destroy_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_key>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @destroy_key(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @destroy_key(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 1, i32* %2
ret void
}
int f(int n, int c, int s) {
  int a2, a3, a4, x1, x2, x3, x4;
  x1 = c + s;
  a2 = 3 * s;
  x2 = c + a2;
  x3 = x4 = c;
  if (n > 64) {
    a3 = 5 * s;
    x3 = c + a3;
    a4 = 7 * s;
    x4 = c + a4;
  }
  return x1 + x2 + x3 + x4;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
imul   $0x3,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    %eax,-0x24(%rbp)
cmpl   $0x40,-0x4(%rbp)
jle    1159 <f+0x59>
imul   $0x5,-0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
imul   $0x7,-0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x0(,%rdx,8),%ecx
sub    %edx,%ecx
xor    %eax,%eax
cmp    $0x41,%edi
lea    (%rdx,%rdx,4),%edi
cmovl  %eax,%edi
cmovl  %eax,%ecx
lea    (%rdx,%rdx,2),%r8d
lea    (%rdx,%rsi,4),%eax
add    %r8d,%eax
add    %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %6
%18 = mul nsw i32 3, %17
store i32 %18, i32* %7
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
store i32 %21, i32* %11
%22 = load i32, i32* %5
store i32 %22, i32* %13
store i32 %22, i32* %12
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 64
br i1 %24, label %25, label %36
25: ; preds = %3
%26 = load i32, i32* %6
%27 = mul nsw i32 5, %26
store i32 %27, i32* %8
%28 = load i32, i32* %5
%29 = load i32, i32* %8
%30 = add nsw i32 %28, %29
store i32 %30, i32* %12
%31 = load i32, i32* %6
%32 = mul nsw i32 7, %31
store i32 %32, i32* %9
%33 = load i32, i32* %5
%34 = load i32, i32* %9
%35 = add nsw i32 %33, %34
store i32 %35, i32* %13
br label %36
36: ; preds = %25, %3
%37 = load i32, i32* %10
%38 = load i32, i32* %11
%39 = add nsw i32 %37, %38
%40 = load i32, i32* %12
%41 = add nsw i32 %39, %40
%42 = load i32, i32* %13
%43 = add nsw i32 %41, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 64
%5 = mul nsw i32 %2, 5
%6 = mul nsw i32 %2, 7
%7 = select i1 %4, i32 %5, i32 0
%8 = select i1 %4, i32 %6, i32 0
%9 = mul nsw i32 %2, 3
%10 = shl i32 %1, 2
%11 = add i32 %10, %2
%12 = add i32 %11, %9
%13 = add i32 %12, %8
%14 = add i32 %13, %7
ret i32 %14
}
int main() {
  char s[] = "abcdefghijhk";
  do {
  } while (0);
  do {
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xee7(%rip),%al
mov    %al,-0x5(%rbp)
jmp    112d <main+0x2d>
jmp    1132 <main+0x32>
jmp    1137 <main+0x37>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [13 x i8] c"abcdefghijhk\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
store i32 0, i32* %1
%3 = bitcast [13 x i8]* %2 to i8*
br label %4
4: ; preds = %0
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
char *strdup(char *);
char *to_string(unsigned int value) {
  char tmp[20];
  sprintf(tmp, "%d", value);
  return strdup(tmp);
}


x86 assembly (clang, -O0):
<to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_string>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @to_string(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ put_char_int(int);
void OUTSTR(int c1, int c2, int c3) {
  put_char_int(c1);
  put_char_int(c2);
  put_char_int(c3);
}


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

x86 assembly (clang, -O2):
<OUTSTR>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <put_char_int@plt>
mov    %ebp,%edi
call   1030 <put_char_int@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put_char_int@plt>

LLVM IR (-O0):
define void @OUTSTR(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 = call i32 @put_char_int(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @put_char_int(i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @put_char_int(i32 %11)
ret void
}

LLVM IR (-O2):
define void @OUTSTR(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put_char_int(i32 %0)
%5 = tail call i32 @put_char_int(i32 %1)
%6 = tail call i32 @put_char_int(i32 %2)
ret void
}
double JHKeyframeAnimationFunctionEaseInQuart(double t, double b, double c,
                                              double d) {
  return c * (t /= d) * t * t * t + b;
}


x86 assembly (clang, -O0):
<JHKeyframeAnimationFunctionEaseInQuart>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbp)
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<JHKeyframeAnimationFunctionEaseInQuart>:
divsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @JHKeyframeAnimationFunctionEaseInQuart(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = fdiv double %11, %10
store double %12, double* %5
%13 = fmul double %9, %12
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = load double, double* %5
%17 = fmul double %15, %16
%18 = load double, double* %5
%19 = load double, double* %6
%20 = call double @llvm.fmuladd.f64(double %17, double %18, double %19)
ret double %20
}

LLVM IR (-O2):
define double @JHKeyframeAnimationFunctionEaseInQuart(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %3
%6 = fmul double %5, %2
%7 = fmul double %5, %6
%8 = fmul double %5, %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %5, double %1)
ret double %9
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int __lock;
};
struct TYPE_5__ {
  TYPE_1__ __data;
};
typedef TYPE_2__ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ __ESBMC_atomic_begin();
int /*<<< orphan*/ __ESBMC_atomic_end();
int pthread_mutex_lock_nocheck(pthread_mutex_t *mutex) {
__ESBMC_HIDE:
  __ESBMC_atomic_begin();
  __ESBMC_assume(!((*mutex).__data.__lock));
  ((*mutex).__data.__lock) = 1;
  __ESBMC_atomic_end();
  return 0;
}


x86 assembly (clang, -O0):
<pthread_mutex_lock_nocheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <__ESBMC_atomic_begin@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__ESBMC_assume@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x0,%al
call   1030 <__ESBMC_atomic_end@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_lock_nocheck>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <__ESBMC_atomic_begin@plt>
xor    %edi,%edi
cmpl   $0x0,(%rbx)
sete   %dil
call   1040 <__ESBMC_assume@plt>
movl   $0x1,(%rbx)
xor    %eax,%eax
call   1030 <__ESBMC_atomic_end@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
define i32 @pthread_mutex_lock_nocheck(%struct.TYPE_5__* %0) {
%2 = alloca %struct.TYPE_5__*
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %2
br label %3
3: ; preds = %1
%4 = call i32 (...) @__ESBMC_atomic_begin()
%5 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%6 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @__ESBMC_assume(i32 %11)
%13 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%14 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %13, i32 0, i32 0
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %14, i32 0, i32 0
store i32 1, i32* %15
%16 = call i32 (...) @__ESBMC_atomic_end()
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
define i32 @pthread_mutex_lock_nocheck(%struct.TYPE_5__* nocapture %0) {
%2 = tail call i32 (...) @__ESBMC_atomic_begin()
%3 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0, i32 0
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @__ESBMC_assume(i32 %6)
store i32 1, i32* %3
%8 = tail call i32 (...) @__ESBMC_atomic_end()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_chars(char const *);
int /*<<< orphan*/ test_move_chars(char const *);
int /*<<< orphan*/ test_move_rows(char const *);
int /*<<< orphan*/ test_rows(char const *);
int main(void) {
  const char *filename = "./file.txt";
  test_chars(filename);
  test_rows(filename);
  test_move_rows(filename);
  test_move_chars(filename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <test_chars@plt>
mov    -0x10(%rbp),%rdi
call   1040 <test_rows@plt>
mov    -0x10(%rbp),%rdi
call   1050 <test_move_rows@plt>
mov    -0x10(%rbp),%rdi
call   1060 <test_move_chars@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <test_chars@plt>
mov    %rbx,%rdi
call   1040 <test_rows@plt>
mov    %rbx,%rdi
call   1050 <test_move_rows@plt>
mov    %rbx,%rdi
call   1060 <test_move_chars@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"./file.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @test_chars(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @test_rows(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @test_move_rows(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @test_move_chars(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"./file.txt\00"
define i32 @main() {
%1 = tail call i32 @test_chars(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test_rows(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @test_move_rows(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @test_move_chars(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void global_init() { fprintf(stderr, "Running Global Init\n"); }


x86 assembly (clang, -O0):
<global_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<global_init>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Running Global Init\0A\00"
define void @global_init() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Running Global Init\0A\00"
define void @global_init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
double stress_funcret_deep_double1(int /*<<< orphan*/);
int /*<<< orphan*/ stress_funcret_double1(double);
double __attribute__((no)) stress_funcret_deeper_double1(double a) {
  double b;
  (void)memcpy(&b, &a, sizeof(a));
  (void)memset(&a, 0, sizeof(a));
  return stress_funcret_deep_double1(stress_funcret_double1(b));
}


x86 assembly (clang, -O0):
<stress_funcret_deeper_double1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1060 <memcpy@plt>
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <stress_funcret_double1@plt>
mov    %eax,%edi
call   1040 <stress_funcret_deep_double1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcret_deeper_double1>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rsp,%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x8,%edx
call   1060 <memcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movsd  (%rsp),%xmm0
call   1050 <stress_funcret_double1@plt>
mov    %eax,%edi
call   1040 <stress_funcret_deep_double1@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @stress_funcret_deeper_double1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call i32 @memcpy(double* %3, double* %2, i32 8)
%5 = call i32 @memset(double* %2, i32 0, i32 8)
%6 = load double, double* %3
%7 = call i32 @stress_funcret_double1(double %6)
%8 = call double @stress_funcret_deep_double1(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @stress_funcret_deeper_double1(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = bitcast double* %3 to i8*
%5 = call i32 @memcpy(double* %3, double* %2, i32 8)
%6 = call i32 @memset(double* %2, i32 0, i32 8)
%7 = load double, double* %3
%8 = call i32 @stress_funcret_double1(double %7)
%9 = call double @stress_funcret_deep_double1(i32 %8)
ret double %9
}
void PlatformCleanup() {}


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

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

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

LLVM IR (-O2):
define void @PlatformCleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_postgres() { printf("\n"); }


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

x86 assembly (clang, -O2):
<dummy_postgres>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @dummy_postgres() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @dummy_postgres() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                         char *);
int mkstemp(char *);
int xmkstemp(char *pattern) {
  int fd = mkstemp(pattern);
  if (fd < 0)
    error(EXIT_FAILURE, errno, "mkstemp: %s", pattern);
  return fd;
}


x86 assembly (clang, -O0):
<xmkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mkstemp@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1164 <xmkstemp+0x44>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
lea    0xea1(%rip),%rdx
call   1040 <error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmkstemp>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <mkstemp@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1152 <xmkstemp+0x32>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
lea    0xeb6(%rip),%rdx
mov    %rbx,%rcx
call   1040 <error@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [12 x i8] c"mkstemp: %s\00"
define i32 @xmkstemp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @mkstemp(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = load i32, i32* @errno
%11 = load i8*, i8** %2
%12 = call i32 @error(i32 %9, i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %8, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [12 x i8] c"mkstemp: %s\00"
define i32 @xmkstemp(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @errno
%7 = tail call i32 @error(i32 %5, i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %4, %1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ usart_cs(int);
int /*<<< orphan*/ usart_in_byte();
int /*<<< orphan*/ usart_out_byte(int);
uint8_t rdsr(void) {
  uint8_t status;
  usart_cs(0);
  usart_out_byte(0x05);
  status = usart_in_byte();
  usart_cs(1);
  return status;
}


x86 assembly (clang, -O0):
<rdsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <usart_cs@plt>
mov    $0x5,%edi
call   1040 <usart_out_byte@plt>
mov    $0x0,%al
call   1030 <usart_in_byte@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <usart_cs@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdsr>:
push   %rbx
xor    %edi,%edi
call   1050 <usart_cs@plt>
mov    $0x5,%edi
call   1040 <usart_out_byte@plt>
xor    %eax,%eax
call   1030 <usart_in_byte@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <usart_cs@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rdsr() {
%1 = alloca i32
%2 = call i32 @usart_cs(i32 0)
%3 = call i32 @usart_out_byte(i32 5)
%4 = call i32 (...) @usart_in_byte()
store i32 %4, i32* %1
%5 = call i32 @usart_cs(i32 1)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @rdsr() {
%1 = tail call i32 @usart_cs(i32 0)
%2 = tail call i32 @usart_out_byte(i32 5)
%3 = tail call i32 (...) @usart_in_byte()
%4 = tail call i32 @usart_cs(i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int bn_rand_range(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range) {
  return bn_rand_range(1, r, range);
}


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

x86 assembly (clang, -O2):
<BN_pseudo_rand_range>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <bn_rand_range@plt>

LLVM IR (-O0):
define i32 @BN_pseudo_rand_range(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 @bn_rand_range(i32 1, i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @BN_pseudo_rand_range(i32* %0, i32* %1) {
%3 = tail call i32 @bn_rand_range(i32 1, i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ all_moves_base(int);
void all_captures() { all_moves_base(1); }


x86 assembly (clang, -O0):
<all_captures>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <all_moves_base@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @all_captures() {
%1 = call i32 @all_moves_base(i32 1)
ret void
}

LLVM IR (-O2):
define void @all_captures() {
%1 = tail call i32 @all_moves_base(i32 1)
ret void
}
int of_get_available_child_count(const struct device_node *parent) {
  return -38;
}


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

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_get_available_child_count(%struct.device_node* nocapture readnone %0) {
ret i32 -38
}
/* Variables and functions */
int /*<<< orphan*/ quit(char *);
void answer_rejected(void) { quit("Error: Rejected feature!\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Error: Rejected feature!\0A\00"
define void @answer_rejected() {
%1 = call i32 @quit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Error: Rejected feature!\0A\00"
define void @answer_rejected() {
%1 = tail call i32 @quit(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct servermsg {
  int dummy;
};
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int regexec(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/,
            int /*<<< orphan*/ *, int /*<<< orphan*/);
int match_ev_str(const char *ms, const char *ev, regex_t *regex,
                 const struct servermsg *msg) {
  int ret;
  ret = regexec(regex, ms, 0, NULL, 0);
  if (ret == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<match_ev_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r8d,%r8d
xor    %eax,%eax
mov    %eax,%ecx
mov    %r8d,%edx
call   1030 <regexec@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1158 <match_ev_str+0x48>
movl   $0x1,-0x4(%rbp)
jmp    115f <match_ev_str+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_ev_str>:
push   %rax
mov    %rdi,%rsi
mov    %rdx,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <regexec@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.servermsg = type { i32 }
define i32 @match_ev_str(i8* %0, i8* %1, i32* %2, %struct.servermsg* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca %struct.servermsg*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store %struct.servermsg* %3, %struct.servermsg** %9
%11 = load i32*, i32** %8
%12 = load i8*, i8** %6
%13 = call i32 @regexec(i32* %11, i8* %12, i32 0, i32* null, i32 0)
store i32 %13, i32* %10
%14 = load i32, i32* %10
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %4
store i32 1, i32* %5
br label %18
17: ; preds = %4
store i32 0, i32* %5
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
%struct.servermsg = type { i32 }
define i32 @match_ev_str(i8* %0, i8* nocapture readnone %1, i32* %2, %struct.servermsg* nocapture readnone %3) {
%5 = tail call i32 @regexec(i32* %2, i8* %0, i32 0, i32* null, i32 0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ return_sense(int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
void sam_not_ready(uint16_t ascq, uint8_t *sam_stat) {
  return_sense(0x02, ascq, NULL, sam_stat);
}


x86 assembly (clang, -O0):
<sam_not_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <return_sense@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam_not_ready>:
mov    %rsi,%rcx
mov    %edi,%esi
mov    $0x2,%edi
xor    %edx,%edx
jmp    1030 <return_sense@plt>

LLVM IR (-O0):
define void @sam_not_ready(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 @return_sense(i32 2, i32 %5, i32* null, i32* %6)
ret void
}

LLVM IR (-O2):
define void @sam_not_ready(i32 %0, i32* %1) {
%3 = tail call i32 @return_sense(i32 2, i32 %0, i32* null, i32* %1)
ret void
}
/* Variables and functions */
int __libc_alloca_cutoff(size_t size) { return size <= 4096; }


x86 assembly (clang, -O0):
<__libc_alloca_cutoff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1000,-0x8(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_alloca_cutoff>:
xor    %eax,%eax
cmp    $0x1001,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @__libc_alloca_cutoff(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 %3, 4096
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @__libc_alloca_cutoff(i64 %0) {
%2 = icmp ult i64 %0, 4097
%3 = zext i1 %2 to i32
ret i32 %3
}
void decodeOpcode(const char *src) {}


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

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

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

LLVM IR (-O2):
define void @decodeOpcode(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void put(char c) { write(1, &c, 1); }


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

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

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

LLVM IR (-O2):
define void @put(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
void foo636(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo636(i32 %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void Q_StrToLower(char *io_string) {
  int i;
  for (i = 0; i < strlen(io_string); i++) {
    io_string[i] = tolower(io_string[i]);
  }
}


x86 assembly (clang, -O0):
<Q_StrToLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <Q_StrToLower+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <Q_StrToLower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_StrToLower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <Q_StrToLower+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <Q_StrToLower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @Q_StrToLower(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
int input_map_bbegin(char c) {
  if (c >= '4' && c <= '9')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<input_map_bbegin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x34,%eax
jl     1130 <input_map_bbegin+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <input_map_bbegin+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <input_map_bbegin+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_map_bbegin>:
add    $0xcc,%dil
xor    %eax,%eax
cmp    $0x6,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @input_map_bbegin(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 52
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @input_map_bbegin(i8 signext %0) {
%2 = add i8 %0, -52
%3 = icmp ult i8 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ japi_setport(int);
void j_setport(int arg0) { japi_setport(arg0); }


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

x86 assembly (clang, -O2):
<j_setport>:
jmp    1030 <japi_setport@plt>

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

LLVM IR (-O2):
define void @j_setport(i32 %0) {
%2 = tail call i32 @japi_setport(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(int *, int, int, int /*<<< orphan*/ *);
int readciphertext(int buf[], char *name) {
  FILE *fd;
  int ret;
  fd = fopen(name, "r");
  ret = fread(buf, 4, 32, fd);
  fclose(fd);
  return ret;
}


x86 assembly (clang, -O0):
<readciphertext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x20,%edx
call   1030 <fread@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readciphertext>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rax
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x4,%esi
mov    $0x20,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @readciphertext(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i32*, i32** %3
%10 = load i32*, i32** %5
%11 = call i32 @fread(i32* %9, i32 4, i32 32, i32* %10)
store i32 %11, i32* %6
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @readciphertext(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fread(i32* %0, i32 4, i32 32, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _(char *);
int /*<<< orphan*/ pz_do_dialog(char const *, char const *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
void pz_message_title(const char *title, const char *text) {
  pz_do_dialog(title, text, _("Ok"), 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<pz_message_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb9(%rip),%rdi
call   1040 <_@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <pz_do_dialog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pz_message_title>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1040 <_@plt>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <pz_do_dialog@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"Ok\00"
define void @pz_message_title(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @_(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @pz_do_dialog(i8* %5, i8* %6, i32 %7, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"Ok\00"
define void @pz_message_title(i8* %0, i8* %1) {
%3 = tail call i32 @_(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @pz_do_dialog(i8* %0, i8* %1, i32 %3, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *);
void getenter(void) {
  printf("Press ENTER to continue/exit.");
  while (getchar() != 0xa)
    ;
}


x86 assembly (clang, -O0):
<getenter>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1145 <getenter+0x25>
jmp    1130 <getenter+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenter>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1130 <getenter+0x10>
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Press ENTER to continue/exit.\00"
define void @getenter() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %5, %0
%3 = call i32 (...) @getchar()
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Press ENTER to continue/exit.\00"
define void @getenter() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}