#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*/ convert(int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, int *, int *, int *);
void main() {
  char time[] = "               ";
  int hh, mm, ss, sec;
  printf("Enter time in hh:mm:ss");
  scanf("%s", time);
  time[2] = ' ';
  time[5] = ' ';
  sscanf(time, "%d %d %d", &hh, &mm, &ss);
  printf("\nhh = %d mm = %d ss= %d", hh, mm, ss);
  convert(hh, mm, ss);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1060 <scanf@plt>
movb   $0x20,-0xe(%rbp)
movb   $0x20,-0xb(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1050 <sscanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <convert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
movb   $0x20,0x12(%rsp)
movb   $0x20,0x15(%rsp)
lea    0xea6(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %rbx,%rdi
call   1050 <sscanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
call   1030 <convert@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.time = [16 x i8] c" \00"
@.str = [23 x i8] c"Enter time in hh:mm:ss\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"%d %d %d\00"
@.str.3 = [24 x i8] c"\0Ahh = %d mm = %d ss= %d\00"
define void @main() {
%1 = alloca [16 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [16 x i8]* %1 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 2
store i8 32, i8* %10
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 5
store i8 32, i8* %11
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @convert(i32 %18, i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
@__const.main.time = [16 x i8] c" \00"
@.str = [23 x i8] c"Enter time in hh:mm:ss\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"%d %d %d\00"
@.str.3 = [24 x i8] c"\0Ahh = %d mm = %d ss= %d\00"
define void @main() {
%1 = alloca [16 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 2
store i8 32, i8* %11
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 5
store i8 32, i8* %12
%13 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @convert(i32 %18, i32 %19, i32 %20)
ret void
}