#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 /*<<< orphan*/ time_stop;
typedef int /*<<< orphan*/ time_start;
struct timespec {
  int tv_nsec;
};
typedef int /*<<< orphan*/ nano_sleep_packet;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ STDOUT_FILENO;
unsigned int atoi(char *);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ memset(struct timespec *, int /*<<< orphan*/, int);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int read(int, unsigned char *, int);
int /*<<< orphan*/ stderr;
unsigned long long usecDiff(struct timespec *, struct timespec *);
int write(int /*<<< orphan*/, unsigned char *, int);
int main(int argc, char *argv[]) {
  char *tsfile;
  unsigned int bitrate;
  unsigned char write_buf[188];
  int transport_fd;
  int written;
  int len;
  unsigned long long int packet_time;
  unsigned long long int real_time;
  struct timespec time_start;
  struct timespec time_stop;
  struct timespec nano_sleep_packet;
  memset(&time_start, 0, sizeof(time_start));
  memset(&time_stop, 0, sizeof(time_stop));
  memset(&nano_sleep_packet, 0, sizeof(nano_sleep_packet));
  if (argc < 3) {
    fprintf(stderr, "Usage: %s file.ts bitrate > output.ts\n", argv[0]);
    fprintf(stderr, "zero bitrate is set to default 100.000.000 bps\n");
    return 0;
  } else {
    tsfile = argv[1];
    bitrate = atoi(argv[2]);
    if (bitrate <= 0) {
      bitrate = 100000000;
    }
  }
  transport_fd = open(tsfile, O_RDONLY);
  if (transport_fd < 0) {
    fprintf(stderr, "can't open file %s\n", tsfile);
    return 0;
  }
  int completed = 0;
  packet_time = 0;
  real_time = 0;
  nano_sleep_packet.tv_nsec = 665778;
  clock_gettime(CLOCK_MONOTONIC, &time_start);
  while (!completed) {
    clock_gettime(CLOCK_MONOTONIC, &time_stop);
    real_time = usecDiff(&time_stop, &time_start);
    while (real_time * bitrate > packet_time * 1000000) {
      len = read(transport_fd, write_buf, 188);
      if (len < 0) {
        fprintf(stderr, "ts file read error \n");
        completed = 1;
      } else if (len == 0) {
        fprintf(stderr, "ts sent done\n");
        completed = 1;
      } else {
        written = write(STDOUT_FILENO, write_buf, len);
        if (written <= 0) {
          perror("send(): error ");
          completed = 1;
        } else {
          packet_time += 188 * 8;
        }
      }
    }
    nanosleep(&nano_sleep_packet, 0);
  }
  close(transport_fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x108(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
lea    -0x118(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
cmpl   $0x3,-0x8(%rbp)
jge    124d <main+0x9d>
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xddd(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1488 <main+0x2d8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
ja     127a <main+0xca>
movl   $0x5f5e100,-0x1c(%rbp)
jmp    127f <main+0xcf>
mov    -0x18(%rbp),%rdi
mov    0x2d56(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
mov    %eax,-0xe4(%rbp)
cmpl   $0x0,-0xe4(%rbp)
jge    12cb <main+0x11b>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd9f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1488 <main+0x2d8>
movl   $0x0,-0x11c(%rbp)
movq   $0x0,-0xf8(%rbp)
movq   $0x0,-0x100(%rbp)
movl   $0xa28b2,-0x118(%rbp)
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
lea    -0x108(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmpl   $0x0,-0x11c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1323 <main+0x173>
jmp    1476 <main+0x2c6>
mov    0x2cae(%rip),%rax
mov    (%rax),%edi
lea    -0x110(%rbp),%rsi
call   1030 <clock_gettime@plt>
lea    -0x110(%rbp),%rdi
lea    -0x108(%rbp),%rsi
call   10a0 <usecDiff@plt>
mov    %rax,-0x100(%rbp)
mov    -0x100(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   %rcx,%rax
imul   $0xf4240,-0xf8(%rbp),%rcx
cmp    %rcx,%rax
jbe    1463 <main+0x2b3>
mov    -0xe4(%rbp),%edi
lea    -0xe0(%rbp),%rsi
mov    $0xbc,%edx
call   1080 <read@plt>
mov    %eax,-0xec(%rbp)
cmpl   $0x0,-0xec(%rbp)
jge    13c4 <main+0x214>
mov    0x2c23(%rip),%rax
mov    (%rax),%edi
lea    0xcbd(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x11c(%rbp)
jmp    145e <main+0x2ae>
cmpl   $0x0,-0xec(%rbp)
jne    13f7 <main+0x247>
mov    0x2bf0(%rip),%rax
mov    (%rax),%edi
lea    0xc9f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x11c(%rbp)
jmp    1459 <main+0x2a9>
mov    0x2bf2(%rip),%rax
mov    (%rax),%edi
lea    -0xe0(%rbp),%rsi
mov    -0xec(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0xe8(%rbp)
cmpl   $0x0,-0xe8(%rbp)
jg     1440 <main+0x290>
lea    0xc62(%rip),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x11c(%rbp)
jmp    1454 <main+0x2a4>
mov    -0xf8(%rbp),%rax
add    $0x5e0,%rax
mov    %rax,-0xf8(%rbp)
jmp    1459 <main+0x2a9>
jmp    145e <main+0x2ae>
jmp    1352 <main+0x1a2>
lea    -0x118(%rbp),%rdi
xor    %esi,%esi
call   1050 <nanosleep@plt>
jmp    130a <main+0x15a>
mov    -0xe4(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
cmp    $0x2,%ebp
jg     122d <main+0x7d>
mov    0x2dc5(%rip),%rbp
mov    0x0(%rbp),%edi
mov    (%rbx),%rdx
lea    0xdf0(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xe06(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1399 <main+0x1e9>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebp
mov    0x2d9d(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10b0 <open@plt>
test   %eax,%eax
js     137f <main+0x1cf>
mov    %eax,%ebx
test   %ebp,%ebp
mov    $0x5f5e100,%eax
cmovne %ebp,%eax
mov    %rax,0x18(%rsp)
movl   $0xa28b2,(%rsp)
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
lea    0x20(%rsp),%r12
mov    0x2d3c(%rip),%r15
xor    %r13d,%r13d
jmp    12b2 <main+0x102>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rsp,%rdi
xor    %esi,%esi
call   1050 <nanosleep@plt>
test   %ebp,%ebp
jne    1376 <main+0x1c6>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
lea    0x10(%rsp),%rbp
mov    %rbp,%rsi
call   1030 <clock_gettime@plt>
mov    %rbp,%rdi
lea    0x8(%rsp),%rsi
call   10a0 <usecDiff@plt>
mov    %rax,%r14
imul   0x18(%rsp),%r14
imul   $0xf4240,%r13,%rax
xor    %ebp,%ebp
jmp    130d <main+0x15d>
nopl   0x0(%rax)
mov    (%r15),%edi
lea    0xd71(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%ebp
imul   $0xf4240,%r13,%rax
cmp    %rax,%r14
jbe    12a0 <main+0xf0>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0xbc,%edx
call   1080 <read@plt>
test   %eax,%eax
js     12f0 <main+0x140>
je     1350 <main+0x1a0>
mov    0x2cc2(%rip),%rcx
mov    (%rcx),%edi
mov    %r12,%rsi
mov    %eax,%edx
call   1040 <write@plt>
test   %eax,%eax
jle    135c <main+0x1ac>
add    $0x5e0,%r13
imul   $0xf4240,%r13,%rax
jmp    130d <main+0x15d>
xchg   %ax,%ax
mov    (%r15),%edi
lea    0xd26(%rip),%rsi
jmp    12fa <main+0x14a>
lea    0xd2b(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%ebp
imul   $0xf4240,%r13,%rax
jmp    130d <main+0x15d>
mov    %ebx,%edi
call   1070 <close@plt>
jmp    1399 <main+0x1e9>
mov    0x2c42(%rip),%rax
mov    (%rax),%edi
lea    0xcc8(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s file.ts bitrate > output.ts\0A\00"
@.str.1 = [48 x i8] c"zero bitrate is set to default 100.000.000 bps\0A\00"
@O_RDONLY = global i32 0
@.str.2 = [20 x i8] c"can't open file %s\0A\00"
@CLOCK_MONOTONIC = global i32 0
@.str.3 = [21 x i8] c"ts file read error \0A\00"
@.str.4 = [14 x i8] c"ts sent done\0A\00"
@STDOUT_FILENO = global i32 0
@.str.5 = [15 x i8] c"send(): error \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 [188 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i64
%14 = alloca %struct.timespec
%15 = alloca %struct.timespec
%16 = alloca %struct.timespec
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = call i32 @memset(%struct.timespec* %14, i32 0, i32 4)
%19 = call i32 @memset(%struct.timespec* %15, i32 0, i32 4)
%20 = call i32 @memset(%struct.timespec* %16, i32 0, i32 4)
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 3
br i1 %22, label %23, label %31
23: ; preds = %2
%24 = load i32, i32* @stderr
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %108
31: ; preds = %2
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
store i8* %34, i8** %6
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i32 @atoi(i8* %37)
store i32 %38, i32* %7
%39 = load i32, i32* %7
%40 = icmp ule i32 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %31
store i32 100000000, i32* %7
br label %42
42: ; preds = %41, %31
br label %43
43: ; preds = %42
%44 = load i8*, i8** %6
%45 = load i32, i32* @O_RDONLY
%46 = call i32 @open(i8* %44, i32 %45)
store i32 %46, i32* %9
%47 = load i32, i32* %9
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %43
%50 = load i32, i32* @stderr
%51 = load i8*, i8** %6
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %51)
store i32 0, i32* %3
br label %108
53: ; preds = %43
store i32 0, i32* %17
store i64 0, i64* %12
store i64 0, i64* %13
%54 = getelementptr inbounds %struct.timespec, %struct.timespec* %16, i32 0, i32 0
store i32 665778, i32* %54
%55 = load i32, i32* @CLOCK_MONOTONIC
%56 = call i32 @clock_gettime(i32 %55, %struct.timespec* %14)
br label %57
57: ; preds = %103, %53
%58 = load i32, i32* %17
%59 = icmp ne i32 %58, 0
%60 = xor i1 %59, true
br i1 %60, label %61, label %105
61: ; preds = %57
%62 = load i32, i32* @CLOCK_MONOTONIC
%63 = call i32 @clock_gettime(i32 %62, %struct.timespec* %15)
%64 = call i64 @usecDiff(%struct.timespec* %15, %struct.timespec* %14)
store i64 %64, i64* %13
br label %65
65: ; preds = %102, %61
%66 = load i64, i64* %13
%67 = load i32, i32* %7
%68 = zext i32 %67 to i64
%69 = mul i64 %66, %68
%70 = load i64, i64* %12
%71 = mul i64 %70, 1000000
%72 = icmp ugt i64 %69, %71
br i1 %72, label %73, label %103
73: ; preds = %65
%74 = load i32, i32* %9
%75 = getelementptr inbounds [188 x i8], [188 x i8]* %8, i64 0, i64 0
%76 = call i32 @read(i32 %74, i8* %75, i32 188)
store i32 %76, i32* %11
%77 = load i32, i32* %11
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %73
%80 = load i32, i32* @stderr
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %17
br label %102
82: ; preds = %73
%83 = load i32, i32* %11
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = load i32, i32* @stderr
%87 = call i32 (i32, i8*, ...) @fprintf(i32 %86, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %17
br label %101
88: ; preds = %82
%89 = load i32, i32* @STDOUT_FILENO
%90 = getelementptr inbounds [188 x i8], [188 x i8]* %8, i64 0, i64 0
%91 = load i32, i32* %11
%92 = call i32 @write(i32 %89, i8* %90, i32 %91)
store i32 %92, i32* %10
%93 = load i32, i32* %10
%94 = icmp sle i32 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %88
%96 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %17
br label %100
97: ; preds = %88
%98 = load i64, i64* %12
%99 = add i64 %98, 1504
store i64 %99, i64* %12
br label %100
100: ; preds = %97, %95
br label %101
101: ; preds = %100, %85
br label %102
102: ; preds = %101, %79
br label %65
103: ; preds = %65
%104 = call i32 @nanosleep(%struct.timespec* %16, i32 0)
br label %57
105: ; preds = %57
%106 = load i32, i32* %9
%107 = call i32 @close(i32 %106)
store i32 0, i32* %3
br label %108
108: ; preds = %105, %49, %23
%109 = load i32, i32* %3
ret i32 %109
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s file.ts bitrate > output.ts\0A\00"
@.str.1 = [48 x i8] c"zero bitrate is set to default 100.000.000 bps\0A\00"
@O_RDONLY = global i32 0
@.str.2 = [20 x i8] c"can't open file %s\0A\00"
@CLOCK_MONOTONIC = global i32 0
@.str.3 = [21 x i8] c"ts file read error \0A\00"
@.str.4 = [14 x i8] c"ts sent done\0A\00"
@STDOUT_FILENO = global i32 0
@.str.5 = [15 x i8] c"send(): error \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [188 x i8]
%4 = alloca %struct.timespec
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = getelementptr inbounds [188 x i8], [188 x i8]* %3, i64 0, i64 0
%8 = bitcast %struct.timespec* %4 to i8*
%9 = bitcast %struct.timespec* %5 to i8*
%10 = bitcast %struct.timespec* %6 to i8*
%11 = call i32 @memset(%struct.timespec* %4, i32 0, i32 4)
%12 = call i32 @memset(%struct.timespec* %5, i32 0, i32 4)
%13 = call i32 @memset(%struct.timespec* %6, i32 0, i32 4)
%14 = icmp slt i32 %0, 3
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %1
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
br label %81
21: ; preds = %2
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = load i32, i32* @O_RDONLY
%28 = call i32 @open(i8* %23, i32 %27)
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %21
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %23)
br label %81
33: ; preds = %21
%34 = icmp eq i32 %26, 0
%35 = select i1 %34, i32 100000000, i32 %26
%36 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i64 0, i32 0
store i32 665778, i32* %36
%37 = load i32, i32* @CLOCK_MONOTONIC
%38 = call i32 @clock_gettime(i32 %37, %struct.timespec* %4)
%39 = zext i32 %35 to i64
br label %40
40: ; preds = %33, %74
%41 = phi i64 [ 0, %33 ], [ %75, %74 ]
%42 = load i32, i32* @CLOCK_MONOTONIC
%43 = call i32 @clock_gettime(i32 %42, %struct.timespec* %5)
%44 = call i64 @usecDiff(%struct.timespec* %5, %struct.timespec* %4)
%45 = mul i64 %44, %39
%46 = mul i64 %41, 1000000
%47 = icmp ugt i64 %45, %46
br i1 %47, label %48, label %74
48: ; preds = %40, %69
%49 = phi i32 [ %71, %69 ], [ 0, %40 ]
%50 = phi i64 [ %70, %69 ], [ %41, %40 ]
%51 = call i32 @read(i32 %28, i8* %7, i32 188)
%52 = icmp slt i32 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %48
%54 = load i32, i32* @stderr
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %69
56: ; preds = %48
%57 = icmp eq i32 %51, 0
br i1 %57, label %58, label %61
58: ; preds = %56
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %69
61: ; preds = %56
%62 = load i32, i32* @STDOUT_FILENO
%63 = call i32 @write(i32 %62, i8* %7, i32 %51)
%64 = icmp slt i32 %63, 1
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %69
67: ; preds = %61
%68 = add i64 %50, 1504
br label %69
69: ; preds = %58, %67, %65, %53
%70 = phi i64 [ %50, %53 ], [ %50, %58 ], [ %50, %65 ], [ %68, %67 ]
%71 = phi i32 [ 1, %53 ], [ 1, %58 ], [ 1, %65 ], [ %49, %67 ]
%72 = mul i64 %70, 1000000
%73 = icmp ugt i64 %45, %72
br i1 %73, label %48, label %74
74: ; preds = %69, %40
%75 = phi i64 [ %41, %40 ], [ %70, %69 ]
%76 = phi i32 [ 0, %40 ], [ %71, %69 ]
%77 = call i32 @nanosleep(%struct.timespec* %6, i32 0)
%78 = icmp eq i32 %76, 0
br i1 %78, label %40, label %79
79: ; preds = %74
%80 = call i32 @close(i32 %28)
br label %81
81: ; preds = %79, %30, %15
ret i32 0
}