int main() {
  int packet_size[5], i, clk, bucket_size, output_rate,
      packet_size_remaining = 0, p_time;
  for (i = 0; i < 5; ++i)
    packet_size[i] = rand(5) * 10;
  for (i = 0; i < 5; ++i)
    printf(" \n packet[%d]:%d bytes\t", i, packet_size[i]);
  printf(" \n Enter the Output rate:");
  scanf("%d", &output_rate);
  printf(" Enter the Bucket Size: ");
  scanf("%d", &bucket_size);
  for (i = 0; i < 5; ++i) {
    if ((packet_size[i] + packet_size_remaining) > bucket_size) {
      if (packet_size[i] > bucket_size)
        printf(" \n Incomming packet size (%d bytes) is Greater than "
               "bucketcapacity (%d bytes) -PACKET REJECTED \n ",
               packet_size[i], bucket_size);
      else
        printf(" \n Bucket capacity exceeded-REJECTED!! \n ");
    } else {
      packet_size_remaining += packet_size[i];
      printf(" \n \n Incomming Packet size: %d ", packet_size[i]);
      printf(" \n Bytes remaining to Transmit: %d ", packet_size_remaining);
      p_time = rand(4) * 10;
      printf(" \n Time left for transmission: %d units ", p_time);
      for (clk = 10; clk <= p_time; clk += 10) {
        sleep(1);
        if (packet_size_remaining) {
          if (packet_size_remaining <= output_rate)
            printf(" \n Packet of size %d Transmitted \n ",
                   packet_size_remaining),
                packet_size_remaining = 0;
          else
            printf(" \n Packet of size %d Transmitted \n ", output_rate),
                packet_size_remaining -= output_rate;
          printf(" ----Bytes Remaining after Transmission:%d \n ",
                 packet_size_remaining);
        } else
          printf(" \n No packets to transmit!! \n ");
        printf(" Time Left: %d \n ", p_time - clk);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    118c <main+0x4c>
mov    $0x5,%edi
mov    $0x0,%al
call   1060 <rand@plt>
imul   $0xa,%eax,%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115d <main+0x1d>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    11c4 <main+0x84>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1193 <main+0x53>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe59(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe39(%rip),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    138f <main+0x24f>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
add    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    126b <main+0x12b>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x2c(%rbp),%eax
jle    1258 <main+0x118>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
mov    -0x2c(%rbp),%edx
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1266 <main+0x126>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    137c <main+0x23c>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x4,%edi
mov    $0x0,%al
call   1060 <rand@plt>
imul   $0xa,%eax,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     1377 <main+0x237>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <sleep@plt>
cmpl   $0x0,-0x34(%rbp)
je     1347 <main+0x207>
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     1315 <main+0x1d5>
mov    -0x34(%rbp),%esi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
jmp    1331 <main+0x1f1>
mov    -0x30(%rbp),%esi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x215>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%esi
sub    -0x28(%rbp),%esi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x28(%rbp)
jmp    12ca <main+0x18a>
jmp    137c <main+0x23c>
jmp    1381 <main+0x241>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    120b <main+0xcb>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x5,%edi
xor    %eax,%eax
call   1060 <rand@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%r13d
mov    %r13d,0x10(%rsp)
mov    $0x5,%edi
xor    %eax,%eax
call   1060 <rand@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%r14d
mov    %r14d,0x14(%rsp)
mov    $0x5,%edi
xor    %eax,%eax
call   1060 <rand@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%r15d
mov    %r15d,0x18(%rsp)
mov    $0x5,%edi
xor    %eax,%eax
call   1060 <rand@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%r12d
mov    %r12d,0x1c(%rsp)
mov    $0x5,%edi
xor    %eax,%eax
call   1060 <rand@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%ebp
mov    %ebp,0x20(%rsp)
lea    0xe3a(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdf5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe01(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xdee(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %r12d,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rbx,%r13,1),%r15d
mov    0xc(%rsp),%edx
cmp    %edx,%r15d
jle    12a0 <main+0x160>
cmp    %edx,%r13d
jle    12f0 <main+0x1b0>
lea    0xdc5(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    12fe <main+0x1be>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe33(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe42(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x4,%edi
xor    %eax,%eax
call   1060 <rand@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%r13d
lea    0xe43(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0xa,%r13d
jge    1320 <main+0x1e0>
mov    %r15d,%ebx
jmp    12fe <main+0x1be>
lea    0xdb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%r12
cmp    $0x5,%r12
je     13bd <main+0x27d>
mov    0x10(%rsp,%r12,4),%r13d
jmp    1270 <main+0x130>
cs nopw 0x0(%rax,%rax,1)
lea    -0xa(%r13),%ebp
mov    $0xa,%r14d
mov    %r15d,%ebx
lea    0xe65(%rip),%r15
jmp    1368 <main+0x228>
cs nopw 0x0(%rax,%rax,1)
xor    %ebx,%ebx
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe65(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xa,%r14d
add    $0xfffffff6,%ebp
cmp    %r14d,%r13d
jl     12fe <main+0x1be>
mov    $0x1,%edi
xor    %eax,%eax
call   1050 <sleep@plt>
test   %ebx,%ebx
je     1340 <main+0x200>
mov    0x8(%rsp),%esi
lea    0xdc4(%rip),%rdi
cmp    %esi,%ebx
jle    13a0 <main+0x260>
xor    %eax,%eax
call   1030 <printf@plt>
sub    0x8(%rsp),%ebx
jmp    13ab <main+0x26b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %ebx,%ebx
lea    0xdb9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    134c <main+0x20c>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c" \0A packet[%d]:%d bytes\09\00"
@.str.1 = [26 x i8] c" \0A Enter the Output rate:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [25 x i8] c" Enter the Bucket Size: \00"
@.str.4 = [98 x i8] c" \0A Incomming packet size (%d bytes) is Greater than bucketcapacity (%d bytes) -PACKET REJECTED \0A \00"
@.str.5 = [42 x i8] c" \0A Bucket capacity exceeded-REJECTED!! \0A \00"
@.str.6 = [32 x i8] c" \0A \0A Incomming Packet size: %d \00"
@.str.7 = [36 x i8] c" \0A Bytes remaining to Transmit: %d \00"
@.str.8 = [41 x i8] c" \0A Time left for transmission: %d units \00"
@.str.9 = [36 x i8] c" \0A Packet of size %d Transmitted \0A \00"
@.str.10 = [46 x i8] c" ----Bytes Remaining after Transmission:%d \0A \00"
@.str.11 = [31 x i8] c" \0A No packets to transmit!! \0A \00"
@.str.12 = [18 x i8] c" Time Left: %d \0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %7
store i32 0, i32* %3
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = call i32 (i32, ...) bitcast (i32 (...)* @rand to i32 (i32, ...)*)(i32 5)
%14 = mul nsw i32 %13, 10
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %16
store i32 %14, i32* %17
br label %18
18: ; preds = %12
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %9
21: ; preds = %9
store i32 0, i32* %3
br label %22
22: ; preds = %32, %21
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 5
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i32, i32* %3
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %26, i32 %30)
br label %32
32: ; preds = %25
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %22
35: ; preds = %22
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%37 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
store i32 0, i32* %3
br label %40
40: ; preds = %123, %35
%41 = load i32, i32* %3
%42 = icmp slt i32 %41, 5
br i1 %42, label %43, label %126
43: ; preds = %40
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = load i32, i32* %7
%49 = add nsw i32 %47, %48
%50 = load i32, i32* %5
%51 = icmp sgt i32 %49, %50
br i1 %51, label %52, label %69
52: ; preds = %43
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = load i32, i32* %5
%58 = icmp sgt i32 %56, %57
br i1 %58, label %59, label %66
59: ; preds = %52
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = load i32, i32* %5
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.4, i64 0, i64 0), i32 %63, i32 %64)
br label %68
66: ; preds = %52
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
br label %68
68: ; preds = %66, %59
br label %122
69: ; preds = %43
%70 = load i32, i32* %3
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %71
%73 = load i32, i32* %72
%74 = load i32, i32* %7
%75 = add nsw i32 %74, %73
store i32 %75, i32* %7
%76 = load i32, i32* %3
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %79)
%81 = load i32, i32* %7
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 %81)
%83 = call i32 (i32, ...) bitcast (i32 (...)* @rand to i32 (i32, ...)*)(i32 4)
%84 = mul nsw i32 %83, 10
store i32 %84, i32* %8
%85 = load i32, i32* %8
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 %85)
store i32 10, i32* %4
br label %87
87: ; preds = %118, %69
%88 = load i32, i32* %4
%89 = load i32, i32* %8
%90 = icmp sle i32 %88, %89
br i1 %90, label %91, label %121
91: ; preds = %87
%92 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%93 = load i32, i32* %7
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %111
95: ; preds = %91
%96 = load i32, i32* %7
%97 = load i32, i32* %6
%98 = icmp sle i32 %96, %97
br i1 %98, label %99, label %102
99: ; preds = %95
%100 = load i32, i32* %7
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i32 %100)
store i32 0, i32* %7
br label %108
102: ; preds = %95
%103 = load i32, i32* %6
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i32 %103)
%105 = load i32, i32* %6
%106 = load i32, i32* %7
%107 = sub nsw i32 %106, %105
store i32 %107, i32* %7
br label %108
108: ; preds = %102, %99
%109 = load i32, i32* %7
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i32 %109)
br label %113
111: ; preds = %91
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0))
br label %113
113: ; preds = %111, %108
%114 = load i32, i32* %8
%115 = load i32, i32* %4
%116 = sub nsw i32 %114, %115
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %116)
br label %118
118: ; preds = %113
%119 = load i32, i32* %4
%120 = add nsw i32 %119, 10
store i32 %120, i32* %4
br label %87
121: ; preds = %87
br label %122
122: ; preds = %121, %68
br label %123
123: ; preds = %122
%124 = load i32, i32* %3
%125 = add nsw i32 %124, 1
store i32 %125, i32* %3
br label %40
126: ; preds = %40
%127 = load i32, i32* %1
ret i32 %127
}

