#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 atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
scalar_t__ get_line(char *, int /*<<< orphan*/);
int /*<<< orphan*/ piece(char *, int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ replace_twenty_four_hundred(char *, char *, int, int, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  char buffer[1024];
  char date_string[1024];
  char time_string[1024];
  int date_offset, time_offset, delimiter;
  if (argc != 4) {
    fprintf(stderr, "Usage: %s date_offset time_offset delimiter\n", argv[0]);
    exit(1);
  }
  date_offset = atoi(argv[1]);
  time_offset = atoi(argv[2]);
  delimiter = *argv[3];
  while (get_line(buffer, stdin)) {
    if (!piece(date_string, delimiter, buffer, date_offset)) {
      fprintf(stderr, "Warning in %s: cannot piece the date (%d) in (%s)\n",
              argv[0], date_offset, buffer);
      continue;
    }
    if (!piece(time_string, delimiter, buffer, time_offset)) {
      fprintf(stderr, "Warning in %s: cannot piece the time (%d) in (%s)\n",
              argv[0], time_offset, buffer);
      continue;
    }
    if (strcmp(time_string, "2400") == 0) {
      replace_twenty_four_hundred(buffer, date_string, date_offset, time_offset,
                                  delimiter);
    }
    printf("%s\n", buffer);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11cb <main+0x4b>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe46(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0xc14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0xc18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0xc1c(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x2dd8(%rip),%rax
mov    (%rax),%esi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     132c <main+0x1ac>
lea    -0x810(%rbp),%rdi
mov    -0xc1c(%rbp),%esi
lea    -0x410(%rbp),%rdx
mov    -0xc14(%rbp),%ecx
call   10a0 <piece@plt>
cmp    $0x0,%eax
jne    1279 <main+0xf9>
mov    0x2d88(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0xc14(%rbp),%ecx
lea    -0x410(%rbp),%r8
lea    0xdc0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1202 <main+0x82>
lea    -0xc10(%rbp),%rdi
mov    -0xc1c(%rbp),%esi
lea    -0x410(%rbp),%rdx
mov    -0xc18(%rbp),%ecx
call   10a0 <piece@plt>
cmp    $0x0,%eax
jne    12d1 <main+0x151>
mov    0x2d30(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0xc18(%rbp),%ecx
lea    -0x410(%rbp),%r8
lea    0xd9b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1202 <main+0x82>
lea    -0xc10(%rbp),%rdi
lea    0xdb4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1314 <main+0x194>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
mov    -0xc14(%rbp),%edx
mov    -0xc18(%rbp),%ecx
mov    -0xc1c(%rbp),%r8d
call   1070 <replace_twenty_four_hundred@plt>
lea    -0x410(%rbp),%rsi
lea    0xd76(%rip),%rdi
call   1040 <printf@plt>
jmp    1202 <main+0x82>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc18,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    11dc <main+0x5c>
mov    0x8(%rbx),%rdi
call   1080 <atoi@plt>
mov    %eax,%r13d
mov    0x10(%rbx),%rdi
call   1080 <atoi@plt>
mov    %eax,%r15d
mov    %rbx,0x8(%rsp)
mov    0x18(%rbx),%rax
movsbl (%rax),%ebx
mov    0x2e24(%rip),%rax
mov    (%rax),%esi
lea    0x10(%rsp),%rdi
call   1030 <get_line@plt>
test   %rax,%rax
jne    1200 <main+0x80>
xor    %edi,%edi
call   1090 <exit@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe11(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0x810(%rsp),%r12
lea    0x10(%rsp),%rbp
jmp    1235 <main+0xb5>
nop
lea    0xe81(%rip),%rdi
mov    %rbp,%rsi
call   1040 <printf@plt>
mov    0x2dc2(%rip),%rax
mov    (%rax),%esi
mov    %rbp,%rdi
call   1030 <get_line@plt>
test   %rax,%rax
je     11d5 <main+0x55>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
mov    %r13d,%ecx
call   10a0 <piece@plt>
test   %eax,%eax
je     1290 <main+0x110>
lea    0x410(%rsp),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
mov    %r15d,%ecx
call   10a0 <piece@plt>
test   %eax,%eax
je     12b0 <main+0x130>
mov    %r14,%rdi
lea    0xe24(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1210 <main+0x90>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    %ebx,%r8d
call   1070 <replace_twenty_four_hundred@plt>
jmp    1210 <main+0x90>
nop
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%rax
mov    (%rax),%rdx
lea    0xd85(%rip),%rsi
mov    %r13d,%ecx
jmp    12cb <main+0x14b>
nopl   (%rax)
mov    0x2d21(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%rax
mov    (%rax),%rdx
lea    0xd98(%rip),%rsi
mov    %r15d,%ecx
mov    %rbp,%r8
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    121f <main+0x9f>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s date_offset time_offset delimiter\0A\00"
@stdin = global i32 0
@.str.1 = [51 x i8] c"Warning in %s: cannot piece the date (%d) in (%s)\0A\00"
@.str.2 = [51 x i8] c"Warning in %s: cannot piece the time (%d) in (%s)\0A\00"
@.str.3 = [5 x i8] c"2400\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca [1024 x i8]
%8 = alloca [1024 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 4
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %9
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
store i32 %29, i32* %10
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 3
%32 = load i8*, i8** %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
store i32 %34, i32* %11
br label %35
35: ; preds = %81, %62, %47, %21
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%37 = load i32, i32* @stdin
%38 = call i64 @get_line(i8* %36, i32 %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %84
40: ; preds = %35
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%42 = load i32, i32* %11
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%44 = load i32, i32* %9
%45 = call i32 @piece(i8* %41, i32 %42, i8* %43, i32 %44)
%46 = icmp ne i32 %45, 0
br i1 %46, label %55, label %47
47: ; preds = %40
%48 = load i32, i32* @stderr
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 0
%51 = load i8*, i8** %50
%52 = load i32, i32* %9
%53 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%54 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %51, i32 %52, i8* %53)
br label %35
55: ; preds = %40
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%57 = load i32, i32* %11
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%59 = load i32, i32* %10
%60 = call i32 @piece(i8* %56, i32 %57, i8* %58, i32 %59)
%61 = icmp ne i32 %60, 0
br i1 %61, label %70, label %62
62: ; preds = %55
%63 = load i32, i32* @stderr
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
%67 = load i32, i32* %10
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%69 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i8* %66, i32 %67, i8* %68)
br label %35
70: ; preds = %55
%71 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %81
74: ; preds = %70
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%76 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%77 = load i32, i32* %9
%78 = load i32, i32* %10
%79 = load i32, i32* %11
%80 = call i32 @replace_twenty_four_hundred(i8* %75, i8* %76, i32 %77, i32 %78, i32 %79)
br label %81
81: ; preds = %74, %70
%82 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%83 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %82)
br label %35
84: ; preds = %35
%85 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s date_offset time_offset delimiter\0A\00"
@stdin = global i32 0
@.str.1 = [51 x i8] c"Warning in %s: cannot piece the date (%d) in (%s)\0A\00"
@.str.2 = [51 x i8] c"Warning in %s: cannot piece the time (%d) in (%s)\0A\00"
@.str.3 = [5 x i8] c"2400\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 4
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %1
%13 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = getelementptr inbounds i8*, i8** %1, i64 3
%23 = load i8*, i8** %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = load i32, i32* @stdin
%27 = call i64 @get_line(i8* %6, i32 %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %54, label %29
29: ; preds = %15, %36
%30 = call i32 @piece(i8* %7, i32 %25, i8* %6, i32 %18)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %40
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = load i8*, i8** %1
%35 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %34, i32 %18, i8* %6)
br label %36
36: ; preds = %32, %43, %52
%37 = load i32, i32* @stdin
%38 = call i64 @get_line(i8* %6, i32 %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %54, label %29
40: ; preds = %29
%41 = call i32 @piece(i8* %8, i32 %25, i8* %6, i32 %21)
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = load i32, i32* @stderr
%45 = load i8*, i8** %1
%46 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i8* %45, i32 %21, i8* %6)
br label %36
47: ; preds = %40
%48 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 @replace_twenty_four_hundred(i8* %6, i8* %7, i32 %18, i32 %21, i32 %25)
br label %52
52: ; preds = %50, %47
%53 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %6)
br label %36
54: ; preds = %36, %15
%55 = call i32 @exit(i32 0)
unreachable
}