#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 pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void CheckSum(int bit) {
  int input[50], output[50];
  int limit, checksum;
  int i, j, in = 0, sum = 0, num;
  limit = pow(2, bit);
  printf("\nSENDER\n===========\n");
  printf("No. of inputs: ");
  scanf("%d", &num);
  printf("\nEnter %d bit numbers (0 to %d)", bit, limit - 1);
  printf("Enter 0 after %d inputs\n", num);
  for (i = 0; in < limit && i <= num; i++) {
    scanf("%d", &in);
    input[i] = in;
  }
  for (j = 0; j < i - 1; j++)
    sum += input[j];
  checksum = (limit - 1) - (sum % (limit - 1));
  printf("\nChecksum: %d\n", checksum);
  input[i - 1] = checksum;
  printf("Transmitted data (input+checksum)\n");
  for (j = 0; j <= i - 1; j++)
    printf("%d\t", input[j]);
  printf("\n\nRECEIVER\n=========\n");
  sum = checksum = 0;
  printf("Enter received values\n");
  for (j = 0; j < i; j++) {
    scanf("%d", &output[j]);
    sum += output[j];
  }
  checksum = sum % (limit - 1);
  printf("\nChecksum = %d\n", checksum);
  if (checksum == 0)
    printf("No error\n");
  else
    printf("Error\n");
}


