#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 *);
int /*<<< orphan*/ sprintf(char *, char *, int, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void increment_time_one_hour(char *time_string) {
  char hour[3], minute[3];
  int new_hour;
  if (strlen(time_string) != 4) {
    fprintf(stderr,
            "Warning in increment_time_one_hour(%s) time must be of length 4\n",
            time_string);
    exit(1);
  }
  *hour = *time_string;
  *(hour + 1) = *(time_string + 1);
  *(hour + 2) = '\0';
  strcpy(minute, time_string + 2);
  new_hour = atoi(hour) + 1;
  sprintf(time_string, "%.2d%s", new_hour, minute);
}


x86 assembly (clang, -O0):
<increment_time_one_hour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x4,%eax
je     11a1 <increment_time_one_hour+0x41>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe6e(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x2,%rsi
call   1030 <strcpy@plt>
lea    -0xb(%rbp),%rdi
call   1060 <atoi@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    -0xe(%rbp),%rcx
lea    0xe57(%rip),%rsi
call   1070 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_time_one_hour>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x4,%eax
jne    11bb <increment_time_one_hour+0x5b>
mov    (%rbx),%al
mov    %al,0x2(%rsp)
mov    0x1(%rbx),%al
mov    %al,0x3(%rsp)
movb   $0x0,0x4(%rsp)
lea    0x2(%rbx),%rsi
lea    0x5(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0x2(%rsp),%rdi
call   1060 <atoi@plt>
lea    0x1(%rax),%edx
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rcx
call   1070 <sprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
lea    0xe35(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Warning in increment_time_one_hour(%s) time must be of length 4\0A\00"
@.str.1 = [7 x i8] c"%.2d%s\00"
define void @increment_time_one_hour(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x i8]
%4 = alloca [3 x i8]
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp ne i32 %7, 4
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i8, i8* %15
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 %16, i8* %17
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8 0, i8* %24
%25 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 2
%28 = call i32 @strcpy(i8* %25, i8* %27)
%29 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%30 = call i32 @atoi(i8* %29)
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
%32 = load i8*, i8** %2
%33 = load i32, i32* %5
%34 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%35 = call i32 @sprintf(i8* %32, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %33, i8* %34)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Warning in increment_time_one_hour(%s) time must be of length 4\0A\00"
@.str.1 = [7 x i8] c"%.2d%s\00"
define void @increment_time_one_hour(i8* %0) {
%2 = alloca [3 x i8]
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%6 = tail call i32 @strlen(i8* %0)
%7 = icmp eq i32 %6, 4
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %0)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8, i8* %0
store i8 %13, i8* %4
%14 = getelementptr inbounds i8, i8* %0, i64 1
%15 = load i8, i8* %14
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 %15, i8* %16
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 0, i8* %17
%18 = getelementptr inbounds i8, i8* %0, i64 2
%19 = call i32 @strcpy(i8* %5, i8* %18)
%20 = call i32 @atoi(i8* %4)
%21 = add nsw i32 %20, 1
%22 = call i32 @sprintf(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %21, i8* %5)
ret void
}