#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 /*<<< orphan*/ assert(int);
int atoi(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int, unsigned int,
                            unsigned int);
void adjust_time(char *time_buff, const int half_exposure) {
  unsigned sec = atoi(time_buff + 11) * 3600 + atoi(time_buff + 14) * 60 +
                 atoi(time_buff + 17);
  sec += half_exposure;
  assert(sec < 86400 + 86400);
  snprintf(time_buff + 11, 9, "%02u:%02u:%02u", sec / 3600, (sec / 60) % 60,
           sec % 60);
  time_buff[19] = ' ';
}


x86 assembly (clang, -O0):
<adjust_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xb,%rdi
call   1050 <atoi@plt>
imul   $0xe10,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xe,%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   $0x3c,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x11,%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x2a300,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
add    $0xb,%rdi
mov    -0x10(%rbp),%eax
mov    $0xe10,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    $0x3c,%esi
xor    %edx,%edx
div    %esi
mov    $0x3c,%esi
xor    %edx,%edx
div    %esi
mov    %edx,%r8d
mov    -0x10(%rbp),%eax
mov    $0x3c,%esi
xor    %edx,%edx
div    %esi
mov    %edx,%r9d
mov    $0x9,%esi
lea    0xe14(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
movb   $0x20,0x13(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_time>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r12d
mov    %rdi,%r15
lea    0xb(%rdi),%r14
mov    %r14,%rdi
call   1050 <atoi@plt>
imul   $0xe10,%eax,%ebx
lea    0xe(%r15),%rdi
call   1050 <atoi@plt>
imul   $0x3c,%eax,%ebp
lea    0x11(%r15),%rdi
call   1050 <atoi@plt>
add    %r12d,%ebx
add    %ebp,%ebx
add    %eax,%ebx
xor    %edi,%edi
cmp    $0x2a300,%ebx
setb   %dil
call   1040 <assert@plt>
mov    $0x91a2b3c5,%ecx
imul   %rbx,%rcx
shr    $0x2b,%rcx
mov    $0x88888889,%eax
mov    %rbx,%r8
imul   %rax,%r8
shr    $0x25,%r8
imul   %r8,%rax
shr    $0x25,%rax
imul   $0x3c,%eax,%eax
imul   $0x3c,%r8d,%edx
sub    %eax,%r8d
sub    %edx,%ebx
lea    0xe4b(%rip),%rdx
mov    %r14,%rdi
mov    $0x9,%esi
mov    %ebx,%r9d
call   1030 <snprintf@plt>
movb   $0x20,0x13(%r15)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%02u:%02u:%02u\00"
define void @adjust_time(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 11
%8 = call i32 @atoi(i8* %7)
%9 = mul nsw i32 %8, 3600
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 14
%12 = call i32 @atoi(i8* %11)
%13 = mul nsw i32 %12, 60
%14 = add nsw i32 %9, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 17
%17 = call i32 @atoi(i8* %16)
%18 = add nsw i32 %14, %17
store i32 %18, i32* %5
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = add i32 %20, %19
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = icmp ult i32 %22, 172800
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 11
%28 = load i32, i32* %5
%29 = udiv i32 %28, 3600
%30 = load i32, i32* %5
%31 = udiv i32 %30, 60
%32 = urem i32 %31, 60
%33 = load i32, i32* %5
%34 = urem i32 %33, 60
%35 = call i32 @snprintf(i8* %27, i32 9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %29, i32 %32, i32 %34)
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 19
store i8 32, i8* %37
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%02u:%02u:%02u\00"
define void @adjust_time(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 11
%4 = tail call i32 @atoi(i8* %3)
%5 = mul nsw i32 %4, 3600
%6 = getelementptr inbounds i8, i8* %0, i64 14
%7 = tail call i32 @atoi(i8* %6)
%8 = mul nsw i32 %7, 60
%9 = getelementptr inbounds i8, i8* %0, i64 17
%10 = tail call i32 @atoi(i8* %9)
%11 = add i32 %5, %1
%12 = add i32 %11, %8
%13 = add i32 %12, %10
%14 = icmp ult i32 %13, 172800
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = udiv i32 %13, 3600
%18 = udiv i32 %13, 60
%19 = urem i32 %18, 60
%20 = urem i32 %13, 60
%21 = tail call i32 @snprintf(i8* %3, i32 9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %19, i32 %20)
%22 = getelementptr inbounds i8, i8* %0, i64 19
store i8 32, i8* %22
ret void
}