#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 */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ test_output_memory(char *, unsigned char const *, int);
int /*<<< orphan*/ test_output_string(char *, char const *, int);
int test_output(void) {
  const char s[] = "1234567890123456789012345678901234567890123456789012"
                   "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  test_output_string("test", s, sizeof(s) - 1);
  test_output_memory("test", (const unsigned char *)s, sizeof(s));
  return 1;
}


x86 assembly (clang, -O0):
<test_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x69,%edx
call   1030 <memcpy@plt>
lea    -0x70(%rbp),%rsi
lea    0xf11(%rip),%rdi
mov    $0x68,%edx
call   1040 <test_output_string@plt>
lea    -0x70(%rbp),%rsi
lea    0xefc(%rip),%rdi
mov    $0x69,%edx
call   1050 <test_output_memory@plt>
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_output>:
push   %r14
push   %rbx
sub    $0x78,%rsp
movups 0xf2b(%rip),%xmm0
movups %xmm0,0x59(%rsp)
movaps 0xf16(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee8(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x68,%edx
call   1030 <test_output_string@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x69,%edx
call   1040 <test_output_memory@plt>
mov    $0x1,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test_output.s = [105 x i8] c"1234567890123456789012345678901234567890123456789012abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str = [5 x i8] c"test\00"
define i32 @test_output() {
%1 = alloca [105 x i8]
%2 = bitcast [105 x i8]* %1 to i8*
%3 = getelementptr inbounds [105 x i8], [105 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_output_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i32 104)
%5 = getelementptr inbounds [105 x i8], [105 x i8]* %1, i64 0, i64 0
%6 = call i32 @test_output_memory(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i32 105)
ret i32 1
}

LLVM IR (-O2):
@__const.test_output.s = [105 x i8] c"1234567890123456789012345678901234567890123456789012abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str = [5 x i8] c"test\00"
define i32 @test_output() {
%1 = alloca [105 x i8]
%2 = getelementptr inbounds [105 x i8], [105 x i8]* %1, i64 0, i64 0
%3 = call i32 @test_output_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i32 104)
%4 = call i32 @test_output_memory(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i32 105)
ret i32 1
}