#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*/ exit(int);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
char *random_string(int);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
char *strncpy(char *, char *, int);
int main(void) {
  int i, j, c;
  char *ret_str;
  for (i = 1; i < 50000; i += 2000) {
    c = 0;
    char *sample_str_1;
    char *sample_str_2 = malloc(i + 10);
    if (sample_str_2 == NULL) {
      printf("strncpy/2-1.c"
             " Failed to allocate memory\n");
      exit(2);
    }
    sample_str_1 = random_string(i);
    ret_str = strncpy(sample_str_2, sample_str_1, i + 10);
    sample_str_2[i + 10] = '\0';
    if (strcmp(sample_str_1, sample_str_2) != 0) {
      printf("strncpy/2-1.c"
             " Test failed, string copy failed. "
             "Expected string: %s, But got: %s\n",
             sample_str_1, sample_str_2);
      exit(2);
    } else if (ret_str != sample_str_2) {
      printf("strncpy/2-1.c"
             " Test Failed, return is not as expected. "
             "Expected return: %p, But obtained: %p\n",
             sample_str_2, ret_str);
      exit(1);
    }
    for (j = strlen(sample_str_1); j < i + 10; j++) {
      if (sample_str_2[j] == '\0') {
        c++;
      }
    }
    if (c != 10) {
      printf("strncpy/2-1.c"
             " Test Failed, The difference in the number of bytes"
             " for two strings (s1 and s2) have not been appended"
             " with NULL bytes\n");
      exit(1);
    }
    free(sample_str_1);
    free(sample_str_2);
  }
  printf("strncpy/2-1.c"
         "  Test Passed, The difference in the number of bytes for two "
         "strings (s1 and s2) have been appended with NULL bytes in s2\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xc350,-0x8(%rbp)
jge    130c <main+0x18c>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
add    $0xa,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11dc <main+0x5c>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x2,%edi
call   10a0 <exit@plt>
mov    -0x8(%rbp),%edi
call   1050 <random_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%edx
add    $0xa,%edx
call   1040 <strncpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0xa,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1247 <main+0xc7>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x2,%edi
call   10a0 <exit@plt>
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1275 <main+0xf5>
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    127a <main+0xfa>
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0xa,%ecx
cmp    %ecx,%eax
jge    12c8 <main+0x148>
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    12b5 <main+0x135>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    12ba <main+0x13a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1286 <main+0x106>
cmpl   $0xa,-0x10(%rbp)
je     12ea <main+0x16a>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
add    $0x7d0,%eax
mov    %eax,-0x8(%rbp)
jmp    1196 <main+0x16>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x1,%ebp
mov    $0xb,%r14d
xor    %r13d,%r13d
nopl   0x0(%rax)
lea    0xa(%rbp),%r15
mov    %r15d,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     141c <main+0x28c>
mov    %rax,%rbx
mov    %r14,0x10(%rsp)
mov    %r13,%r14
mov    %ebp,%edi
call   1060 <random_string@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r15d,%edx
call   1040 <strncpy@plt>
mov    %rax,%r13
mov    %rbp,0x8(%rsp)
movb   $0x0,0xa(%rbx,%rbp,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1432 <main+0x2a2>
cmp    %rbx,%r13
jne    1450 <main+0x2c0>
mov    %r12,%rdi
call   1070 <strlen@plt>
cltq
cmp    %rax,%r15
mov    %r14,%r13
mov    0x10(%rsp),%r14
jle    1406 <main+0x276>
imul   $0x7d0,%r13,%rcx
or     $0xb,%rcx
sub    %rax,%rcx
xor    %edx,%edx
cmp    $0x8,%rcx
jb     1390 <main+0x200>
mov    %rcx,%r8
and    $0xfffffffffffffff8,%r8
lea    -0x8(%r8),%rdx
mov    %rdx,%rsi
shr    $0x3,%rsi
add    $0x1,%rsi
test   %rdx,%rdx
je     13de <main+0x24e>
lea    (%rbx,%rax,1),%rdx
add    $0xc,%rdx
mov    %r14,%r9
mov    %r14,%rbp
sub    %rax,%rbp
and    $0xfffffffffffffff8,%rbp
add    $0xfffffffffffffff8,%rbp
shr    $0x3,%rbp
add    $0x1,%rbp
and    $0xfffffffffffffffe,%rbp
pxor   %xmm0,%xmm0
xor    %edi,%edi
pxor   %xmm1,%xmm1
pxor   %xmm4,%xmm4
movdqa 0xd5f(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movd   -0xc(%rdx,%rdi,1),%xmm3
movd   -0x8(%rdx,%rdi,1),%xmm2
pcmpeqb %xmm4,%xmm3
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm0,%xmm3
pcmpeqb %xmm4,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm1,%xmm2
movd   -0x4(%rdx,%rdi,1),%xmm0
movd   (%rdx,%rdi,1),%xmm1
pcmpeqb %xmm4,%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
pand   %xmm5,%xmm0
paddd  %xmm3,%xmm0
pcmpeqb %xmm4,%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
pand   %xmm5,%xmm1
paddd  %xmm2,%xmm1
add    $0x10,%rdi
add    $0xfffffffffffffffe,%rbp
jne    12b0 <main+0x120>
test   $0x1,%sil
je     135d <main+0x1cd>
add    %rax,%rdi
movd   (%rbx,%rdi,1),%xmm2
movd   0x4(%rbx,%rdi,1),%xmm3
pcmpeqb %xmm4,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pand   %xmm5,%xmm2
paddd  %xmm2,%xmm0
pcmpeqb %xmm4,%xmm3
punpcklbw %xmm3,%xmm3
punpcklwd %xmm3,%xmm3
pand   %xmm5,%xmm3
paddd  %xmm3,%xmm1
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%edx
cmp    %r8,%rcx
mov    %r9,%r14
je     13a0 <main+0x210>
add    %r8,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x1,(%rbx,%rax,1)
adc    $0x0,%edx
add    $0x1,%rax
cmp    %r15,%rax
jl     1390 <main+0x200>
cmp    $0xa,%edx
jne    1406 <main+0x276>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rcx
lea    0x7d0(%rcx),%rbp
add    $0x1,%r13
add    $0x7d0,%r14
cmp    $0xbb80,%rcx
jb     11b0 <main+0x20>
jmp    146e <main+0x2de>
mov    %r14,%r9
pxor   %xmm0,%xmm0
xor    %edi,%edi
pxor   %xmm1,%xmm1
pxor   %xmm4,%xmm4
movdqa 0xc09(%rip),%xmm5
test   $0x1,%sil
jne    1327 <main+0x197>
jmp    135d <main+0x1cd>
lea    0xd38(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xda6(%rip),%rdi
call   1050 <puts@plt>
mov    $0x2,%edi
call   10b0 <exit@plt>
lea    0xbd7(%rip),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x2,%edi
call   10b0 <exit@plt>
lea    0xc0a(%rip),%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xc49(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"strncpy/2-1.c Failed to allocate memory\0A\00"
@.str.1 = [81 x i8] c"strncpy/2-1.c Test failed, string copy failed. Expected string: %s, But got: %s\0A\00"
@.str.2 = [93 x i8] c"strncpy/2-1.c Test Failed, return is not as expected. Expected return: %p, But obtained: %p\0A\00"
@.str.3 = [133 x i8] c"strncpy/2-1.c Test Failed, The difference in the number of bytes for two strings (s1 and s2) have not been appended with NULL bytes\0A\00"
@.str.4 = [136 x i8] c"strncpy/2-1.c Test Passed, The difference in the number of bytes for two strings (s1 and s2) have been appended with NULL bytes in s2\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %1
store i32 1, i32* %2
br label %8
8: ; preds = %86, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 50000
br i1 %10, label %11, label %89
11: ; preds = %8
store i32 0, i32* %4
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 10
%14 = call i8* @malloc(i32 %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %20
17: ; preds = %11
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 2)
unreachable
20: ; preds = %11
%21 = load i32, i32* %2
%22 = call i8* @random_string(i32 %21)
store i8* %22, i8** %6
%23 = load i8*, i8** %7
%24 = load i8*, i8** %6
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 10
%27 = call i8* @strncpy(i8* %23, i8* %24, i32 %26)
store i8* %27, i8** %5
%28 = load i8*, i8** %7
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 10
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %28, i64 %31
store i8 0, i8* %32
%33 = load i8*, i8** %6
%34 = load i8*, i8** %7
%35 = call i64 @strcmp(i8* %33, i8* %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %42
37: ; preds = %20
%38 = load i8*, i8** %6
%39 = load i8*, i8** %7
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0), i8* %38, i8* %39)
%41 = call i32 @exit(i32 2)
unreachable
42: ; preds = %20
%43 = load i8*, i8** %5
%44 = load i8*, i8** %7
%45 = icmp ne i8* %43, %44
br i1 %45, label %46, label %51
46: ; preds = %42
%47 = load i8*, i8** %7
%48 = load i8*, i8** %5
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.2, i64 0, i64 0), i8* %47, i8* %48)
%50 = call i32 @exit(i32 1)
unreachable
51: ; preds = %42
br label %52
52: ; preds = %51
%53 = load i8*, i8** %6
%54 = call i32 @strlen(i8* %53)
store i32 %54, i32* %3
br label %55
55: ; preds = %72, %52
%56 = load i32, i32* %3
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 10
%59 = icmp slt i32 %56, %58
br i1 %59, label %60, label %75
60: ; preds = %55
%61 = load i8*, i8** %7
%62 = load i32, i32* %3
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %61, i64 %63
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %60
%69 = load i32, i32* %4
%70 = add nsw i32 %69, 1
store i32 %70, i32* %4
br label %71
71: ; preds = %68, %60
br label %72
72: ; preds = %71
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
store i32 %74, i32* %3
br label %55
75: ; preds = %55
%76 = load i32, i32* %4
%77 = icmp ne i32 %76, 10
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str.3, i64 0, i64 0))
%80 = call i32 @exit(i32 1)
unreachable
81: ; preds = %75
%82 = load i8*, i8** %6
%83 = call i32 @free(i8* %82)
%84 = load i8*, i8** %7
%85 = call i32 @free(i8* %84)
br label %86
86: ; preds = %81
%87 = load i32, i32* %2
%88 = add nsw i32 %87, 2000
store i32 %88, i32* %2
br label %8
89: ; preds = %8
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.4, i64 0, i64 0))
%91 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [81 x i8] c"strncpy/2-1.c Test failed, string copy failed. Expected string: %s, But got: %s\0A\00"
@.str.2 = [93 x i8] c"strncpy/2-1.c Test Failed, return is not as expected. Expected return: %p, But obtained: %p\0A\00"
@str = [135 x i8] c"strncpy/2-1.c Test Passed, The difference in the number of bytes for two strings (s1 and s2) have been appended with NULL bytes in s2\00"
@str.5 = [132 x i8] c"strncpy/2-1.c Test Failed, The difference in the number of bytes for two strings (s1 and s2) have not been appended with NULL bytes\00"
@str.6 = [40 x i8] c"strncpy/2-1.c Failed to allocate memory\00"
define i32 @main() {
br label %1
1: ; preds = %0, %126
%2 = phi i64 [ 0, %0 ], [ %131, %126 ]
%3 = phi i64 [ 1, %0 ], [ %129, %126 ]
%4 = mul nuw nsw i64 %2, 2000
%5 = or i64 %4, 11
%6 = add nuw nsw i64 %3, 10
%7 = trunc i64 %6 to i32
%8 = tail call i8* @malloc(i32 %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.6, i64 0, i64 0))
%12 = tail call i32 @exit(i32 2)
unreachable
13: ; preds = %1
%14 = trunc i64 %3 to i32
%15 = tail call i8* @random_string(i32 %14)
%16 = tail call i8* @strncpy(i8* %8, i8* %15, i32 %7)
%17 = getelementptr inbounds i8, i8* %8, i64 %6
store i8 0, i8* %17
%18 = tail call i64 @strcmp(i8* %15, i8* %8)
%19 = icmp eq i64 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %13
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %8)
%22 = tail call i32 @exit(i32 2)
unreachable
23: ; preds = %13
%24 = icmp eq i8* %16, %8
br i1 %24, label %28, label %25
25: ; preds = %23
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @.str.2, i64 0, i64 0), i8* %8, i8* %16)
%27 = tail call i32 @exit(i32 1)
unreachable
28: ; preds = %23
%29 = tail call i32 @strlen(i8* %15)
%30 = sext i32 %29 to i64
%31 = icmp sgt i64 %6, %30
br i1 %31, label %32, label %123
32: ; preds = %28
%33 = sub i64 %5, %30
%34 = icmp ult i64 %33, 8
br i1 %34, label %107, label %35
35: ; preds = %32
%36 = and i64 %33, -8
%37 = add i64 %36, %30
%38 = add i64 %36, -8
%39 = lshr exact i64 %38, 3
%40 = add nuw nsw i64 %39, 1
%41 = and i64 %40, 1
%42 = icmp eq i64 %38, 0
br i1 %42, label %80, label %43
43: ; preds = %35
%44 = and i64 %40, 4611686018427387902
br label %45
45: ; preds = %45, %43
%46 = phi i64 [ 0, %43 ], [ %77, %45 ]
%47 = phi <4 x i32> [ zeroinitializer, %43 ], [ %75, %45 ]
%48 = phi <4 x i32> [ zeroinitializer, %43 ], [ %76, %45 ]
%49 = phi i64 [ 0, %43 ], [ %78, %45 ]
%50 = add i64 %46, %30
%51 = getelementptr inbounds i8, i8* %8, i64 %50
%52 = bitcast i8* %51 to <4 x i8>*
%53 = load <4 x i8>, <4 x i8>* %52
%54 = getelementptr inbounds i8, i8* %51, i64 4
%55 = bitcast i8* %54 to <4 x i8>*
%56 = load <4 x i8>, <4 x i8>* %55
%57 = icmp eq <4 x i8> %53, zeroinitializer
%58 = icmp eq <4 x i8> %56, zeroinitializer
%59 = zext <4 x i1> %57 to <4 x i32>
%60 = zext <4 x i1> %58 to <4 x i32>
%61 = add <4 x i32> %47, %59
%62 = add <4 x i32> %48, %60
%63 = or i64 %46, 8
%64 = add i64 %63, %30
%65 = getelementptr inbounds i8, i8* %8, i64 %64
%66 = bitcast i8* %65 to <4 x i8>*
%67 = load <4 x i8>, <4 x i8>* %66
%68 = getelementptr inbounds i8, i8* %65, i64 4
%69 = bitcast i8* %68 to <4 x i8>*
%70 = load <4 x i8>, <4 x i8>* %69
%71 = icmp eq <4 x i8> %67, zeroinitializer
%72 = icmp eq <4 x i8> %70, zeroinitializer
%73 = zext <4 x i1> %71 to <4 x i32>
%74 = zext <4 x i1> %72 to <4 x i32>
%75 = add <4 x i32> %61, %73
%76 = add <4 x i32> %62, %74
%77 = add nuw i64 %46, 16
%78 = add i64 %49, 2
%79 = icmp eq i64 %78, %44
br i1 %79, label %80, label %45
80: ; preds = %45, %35
%81 = phi <4 x i32> [ undef, %35 ], [ %75, %45 ]
%82 = phi <4 x i32> [ undef, %35 ], [ %76, %45 ]
%83 = phi i64 [ 0, %35 ], [ %77, %45 ]
%84 = phi <4 x i32> [ zeroinitializer, %35 ], [ %75, %45 ]
%85 = phi <4 x i32> [ zeroinitializer, %35 ], [ %76, %45 ]
%86 = icmp eq i64 %41, 0
br i1 %86, label %101, label %87
87: ; preds = %80
%88 = add i64 %83, %30
%89 = getelementptr inbounds i8, i8* %8, i64 %88
%90 = bitcast i8* %89 to <4 x i8>*
%91 = load <4 x i8>, <4 x i8>* %90
%92 = getelementptr inbounds i8, i8* %89, i64 4
%93 = bitcast i8* %92 to <4 x i8>*
%94 = load <4 x i8>, <4 x i8>* %93
%95 = icmp eq <4 x i8> %91, zeroinitializer
%96 = icmp eq <4 x i8> %94, zeroinitializer
%97 = zext <4 x i1> %95 to <4 x i32>
%98 = zext <4 x i1> %96 to <4 x i32>
%99 = add <4 x i32> %84, %97
%100 = add <4 x i32> %85, %98
br label %101
101: ; preds = %80, %87
%102 = phi <4 x i32> [ %81, %80 ], [ %99, %87 ]
%103 = phi <4 x i32> [ %82, %80 ], [ %100, %87 ]
%104 = add <4 x i32> %103, %102
%105 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %104)
%106 = icmp eq i64 %33, %36
br i1 %106, label %120, label %107
107: ; preds = %32, %101
%108 = phi i64 [ %30, %32 ], [ %37, %101 ]
%109 = phi i32 [ 0, %32 ], [ %105, %101 ]
br label %110
110: ; preds = %107, %110
%111 = phi i64 [ %118, %110 ], [ %108, %107 ]
%112 = phi i32 [ %117, %110 ], [ %109, %107 ]
%113 = getelementptr inbounds i8, i8* %8, i64 %111
%114 = load i8, i8* %113
%115 = icmp eq i8 %114, 0
%116 = zext i1 %115 to i32
%117 = add nuw nsw i32 %112, %116
%118 = add nsw i64 %111, 1
%119 = icmp slt i64 %118, %6
br i1 %119, label %110, label %120
120: ; preds = %110, %101
%121 = phi i32 [ %105, %101 ], [ %117, %110 ]
%122 = icmp eq i32 %121, 10
br i1 %122, label %126, label %123
123: ; preds = %28, %120
%124 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([132 x i8], [132 x i8]* @str.5, i64 0, i64 0))
%125 = tail call i32 @exit(i32 1)
unreachable
126: ; preds = %120
%127 = tail call i32 @free(i8* %15)
%128 = tail call i32 @free(i8* %8)
%129 = add nuw nsw i64 %3, 2000
%130 = icmp ult i64 %3, 48000
%131 = add i64 %2, 1
br i1 %130, label %1, label %132
132: ; preds = %126
%133 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([135 x i8], [135 x i8]* @str, i64 0, i64 0))
%134 = tail call i32 @exit(i32 0)
unreachable
}