#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 */
struct tm {
  int tm_hour;
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void simple_display(struct tm *current_time) {
  printf("\r");
  printf("%02i:%02i:%02i", current_time->tm_hour, current_time->tm_min,
         current_time->tm_sec);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<simple_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_display>:
push   %rbx
mov    %rdi,%rbx
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    (%rbx),%esi
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
@.str = [2 x i8] c"\0D\00"
@.str.1 = [15 x i8] c"%02i:%02i:%02i\00"
@stdout = global i32 0
define void @simple_display(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.tm*, %struct.tm** %2
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = load %struct.tm*, %struct.tm** %2
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = load %struct.tm*, %struct.tm** %2
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 2
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %9, i32 %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
@.str.1 = [15 x i8] c"%02i:%02i:%02i\00"
@stdout = global i32 0
define void @simple_display(%struct.tm* nocapture %0) {
%2 = tail call i32 @putchar(i32 13)
%3 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6, i32 %8)
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
ret void
}