#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 ulong;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void *stalloc(int);
int main(int argc, char const *argv[]) {
  char *testchar = stalloc(30);
  testchar = "01234567890123456789012345678";
  printf("%s\n", testchar);
  ulong *testnums = stalloc(100 * sizeof(ulong));
  for (ulong i = 0; i < 100; i++) {
    testnums[i] = i;
  }
  for (ulong i = 0; i < 200; i++) {
    printf("%i", (int)testnums[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1e,%edi
call   1040 <stalloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xeb5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x190,%edi
call   1040 <stalloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x64,-0x24(%rbp)
jge    119c <main+0x7c>
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1176 <main+0x56>
movl   $0x0,-0x28(%rbp)
cmpl   $0xc8,-0x28(%rbp)
jge    11d7 <main+0xb7>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11a3 <main+0x83>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1e,%edi
call   1050 <stalloc@plt>
lea    0x104a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x190,%edi
call   1050 <stalloc@plt>
mov    %rax,%r15
movaps 0xea1(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xea7(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xeac(%rip),%xmm0
movups %xmm0,0x20(%rax)
movaps 0xeb1(%rip),%xmm0
movups %xmm0,0x30(%rax)
movaps 0xeb6(%rip),%xmm0
movups %xmm0,0x40(%rax)
movaps 0xebb(%rip),%xmm0
movups %xmm0,0x50(%rax)
movaps 0xec0(%rip),%xmm0
movups %xmm0,0x60(%rax)
movaps 0xec5(%rip),%xmm0
movups %xmm0,0x70(%rax)
movaps 0xeca(%rip),%xmm0
movups %xmm0,0x80(%rax)
movaps 0xecc(%rip),%xmm0
movups %xmm0,0x90(%rax)
movaps 0xece(%rip),%xmm0
movups %xmm0,0xa0(%rax)
movaps 0xed0(%rip),%xmm0
movups %xmm0,0xb0(%rax)
movaps 0xed2(%rip),%xmm0
movups %xmm0,0xc0(%rax)
movaps 0xed4(%rip),%xmm0
movups %xmm0,0xd0(%rax)
movaps 0xed6(%rip),%xmm0
movups %xmm0,0xe0(%rax)
movaps 0xed8(%rip),%xmm0
movups %xmm0,0xf0(%rax)
movaps 0xeda(%rip),%xmm0
movups %xmm0,0x100(%rax)
movaps 0xedc(%rip),%xmm0
movups %xmm0,0x110(%rax)
movaps 0xede(%rip),%xmm0
movups %xmm0,0x120(%rax)
movaps 0xee0(%rip),%xmm0
movups %xmm0,0x130(%rax)
movaps 0xee2(%rip),%xmm0
movups %xmm0,0x140(%rax)
movaps 0xee4(%rip),%xmm0
movups %xmm0,0x150(%rax)
movaps 0xee6(%rip),%xmm0
movups %xmm0,0x160(%rax)
movaps 0xee8(%rip),%xmm0
movups %xmm0,0x170(%rax)
movaps 0xeea(%rip),%xmm0
movups %xmm0,0x180(%rax)
lea    0xf0a(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0xc8,%rbx
jne    12b0 <main+0x180>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"01234567890123456789012345678\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i8* @stalloc(i32 30)
store i8* %10, i8** %6
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %6
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i8* @stalloc(i32 400)
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %7
store i32 0, i32* %8
br label %15
15: ; preds = %24, %2
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 100
br i1 %17, label %18, label %27
18: ; preds = %15
%19 = load i32, i32* %8
%20 = load i32*, i32** %7
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
br label %24
24: ; preds = %18
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %15
27: ; preds = %15
store i32 0, i32* %9
br label %28
28: ; preds = %38, %27
%29 = load i32, i32* %9
%30 = icmp slt i32 %29, 200
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load i32*, i32** %7
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %31
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
br label %28
41: ; preds = %28
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"01234567890123456789012345678\00"
@.str.2 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @stalloc(i32 30)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = tail call i8* @stalloc(i32 400)
%6 = bitcast i8* %5 to i32*
%7 = bitcast i8* %5 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %7
%8 = getelementptr inbounds i8, i8* %5, i64 16
%9 = bitcast i8* %8 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %9
%10 = getelementptr inbounds i8, i8* %5, i64 32
%11 = bitcast i8* %10 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %11
%12 = getelementptr inbounds i8, i8* %5, i64 48
%13 = bitcast i8* %12 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %13
%14 = getelementptr inbounds i8, i8* %5, i64 64
%15 = bitcast i8* %14 to <4 x i32>*
store <4 x i32> <i32 16, i32 17, i32 18, i32 19>, <4 x i32>* %15
%16 = getelementptr inbounds i8, i8* %5, i64 80
%17 = bitcast i8* %16 to <4 x i32>*
store <4 x i32> <i32 20, i32 21, i32 22, i32 23>, <4 x i32>* %17
%18 = getelementptr inbounds i8, i8* %5, i64 96
%19 = bitcast i8* %18 to <4 x i32>*
store <4 x i32> <i32 24, i32 25, i32 26, i32 27>, <4 x i32>* %19
%20 = getelementptr inbounds i8, i8* %5, i64 112
%21 = bitcast i8* %20 to <4 x i32>*
store <4 x i32> <i32 28, i32 29, i32 30, i32 31>, <4 x i32>* %21
%22 = getelementptr inbounds i8, i8* %5, i64 128
%23 = bitcast i8* %22 to <4 x i32>*
store <4 x i32> <i32 32, i32 33, i32 34, i32 35>, <4 x i32>* %23
%24 = getelementptr inbounds i8, i8* %5, i64 144
%25 = bitcast i8* %24 to <4 x i32>*
store <4 x i32> <i32 36, i32 37, i32 38, i32 39>, <4 x i32>* %25
%26 = getelementptr inbounds i8, i8* %5, i64 160
%27 = bitcast i8* %26 to <4 x i32>*
store <4 x i32> <i32 40, i32 41, i32 42, i32 43>, <4 x i32>* %27
%28 = getelementptr inbounds i8, i8* %5, i64 176
%29 = bitcast i8* %28 to <4 x i32>*
store <4 x i32> <i32 44, i32 45, i32 46, i32 47>, <4 x i32>* %29
%30 = getelementptr inbounds i8, i8* %5, i64 192
%31 = bitcast i8* %30 to <4 x i32>*
store <4 x i32> <i32 48, i32 49, i32 50, i32 51>, <4 x i32>* %31
%32 = getelementptr inbounds i8, i8* %5, i64 208
%33 = bitcast i8* %32 to <4 x i32>*
store <4 x i32> <i32 52, i32 53, i32 54, i32 55>, <4 x i32>* %33
%34 = getelementptr inbounds i8, i8* %5, i64 224
%35 = bitcast i8* %34 to <4 x i32>*
store <4 x i32> <i32 56, i32 57, i32 58, i32 59>, <4 x i32>* %35
%36 = getelementptr inbounds i8, i8* %5, i64 240
%37 = bitcast i8* %36 to <4 x i32>*
store <4 x i32> <i32 60, i32 61, i32 62, i32 63>, <4 x i32>* %37
%38 = getelementptr inbounds i8, i8* %5, i64 256
%39 = bitcast i8* %38 to <4 x i32>*
store <4 x i32> <i32 64, i32 65, i32 66, i32 67>, <4 x i32>* %39
%40 = getelementptr inbounds i8, i8* %5, i64 272
%41 = bitcast i8* %40 to <4 x i32>*
store <4 x i32> <i32 68, i32 69, i32 70, i32 71>, <4 x i32>* %41
%42 = getelementptr inbounds i8, i8* %5, i64 288
%43 = bitcast i8* %42 to <4 x i32>*
store <4 x i32> <i32 72, i32 73, i32 74, i32 75>, <4 x i32>* %43
%44 = getelementptr inbounds i8, i8* %5, i64 304
%45 = bitcast i8* %44 to <4 x i32>*
store <4 x i32> <i32 76, i32 77, i32 78, i32 79>, <4 x i32>* %45
%46 = getelementptr inbounds i8, i8* %5, i64 320
%47 = bitcast i8* %46 to <4 x i32>*
store <4 x i32> <i32 80, i32 81, i32 82, i32 83>, <4 x i32>* %47
%48 = getelementptr inbounds i8, i8* %5, i64 336
%49 = bitcast i8* %48 to <4 x i32>*
store <4 x i32> <i32 84, i32 85, i32 86, i32 87>, <4 x i32>* %49
%50 = getelementptr inbounds i8, i8* %5, i64 352
%51 = bitcast i8* %50 to <4 x i32>*
store <4 x i32> <i32 88, i32 89, i32 90, i32 91>, <4 x i32>* %51
%52 = getelementptr inbounds i8, i8* %5, i64 368
%53 = bitcast i8* %52 to <4 x i32>*
store <4 x i32> <i32 92, i32 93, i32 94, i32 95>, <4 x i32>* %53
%54 = getelementptr inbounds i8, i8* %5, i64 384
%55 = bitcast i8* %54 to <4 x i32>*
store <4 x i32> <i32 96, i32 97, i32 98, i32 99>, <4 x i32>* %55
br label %57
56: ; preds = %57
ret i32 0
57: ; preds = %2, %57
%58 = phi i64 [ %62, %57 ], [ 0, %2 ]
%59 = getelementptr inbounds i32, i32* %6, i64 %58
%60 = load i32, i32* %59
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %60)
%62 = add nuw nsw i64 %58, 1
%63 = icmp eq i64 %62, 200
br i1 %63, label %56, label %57
}