#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*/ dotest(char *, int, char *);
int main() {
  char s[] = "1234";
  dotest(s, 0, "");
  char s1[] = "";
  dotest(s1, 0, "");
  char s2[] = "1234";
  dotest(s2, 5, "");
  char s3[] = "733049910872815764";
  dotest(s3, 5, "330479108928157");
  char s4[] = "73304991087281576455176044327690580265896";
  dotest(s4, 8, "1994033775182780067155464327690480265895");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
lea    0xead(%rip),%rdx
call   1030 <dotest@plt>
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
lea    0xe8b(%rip),%rdx
call   1030 <dotest@plt>
mov    0xe7c(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xe77(%rip),%al
mov    %al,-0x7(%rbp)
lea    -0xb(%rbp),%rdi
mov    $0x5,%esi
lea    0xe64(%rip),%rdx
call   1030 <dotest@plt>
mov    0xe94(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe91(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe8e(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xe86(%rip),%al
mov    %al,-0xe(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
lea    0xe26(%rip),%rdx
call   1030 <dotest@plt>
lea    -0x50(%rbp),%rdi
lea    0xe71(%rip),%rsi
mov    $0x2a,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x8,%esi
lea    0xe0c(%rip),%rdx
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
movb   $0x0,0x1c(%rsp)
movl   $0x34333231,0x18(%rsp)
34
lea    0xedb(%rip),%rbx
lea    0x18(%rsp),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <dotest@plt>
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <dotest@plt>
movb   $0x0,0x14(%rsp)
movl   $0x34333231,0x10(%rsp)
34
lea    0x10(%rsp),%rdi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1030 <dotest@plt>
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x343637,0x2f(%rsp)
lea    0xe7f(%rip),%rdx
lea    0x20(%rsp),%rdi
mov    $0x5,%esi
call   1030 <dotest@plt>
movups 0xede(%rip),%xmm0
movups %xmm0,0x5a(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0xe55(%rip),%rdx
lea    0x40(%rsp),%rdi
mov    $0x8,%esi
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"1234\00"
@.str = [1 x i8] zeroinitializer
@__const.main.s2 = [5 x i8] c"1234\00"
@__const.main.s3 = [19 x i8] c"733049910872815764\00"
@.str.1 = [16 x i8] c"330479108928157\00"
@__const.main.s4 = [42 x i8] c"73304991087281576455176044327690580265896\00"
@.str.2 = [41 x i8] c"1994033775182780067155464327690480265895\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [1 x i8]
%3 = alloca [5 x i8]
%4 = alloca [19 x i8]
%5 = alloca [42 x i8]
%6 = bitcast [5 x i8]* %1 to i8*
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%8 = call i32 @dotest(i8* %7, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = bitcast [1 x i8]* %2 to i8*
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%11 = call i32 @dotest(i8* %10, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%12 = bitcast [5 x i8]* %3 to i8*
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%14 = call i32 @dotest(i8* %13, i32 5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%15 = bitcast [19 x i8]* %4 to i8*
%16 = getelementptr inbounds [19 x i8], [19 x i8]* %4, i64 0, i64 0
%17 = call i32 @dotest(i8* %16, i32 5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%18 = bitcast [42 x i8]* %5 to i8*
%19 = getelementptr inbounds [42 x i8], [42 x i8]* %5, i64 0, i64 0
%20 = call i32 @dotest(i8* %19, i32 8, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@__const.main.s2 = [5 x i8] c"1234\00"
@__const.main.s3 = [19 x i8] c"733049910872815764\00"
@.str.1 = [16 x i8] c"330479108928157\00"
@__const.main.s4 = [42 x i8] c"73304991087281576455176044327690580265896\00"
@.str.2 = [41 x i8] c"1994033775182780067155464327690480265895\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [1 x i8]
%3 = alloca [5 x i8]
%4 = alloca [19 x i8]
%5 = alloca [42 x i8]
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i32 @dotest(i8* %6, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 0, i8* %8
%9 = call i32 @dotest(i8* %8, i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%11 = call i32 @dotest(i8* %10, i32 5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [19 x i8], [19 x i8]* %4, i64 0, i64 0
%13 = call i32 @dotest(i8* %12, i32 5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [42 x i8], [42 x i8]* %5, i64 0, i64 0
%15 = call i32 @dotest(i8* %14, i32 8, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}