#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*/ printf(char *, int);
void updateTimeDisplay(char *newTime) {
  if (!newTime)
    return;
  int iValue = 0;
  char cValue = '0';
  int characterMap[7] = {0, 0, 0, 0, 0, 0, 0};
  for (int i = 0; i < 6; ++i) {
    cValue = newTime[i];
    iValue = atoi(&cValue);
    printf("%d\n", iValue);
  }
}


x86 assembly (clang, -O0):
<updateTimeDisplay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <updateTimeDisplay+0x1c>
jmp    11af <updateTimeDisplay+0x7f>
movl   $0x0,-0xc(%rbp)
movb   $0x30,-0xd(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1040 <memset@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x6,-0x34(%rbp)
jge    11af <updateTimeDisplay+0x7f>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
lea    -0xd(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    116e <updateTimeDisplay+0x3e>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateTimeDisplay>:
test   %rdi,%rdi
je     11df <updateTimeDisplay+0xbf>
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%al
mov    %al,0xf(%rsp)
lea    0xf(%rsp),%r14
mov    %r14,%rdi
call   1040 <atoi@plt>
lea    0xeb1(%rip),%r15
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x1(%rbx),%al
mov    %al,0xf(%rsp)
mov    %r14,%rdi
call   1040 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2(%rbx),%al
mov    %al,0xf(%rsp)
mov    %r14,%rdi
call   1040 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x3(%rbx),%al
mov    %al,0xf(%rsp)
mov    %r14,%rdi
call   1040 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x4(%rbx),%al
mov    %al,0xf(%rsp)
mov    %r14,%rdi
call   1040 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x5(%rbx),%al
mov    %al,0xf(%rsp)
mov    %r14,%rdi
call   1040 <atoi@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @updateTimeDisplay(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
%5 = alloca [7 x i32]
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
br label %27
10: ; preds = %1
store i32 0, i32* %3
store i8 48, i8* %4
%11 = bitcast [7 x i32]* %5 to i8*
store i32 0, i32* %6
br label %12
12: ; preds = %24, %10
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 6
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i8*, i8** %2
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
store i8 %20, i8* %4
%21 = call i32 @atoi(i8* %4)
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %15
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %12
27: ; preds = %9, %12
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @updateTimeDisplay(i8* %0) {
%2 = alloca i8
%3 = icmp eq i8* %0, null
br i1 %3, label %28, label %4
4: ; preds = %1
%5 = load i8, i8* %0
store i8 %5, i8* %2
%6 = call i32 @atoi(i8* %2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
store i8 %9, i8* %2
%10 = call i32 @atoi(i8* %2)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds i8, i8* %0, i64 2
%13 = load i8, i8* %12
store i8 %13, i8* %2
%14 = call i32 @atoi(i8* %2)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %16
store i8 %17, i8* %2
%18 = call i32 @atoi(i8* %2)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds i8, i8* %0, i64 4
%21 = load i8, i8* %20
store i8 %21, i8* %2
%22 = call i32 @atoi(i8* %2)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds i8, i8* %0, i64 5
%25 = load i8, i8* %24
store i8 %25, i8* %2
%26 = call i32 @atoi(i8* %2)
%27 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %1, %4
ret void
}