x86 assembly (clang, -O0):
<CheckSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x1b4(%rbp)
movl   $0x0,-0x1b8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,-0x1a4(%rbp)
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
lea    -0x1bc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x1a4(%rbp),%edx
sub    $0x1,%edx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1bc(%rbp),%esi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1ac(%rbp)
mov    -0x1b4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x1a4(%rbp),%ecx
mov    %al,-0x1bd(%rbp)
jge    11fb <CheckSum+0xcb>
mov    -0x1ac(%rbp),%eax
cmp    -0x1bc(%rbp),%eax
setle  %al
mov    %al,-0x1bd(%rbp)
mov    -0x1bd(%rbp),%al
test   $0x1,%al
jne    120e <CheckSum+0xde>
jmp    1249 <CheckSum+0x119>
lea    0xe10(%rip),%rdi
lea    -0x1b4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x1b4(%rbp),%ecx
movslq -0x1ac(%rbp),%rax
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    11cc <CheckSum+0x9c>
movl   $0x0,-0x1b0(%rbp)
mov    -0x1b0(%rbp),%eax
mov    -0x1ac(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1298 <CheckSum+0x168>
movslq -0x1b0(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%eax
add    -0x1b8(%rbp),%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x1b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b0(%rbp)
jmp    1253 <CheckSum+0x123>
mov    -0x1a4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c4(%rbp)
mov    -0x1b8(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x1c4(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%esi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1a8(%rbp),%ecx
mov    -0x1ac(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %ecx,-0xd0(%rbp,%rax,4)
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1b0(%rbp)
mov    -0x1b0(%rbp),%eax
mov    -0x1ac(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1352 <CheckSum+0x222>
movslq -0x1b0(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%esi
lea    0xd5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b0(%rbp)
jmp    130b <CheckSum+0x1db>
lea    0xd3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1a8(%rbp)
movl   $0x0,-0x1b8(%rbp)
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1b0(%rbp)
mov    -0x1b0(%rbp),%eax
cmp    -0x1ac(%rbp),%eax
jge    13ed <CheckSum+0x2bd>
movslq -0x1b0(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xc6b(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x1b0(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    -0x1b8(%rbp),%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x1b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b0(%rbp)
jmp    138c <CheckSum+0x25c>
mov    -0x1b8(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%esi
lea    0xcb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x1a8(%rbp)
jne    1439 <CheckSum+0x309>
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1447 <CheckSum+0x317>
lea    0xc9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckSum>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
mov    $0x2,%edi
mov    %ebp,%esi
call   1060 <pow@plt>
mov    %eax,%ebx
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xe84(%rip),%rdi
xor    %r13d,%r13d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe83(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
lea    -0x1(%rbx),%r14d
lea    0xe71(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%r15d
test   %ebx,%ebx
jle    1235 <CheckSum+0xf5>
cmpl   $0x0,0x8(%rsp)
mov    $0x0,%r12d
mov    $0x0,%eax
js     134d <CheckSum+0x20d>
xor    %ebp,%ebp
lea    0xe27(%rip),%r15
lea    0xc(%rsp),%r13
xchg   %ax,%ax
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x10(%rsp,%rbp,4)
lea    0x1(%rbp),%r12
cmp    %ebx,%eax
jge    1218 <CheckSum+0xd8>
movslq 0x8(%rsp),%rax
cmp    %rax,%rbp
mov    %r12,%rbp
jl     11f0 <CheckSum+0xb0>
lea    -0x1(%r12),%r15
cmp    $0x1,%r12d
jle    123f <CheckSum+0xff>
cmp    $0x8,%r15d
jae    1249 <CheckSum+0x109>
xor    %ecx,%ecx
xor    %eax,%eax
xor    %r13d,%r13d
jmp    1340 <CheckSum+0x200>
xor    %r12d,%r12d
xor    %eax,%eax
jmp    134d <CheckSum+0x20d>
xor    %eax,%eax
xor    %r13d,%r13d
jmp    134d <CheckSum+0x20d>
mov    %r15d,%ecx
and    $0xfffffff8,%ecx
lea    -0x8(%rcx),%rdx
mov    %rdx,%rax
shr    $0x3,%rax
add    $0x1,%rax
cmp    $0x18,%rdx
jae    1273 <CheckSum+0x133>
pxor   %xmm0,%xmm0
xor    %edx,%edx
pxor   %xmm1,%xmm1
xor    %r13d,%r13d
jmp    12dd <CheckSum+0x19d>
mov    %r15,%rsi
and    $0xfffffffffffffff8,%rsi
add    $0xfffffffffffffff8,%rsi
shr    $0x3,%rsi
add    $0x1,%rsi
and    $0xfffffffffffffffc,%rsi
pxor   %xmm0,%xmm0
xor    %edx,%edx
pxor   %xmm1,%xmm1
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
paddd  0x10(%rsp,%rdx,4),%xmm0
paddd  0x20(%rsp,%rdx,4),%xmm1
paddd  0x30(%rsp,%rdx,4),%xmm0
paddd  0x40(%rsp,%rdx,4),%xmm1
paddd  0x50(%rsp,%rdx,4),%xmm0
paddd  0x60(%rsp,%rdx,4),%xmm1
paddd  0x70(%rsp,%rdx,4),%xmm0
paddd  0x80(%rsp,%rdx,4),%xmm1
add    $0x20,%rdx
add    $0xfffffffffffffffc,%rsi
jne    12a0 <CheckSum+0x160>
test   $0x3,%al
je     1324 <CheckSum+0x1e4>
lea    (%rsp,%rdx,4),%rax
add    $0x20,%rax
mov    %r15d,%edx
and    $0x18,%dl
add    $0xf8,%dl
shr    $0x3,%dl
add    $0x1,%dl
movzbl %dl,%edx
and    $0x3,%edx
shl    $0x5,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
paddd  -0x10(%rax,%rsi,1),%xmm0
paddd  (%rax,%rsi,1),%xmm1
add    $0x20,%rsi
cmp    %rsi,%rdx
jne    1310 <CheckSum+0x1d0>
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
jmp    1348 <CheckSum+0x208>
add    0x10(%rsp,%rcx,4),%eax
add    $0x1,%rcx
cmp    %rcx,%r15
jne    1340 <CheckSum+0x200>
cltd
idiv   %r14d
mov    %r14d,%ebx
sub    %edx,%ebx
lea    0xcef(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movslq %r15d,%rax
mov    %ebx,0x10(%rsp,%rax,4)
lea    0xd0f(%rip),%rdi
call   1030 <puts@plt>
test   %r12d,%r12d
je     13aa <CheckSum+0x26a>
mov    %r12d,%ebp
lea    0xcd3(%rip),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1390 <CheckSum+0x250>
mov    %r12d,%r13d
lea    0xcf4(%rip),%rdi
call   1030 <puts@plt>
lea    0xcfd(%rip),%rdi
call   1030 <puts@plt>
test   %r12d,%r12d
je     13fb <CheckSum+0x2bb>
mov    %r13d,%ebx
xor    %r12d,%r12d
lea    0xe0(%rsp),%rbp
lea    0xc34(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
add    0x0(%rbp),%r12d
add    $0x4,%rbp
add    $0xffffffffffffffff,%rbx
jne    13e0 <CheckSum+0x2a0>
jmp    13fe <CheckSum+0x2be>
xor    %r12d,%r12d
mov    %r12d,%eax
cltd
idiv   %r14d
mov    %edx,%ebx
lea    0xc51(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
lea    0xcb6(%rip),%rax
lea    0xca9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0ASENDER\0A===========\0A\00"
@.str.1 = [16 x i8] c"No. of inputs: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [32 x i8] c"\0AEnter %d bit numbers (0 to %d)\00"
@.str.4 = [25 x i8] c"Enter 0 after %d inputs\0A\00"
@.str.5 = [15 x i8] c"\0AChecksum: %d\0A\00"
@.str.6 = [35 x i8] c"Transmitted data (input+checksum)\0A\00"
@.str.7 = [4 x i8] c"%d\09\00"
@.str.8 = [22 x i8] c"\0A\0ARECEIVER\0A=========\0A\00"
@.str.9 = [23 x i8] c"Enter received values\0A\00"
@.str.10 = [16 x i8] c"\0AChecksum = %d\0A\00"
@.str.11 = [10 x i8] c"No error\0A\00"
@.str.12 = [7 x i8] c"Error\0A\00"
define void @CheckSum(i32 %0) {
%2 = alloca i32
%3 = alloca [50 x i32]
%4 = alloca [50 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %9
store i32 0, i32* %10
%12 = load i32, i32* %2
%13 = call i32 @pow(i32 2, i32 %12)
store i32 %13, i32* %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%17 = load i32, i32* %2
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %17, i32 %19)
%21 = load i32, i32* %11
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %21)
store i32 0, i32* %7
br label %23
23: ; preds = %39, %1
%24 = load i32, i32* %9
%25 = load i32, i32* %5
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i32, i32* %7
%29 = load i32, i32* %11
%30 = icmp sle i32 %28, %29
br label %31
31: ; preds = %27, %23
%32 = phi i1 [ false, %23 ], [ %30, %27 ]
br i1 %32, label %33, label %42
33: ; preds = %31
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %9)
%35 = load i32, i32* %9
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %37
store i32 %35, i32* %38
br label %39
39: ; preds = %33
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %23
42: ; preds = %31
store i32 0, i32* %8
br label %43
43: ; preds = %55, %42
%44 = load i32, i32* %8
%45 = load i32, i32* %7
%46 = sub nsw i32 %45, 1
%47 = icmp slt i32 %44, %46
br i1 %47, label %48, label %58
48: ; preds = %43
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = load i32, i32* %10
%54 = add nsw i32 %53, %52
store i32 %54, i32* %10
br label %55
55: ; preds = %48
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %43
58: ; preds = %43
%59 = load i32, i32* %5
%60 = sub nsw i32 %59, 1
%61 = load i32, i32* %10
%62 = load i32, i32* %5
%63 = sub nsw i32 %62, 1
%64 = srem i32 %61, %63
%65 = sub nsw i32 %60, %64
store i32 %65, i32* %6
%66 = load i32, i32* %6
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %6
%69 = load i32, i32* %7
%70 = sub nsw i32 %69, 1
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %71
store i32 %68, i32* %72
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %8
br label %74
74: ; preds = %85, %58
%75 = load i32, i32* %8
%76 = load i32, i32* %7
%77 = sub nsw i32 %76, 1
%78 = icmp sle i32 %75, %77
br i1 %78, label %79, label %88
79: ; preds = %74
%80 = load i32, i32* %8
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %81
%83 = load i32, i32* %82
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %83)
br label %85
85: ; preds = %79
%86 = load i32, i32* %8
%87 = add nsw i32 %86, 1
store i32 %87, i32* %8
br label %74
88: ; preds = %74
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %6
store i32 0, i32* %10
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %8
br label %91
91: ; preds = %106, %88
%92 = load i32, i32* %8
%93 = load i32, i32* %7
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %109
95: ; preds = %91
%96 = load i32, i32* %8
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 %97
%99 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %98)
%100 = load i32, i32* %8
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [50 x i32], [50 x i32]* %4, i64 0, i64 %101
%103 = load i32, i32* %102
%104 = load i32, i32* %10
%105 = add nsw i32 %104, %103
store i32 %105, i32* %10
br label %106
106: ; preds = %95
%107 = load i32, i32* %8
%108 = add nsw i32 %107, 1
store i32 %108, i32* %8
br label %91
109: ; preds = %91
%110 = load i32, i32* %10
%111 = load i32, i32* %5
%112 = sub nsw i32 %111, 1
%113 = srem i32 %110, %112
store i32 %113, i32* %6
%114 = load i32, i32* %6
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %114)
%116 = load i32, i32* %6
%117 = icmp eq i32 %116, 0
br i1 %117, label %118, label %120
118: ; preds = %109
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %122
120: ; preds = %109
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
br label %122
122: ; preds = %120, %118
ret void
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"No. of inputs: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [32 x i8] c"\0AEnter %d bit numbers (0 to %d)\00"
@.str.4 = [25 x i8] c"Enter 0 after %d inputs\0A\00"
@.str.5 = [15 x i8] c"\0AChecksum: %d\0A\00"
@.str.7 = [4 x i8] c"%d\09\00"
@.str.10 = [16 x i8] c"\0AChecksum = %d\0A\00"
@str = [20 x i8] c"\0ASENDER\0A===========\00"
@str.13 = [34 x i8] c"Transmitted data (input+checksum)\00"
@str.14 = [21 x i8] c"\0A\0ARECEIVER\0A=========\00"
@str.15 = [22 x i8] c"Enter received values\00"
@str.16 = [6 x i8] c"Error\00"
@str.17 = [9 x i8] c"No error\00"
define void @CheckSum(i32 %0) {
%2 = alloca [50 x i32]
%3 = alloca [50 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [50 x i32]* %2 to i8*
%7 = bitcast [50 x i32]* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = bitcast i32* %5 to i8*
%10 = tail call i32 @pow(i32 2, i32 %0)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%14 = add nsw i32 %10, -1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %0, i32 %14)
%16 = load i32, i32* %5
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = icmp sgt i32 %10, 0
%19 = load i32, i32* %5
%20 = icmp sgt i32 %19, -1
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %113, label %132
22: ; preds = %113
%23 = trunc i64 %118 to i32
%24 = add i32 %23, -1
%25 = icmp sgt i32 %23, 1
br i1 %25, label %26, label %132
26: ; preds = %22
%27 = zext i32 %24 to i64
%28 = icmp ult i32 %24, 8
br i1 %28, label %110, label %29
29: ; preds = %26
%30 = and i64 %27, 4294967288
%31 = add nsw i64 %30, -8
%32 = lshr exact i64 %31, 3
%33 = add nuw nsw i64 %32, 1
%34 = and i64 %33, 3
%35 = icmp ult i64 %31, 24
br i1 %35, label %81, label %36
36: ; preds = %29
%37 = and i64 %33, 4611686018427387900
br label %38
38: ; preds = %38, %36
%39 = phi i64 [ 0, %36 ], [ %78, %38 ]
%40 = phi <4 x i32> [ zeroinitializer, %36 ], [ %76, %38 ]
%41 = phi <4 x i32> [ zeroinitializer, %36 ], [ %77, %38 ]
%42 = phi i64 [ 0, %36 ], [ %79, %38 ]
%43 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %39
%44 = bitcast i32* %43 to <4 x i32>*
%45 = load <4 x i32>, <4 x i32>* %44
%46 = getelementptr inbounds i32, i32* %43, i64 4
%47 = bitcast i32* %46 to <4 x i32>*
%48 = load <4 x i32>, <4 x i32>* %47
%49 = add <4 x i32> %45, %40
%50 = add <4 x i32> %48, %41
%51 = or i64 %39, 8
%52 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %51
%53 = bitcast i32* %52 to <4 x i32>*
%54 = load <4 x i32>, <4 x i32>* %53
%55 = getelementptr inbounds i32, i32* %52, i64 4
%56 = bitcast i32* %55 to <4 x i32>*
%57 = load <4 x i32>, <4 x i32>* %56
%58 = add <4 x i32> %54, %49
%59 = add <4 x i32> %57, %50
%60 = or i64 %39, 16
%61 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %60
%62 = bitcast i32* %61 to <4 x i32>*
%63 = load <4 x i32>, <4 x i32>* %62
%64 = getelementptr inbounds i32, i32* %61, i64 4
%65 = bitcast i32* %64 to <4 x i32>*
%66 = load <4 x i32>, <4 x i32>* %65
%67 = add <4 x i32> %63, %58
%68 = add <4 x i32> %66, %59
%69 = or i64 %39, 24
%70 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %69
%71 = bitcast i32* %70 to <4 x i32>*
%72 = load <4 x i32>, <4 x i32>* %71
%73 = getelementptr inbounds i32, i32* %70, i64 4
%74 = bitcast i32* %73 to <4 x i32>*
%75 = load <4 x i32>, <4 x i32>* %74
%76 = add <4 x i32> %72, %67
%77 = add <4 x i32> %75, %68
%78 = add nuw i64 %39, 32
%79 = add i64 %42, 4
%80 = icmp eq i64 %79, %37
br i1 %80, label %81, label %38
81: ; preds = %38, %29
%82 = phi <4 x i32> [ undef, %29 ], [ %76, %38 ]
%83 = phi <4 x i32> [ undef, %29 ], [ %77, %38 ]
%84 = phi i64 [ 0, %29 ], [ %78, %38 ]
%85 = phi <4 x i32> [ zeroinitializer, %29 ], [ %76, %38 ]
%86 = phi <4 x i32> [ zeroinitializer, %29 ], [ %77, %38 ]
%87 = icmp eq i64 %34, 0
br i1 %87, label %104, label %88
88: ; preds = %81, %88
%89 = phi i64 [ %101, %88 ], [ %84, %81 ]
%90 = phi <4 x i32> [ %99, %88 ], [ %85, %81 ]
%91 = phi <4 x i32> [ %100, %88 ], [ %86, %81 ]
%92 = phi i64 [ %102, %88 ], [ 0, %81 ]
%93 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %89
%94 = bitcast i32* %93 to <4 x i32>*
%95 = load <4 x i32>, <4 x i32>* %94
%96 = getelementptr inbounds i32, i32* %93, i64 4
%97 = bitcast i32* %96 to <4 x i32>*
%98 = load <4 x i32>, <4 x i32>* %97
%99 = add <4 x i32> %95, %90
%100 = add <4 x i32> %98, %91
%101 = add nuw i64 %89, 8
%102 = add i64 %92, 1
%103 = icmp eq i64 %102, %34
br i1 %103, label %104, label %88
104: ; preds = %88, %81
%105 = phi <4 x i32> [ %82, %81 ], [ %99, %88 ]
%106 = phi <4 x i32> [ %83, %81 ], [ %100, %88 ]
%107 = add <4 x i32> %106, %105
%108 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %107)
%109 = icmp eq i64 %30, %27
br i1 %109, label %132, label %110
110: ; preds = %26, %104
%111 = phi i64 [ 0, %26 ], [ %30, %104 ]
%112 = phi i32 [ 0, %26 ], [ %108, %104 ]
br label %124
113: ; preds = %1, %113
%114 = phi i64 [ %118, %113 ], [ 0, %1 ]
%115 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%116 = load i32, i32* %4
%117 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %114
store i32 %116, i32* %117
%118 = add nuw nsw i64 %114, 1
%119 = icmp slt i32 %116, %10
%120 = load i32, i32* %5
%121 = sext i32 %120 to i64
%122 = icmp slt i64 %114, %121
%123 = select i1 %119, i1 %122, i1 false
br i1 %123, label %113, label %22
124: ; preds = %110, %124
%125 = phi i64 [ %130, %124 ], [ %111, %110 ]
%126 = phi i32 [ %129, %124 ], [ %112, %110 ]
%127 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %125
%128 = load i32, i32* %127
%129 = add nsw i32 %128, %126
%130 = add nuw nsw i64 %125, 1
%131 = icmp eq i64 %130, %27
br i1 %131, label %132, label %124
132: ; preds = %124, %104, %1, %22
%133 = phi i32 [ %24, %22 ], [ -1, %1 ], [ %24, %104 ], [ %24, %124 ]
%134 = phi i32 [ %23, %22 ], [ 0, %1 ], [ %23, %104 ], [ %23, %124 ]
%135 = phi i32 [ 0, %22 ], [ 0, %1 ], [ %108, %104 ], [ %129, %124 ]
%136 = srem i32 %135, %14
%137 = sub nsw i32 %14, %136
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %137)
%139 = sext i32 %133 to i64
%140 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %139
store i32 %137, i32* %140
%141 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.13, i64 0, i64 0))
%142 = icmp eq i32 %134, 0
br i1 %142, label %152, label %143
143: ; preds = %132
%144 = zext i32 %134 to i64
br label %145
145: ; preds = %143, %145
%146 = phi i64 [ 0, %143 ], [ %150, %145 ]
%147 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 %146
%148 = load i32, i32* %147
%149 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %148)
%150 = add nuw nsw i64 %146, 1
%151 = icmp eq i64 %150, %144
br i1 %151, label %152, label %145
152: ; preds = %145, %132
%153 = phi i32 [ 0, %132 ], [ %134, %145 ]
%154 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.14, i64 0, i64 0))
%155 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.15, i64 0, i64 0))
br i1 %142, label %167, label %156
156: ; preds = %152
%157 = zext i32 %153 to i64
br label %158
158: ; preds = %156, %158
%159 = phi i64 [ 0, %156 ], [ %165, %158 ]
%160 = phi i32 [ 0, %156 ], [ %164, %158 ]
%161 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %159
%162 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %161)
%163 = load i32, i32* %161
%164 = add nsw i32 %163, %160
%165 = add nuw nsw i64 %159, 1
%166 = icmp eq i64 %165, %157
br i1 %166, label %167, label %158
167: ; preds = %158, %152
%168 = phi i32 [ 0, %152 ], [ %164, %158 ]
%169 = srem i32 %168, %14
%170 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 %169)
%171 = icmp eq i32 %169, 0
%172 = select i1 %171, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.17, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.16, i64 0, i64 0)
%173 = call i32 @puts(i8* dereferenceable(1) %172)
ret void
}