#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ check_byte_arrays(unsigned char *, unsigned int,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     char *);
int /*<<< orphan*/ get_return_ops();
int /*<<< orphan*/ get_return_ops_len();
int /*<<< orphan*/ output_statements_complete(unsigned char *, int,
                                              unsigned int *);
void test_output_statements_complete() {
  unsigned char buffer[128];
  unsigned int bytes_written = 0;
  output_statements_complete(buffer, 128, &bytes_written);
  check_byte_arrays(buffer, bytes_written, get_return_ops(),
                    get_return_ops_len(), "statements_complete");
}


x86 assembly (clang, -O0):
<test_output_statements_complete>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x84(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x80,%esi
lea    -0x84(%rbp),%rdx
call   1050 <output_statements_complete@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    $0x0,%al
call   1030 <get_return_ops@plt>
mov    %eax,-0x88(%rbp)
mov    $0x0,%al
call   1060 <get_return_ops_len@plt>
mov    -0x98(%rbp),%rdi
mov    -0x8c(%rbp),%esi
mov    -0x88(%rbp),%edx
mov    %eax,%ecx
lea    0xe4f(%rip),%r8
call   1040 <check_byte_arrays@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_output_statements_complete>:
push   %rbp
push   %r14
push   %rbx
sub    $0x90,%rsp
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
mov    $0x80,%esi
call   1050 <output_statements_complete@plt>
mov    0xc(%rsp),%ebp
xor    %eax,%eax
call   1030 <get_return_ops@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <get_return_ops_len@plt>
lea    0xe7b(%rip),%r8
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <check_byte_arrays@plt>
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"statements_complete\00"
define void @test_output_statements_complete() {
%1 = alloca [128 x i8]
%2 = alloca i32
store i32 0, i32* %2
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = call i32 @output_statements_complete(i8* %3, i32 128, i32* %2)
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 (...) @get_return_ops()
%8 = call i32 (...) @get_return_ops_len()
%9 = call i32 @check_byte_arrays(i8* %5, i32 %6, i32 %7, i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"statements_complete\00"
define void @test_output_statements_complete() {
%1 = alloca [128 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @output_statements_complete(i8* %3, i32 128, i32* %2)
%6 = load i32, i32* %2
%7 = call i32 (...) @get_return_ops()
%8 = call i32 (...) @get_return_ops_len()
%9 = call i32 @check_byte_arrays(i8* %3, i32 %6, i32 %7, i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}