LLVM IR (-O2):
@.str = [24 x i8] c" \0A packet[%d]:%d bytes\09\00"
@.str.1 = [26 x i8] c" \0A Enter the Output rate:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [25 x i8] c" Enter the Bucket Size: \00"
@.str.4 = [98 x i8] c" \0A Incomming packet size (%d bytes) is Greater than bucketcapacity (%d bytes) -PACKET REJECTED \0A \00"
@.str.5 = [42 x i8] c" \0A Bucket capacity exceeded-REJECTED!! \0A \00"
@.str.6 = [32 x i8] c" \0A \0A Incomming Packet size: %d \00"
@.str.7 = [36 x i8] c" \0A Bytes remaining to Transmit: %d \00"
@.str.8 = [41 x i8] c" \0A Time left for transmission: %d units \00"
@.str.9 = [36 x i8] c" \0A Packet of size %d Transmitted \0A \00"
@.str.10 = [46 x i8] c" ----Bytes Remaining after Transmission:%d \0A \00"
@.str.11 = [31 x i8] c" \0A No packets to transmit!! \0A \00"
@.str.12 = [18 x i8] c" Time Left: %d \0A \00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [5 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @rand to i32 (i32, ...)*)(i32 5)
%8 = mul nsw i32 %7, 10
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32 %8, i32* %9
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @rand to i32 (i32, ...)*)(i32 5)
%11 = mul nsw i32 %10, 10
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
store i32 %11, i32* %12
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @rand to i32 (i32, ...)*)(i32 5)
%14 = mul nsw i32 %13, 10
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
store i32 %14, i32* %15
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @rand to i32 (i32, ...)*)(i32 5)
%17 = mul nsw i32 %16, 10
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
store i32 %17, i32* %18
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @rand to i32 (i32, ...)*)(i32 5)
%20 = mul nsw i32 %19, 10
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 %20, i32* %21
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0, i32 %8)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32 %11)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2, i32 %14)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 3, i32 %17)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4, i32 %20)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %31
31: ; preds = %80, %0
%32 = phi i32 [ %8, %0 ], [ %82, %80 ]
%33 = phi i64 [ 0, %0 ], [ %78, %80 ]
%34 = phi i32 [ 0, %0 ], [ %77, %80 ]
%35 = add nsw i32 %32, %34
%36 = load i32, i32* %2
%37 = icmp sgt i32 %35, %36
br i1 %37, label %38, label %44
38: ; preds = %31
%39 = icmp sgt i32 %32, %36
br i1 %39, label %40, label %42
40: ; preds = %38
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @.str.4, i64 0, i64 0), i32 %32, i32 %36)
br label %76
42: ; preds = %38
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
br label %76
44: ; preds = %31
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i32 %32)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 %35)
%47 = call i32 (i32, ...) bitcast (i32 (...)* @rand to i32 (i32, ...)*)(i32 4)
%48 = mul nsw i32 %47, 10
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 %48)
%50 = icmp slt i32 %48, 10
br i1 %50, label %76, label %51
51: ; preds = %44, %70
%52 = phi i32 [ %71, %70 ], [ %35, %44 ]
%53 = phi i32 [ %74, %70 ], [ 10, %44 ]
%54 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%55 = icmp eq i32 %52, 0
br i1 %55, label %68, label %56
56: ; preds = %51
%57 = load i32, i32* %3
%58 = icmp sgt i32 %52, %57
br i1 %58, label %61, label %59
59: ; preds = %56
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i32 %52)
br label %65
61: ; preds = %56
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0), i32 %57)
%63 = load i32, i32* %3
%64 = sub nsw i32 %52, %63
br label %65
65: ; preds = %61, %59
%66 = phi i32 [ 0, %59 ], [ %64, %61 ]
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i32 %66)
br label %70
68: ; preds = %51
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0))
br label %70
70: ; preds = %68, %65
%71 = phi i32 [ %66, %65 ], [ 0, %68 ]
%72 = sub nsw i32 %48, %53
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %72)
%74 = add nuw nsw i32 %53, 10
%75 = icmp slt i32 %48, %74
br i1 %75, label %76, label %51
76: ; preds = %70, %44, %42, %40
%77 = phi i32 [ %34, %40 ], [ %34, %42 ], [ %35, %44 ], [ %71, %70 ]
%78 = add nuw nsw i64 %33, 1
%79 = icmp eq i64 %78, 5
br i1 %79, label %83, label %80
80: ; preds = %76
%81 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 %78
%82 = load i32, i32* %81
br label %31
83: ; preds = %76
ret i32 0
}