#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int atoi(char *);
TYPE_1__ div(float, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
float strtof(char *, int /*<<< orphan*/ *);
char *strtok(char *, char const *);
int main(int argc, char *argv[]) {
  int hour, min, sec;
  int total_sec;
  div_t tkm;
  float t, km, speed;
  char *tok;
  const char delimiters[] = " :";
  if (argc < 3) {
    fprintf(stderr, "Usage: %s, km(eg. 21.1) time(hh:mm:ss)\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  km = strtof(argv[1], NULL);
  printf("%s: complied on "
         "Mar 17 2022"
         " "
         "05:44:58"
         "\n\n",
         argv[0]);
  tok = strtok(argv[2], delimiters);
  if (NULL != tok)
    hour = atoi(tok);
  tok = strtok(NULL, delimiters);
  if (NULL != tok)
    min = atoi(tok);
  tok = strtok(NULL, delimiters);
  if (NULL != tok)
    sec = atoi(tok);
  total_sec = sec + (60 * min) + (60 * 60 * hour);
  t = total_sec / km;
  speed = (km / total_sec) * 3600;
  printf("Speed = %.2f km/h\n", speed);
  tkm = div(t, 60);
  printf("Pace  = %d min %d sec\n", tkm.quot, tkm.rem);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe77(%rip),%ax
mov    %ax,-0x43(%rbp)
mov    0xe6f(%rip),%al
mov    %al,-0x41(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11ce <main+0x5e>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe4c(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtof@plt>
movss  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x43(%rbp),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
cmp    -0x40(%rbp),%rax
je     1226 <main+0xb6>
mov    -0x40(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x43(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
cmp    -0x40(%rbp),%rax
je     124f <main+0xdf>
mov    -0x40(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x18(%rbp)
lea    -0x43(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
cmp    -0x40(%rbp),%rax
je     1278 <main+0x108>
mov    -0x40(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
imul   $0x3c,-0x18(%rbp),%ecx
add    %ecx,%eax
imul   $0xe10,-0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
cvtsi2ssl -0x20(%rbp),%xmm0
divss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x30(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xd4e(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x2c(%rbp),%xmm0
mov    $0x3c,%edi
call   1060 <div@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movb   $0x0,0xe(%rsp)
movw   $0x3a20,0xc(%rsp)
cmp    $0x2,%edi
jg     11b1 <main+0x41>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe69(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    0x8(%rbx),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
call   1040 <strtof@plt>
movss  %xmm0,0x14(%rsp)
mov    (%rbx),%rsi
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rbx),%rdi
lea    0xc(%rsp),%rsi
call   1070 <strtok@plt>
mov    $0x0,%ebx
test   %rax,%rax
je     11fc <main+0x8c>
mov    %rax,%rdi
call   1080 <atoi@plt>
imul   $0xe10,%eax,%ebx
lea    0xc(%rsp),%rsi
xor    %edi,%edi
call   1070 <strtok@plt>
test   %rax,%rax
je     1219 <main+0xa9>
mov    %rax,%rdi
call   1080 <atoi@plt>
imul   $0x3c,%eax,%r14d
lea    0xc(%rsp),%rsi
xor    %edi,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
test   %rdi,%rdi
je     1232 <main+0xc2>
call   1080 <atoi@plt>
add    %ebx,%r14d
add    %eax,%r14d
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
movaps %xmm0,%xmm2
movss  0x14(%rsp),%xmm1
divss  %xmm1,%xmm2
movss  %xmm2,0x10(%rsp)
divss  %xmm0,%xmm1
mulss  0xda1(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xde9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
mov    $0x3c,%edi
call   1060 <div@plt>
mov    %rax,%rdx
shr    $0x20,%rdx
lea    0xdd7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2d2e(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@__const.main.delimiters = [3 x i8] c" :\00"
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s, km(eg. 21.1) time(hh:mm:ss)\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [39 x i8] c"%s: complied on Mar 17 2022 05:44:58\0A\0A\00"
@.str.2 = [19 x i8] c"Speed = %.2f km/h\0A\00"
@.str.3 = [23 x i8] c"Pace = %d min %d sec\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.TYPE_3__
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca i8*
%15 = alloca [3 x i8]
%16 = alloca %struct.TYPE_3__
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = bitcast [3 x i8]* %15 to i8*
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 3
br i1 %19, label %20, label %28
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @EXIT_FAILURE
%27 = call i32 @exit(i32 %26)
unreachable
28: ; preds = %2
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call float @strtof(i8* %31, i32* null)
store float %32, float* %12
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%41 = call i8* @strtok(i8* %39, i8* %40)
store i8* %41, i8** %14
%42 = load i8*, i8** %14
%43 = icmp ne i8* null, %42
br i1 %43, label %44, label %47
44: ; preds = %28
%45 = load i8*, i8** %14
%46 = call i32 @atoi(i8* %45)
store i32 %46, i32* %6
br label %47
47: ; preds = %44, %28
%48 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%49 = call i8* @strtok(i8* null, i8* %48)
store i8* %49, i8** %14
%50 = load i8*, i8** %14
%51 = icmp ne i8* null, %50
br i1 %51, label %52, label %55
52: ; preds = %47
%53 = load i8*, i8** %14
%54 = call i32 @atoi(i8* %53)
store i32 %54, i32* %7
br label %55
55: ; preds = %52, %47
%56 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%57 = call i8* @strtok(i8* null, i8* %56)
store i8* %57, i8** %14
%58 = load i8*, i8** %14
%59 = icmp ne i8* null, %58
br i1 %59, label %60, label %63
60: ; preds = %55
%61 = load i8*, i8** %14
%62 = call i32 @atoi(i8* %61)
store i32 %62, i32* %8
br label %63
63: ; preds = %60, %55
%64 = load i32, i32* %8
%65 = load i32, i32* %7
%66 = mul nsw i32 60, %65
%67 = add nsw i32 %64, %66
%68 = load i32, i32* %6
%69 = mul nsw i32 3600, %68
%70 = add nsw i32 %67, %69
store i32 %70, i32* %9
%71 = load i32, i32* %9
%72 = sitofp i32 %71 to float
%73 = load float, float* %12
%74 = fdiv float %72, %73
store float %74, float* %11
%75 = load float, float* %12
%76 = load i32, i32* %9
%77 = sitofp i32 %76 to float
%78 = fdiv float %75, %77
%79 = fmul float %78, 3.600000e+03
store float %79, float* %13
%80 = load float, float* %13
%81 = fpext float %80 to double
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %81)
%83 = load float, float* %11
%84 = call i64 @div(float %83, i32 60)
%85 = bitcast %struct.TYPE_3__* %16 to i64*
store i64 %84, i64* %85
%86 = bitcast %struct.TYPE_3__* %10 to i8*
%87 = bitcast %struct.TYPE_3__* %16 to i8*
%88 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 0
%89 = load i32, i32* %88
%90 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 1
%91 = load i32, i32* %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %89, i32 %91)
%93 = load i32, i32* @EXIT_SUCCESS
%94 = call i32 @exit(i32 %93)
unreachable
}

LLVM IR (-O2):
@__const.main.delimiters = [3 x i8] c" :\00"
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s, km(eg. 21.1) time(hh:mm:ss)\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [39 x i8] c"%s: complied on Mar 17 2022 05:44:58\0A\0A\00"
@.str.2 = [19 x i8] c"Speed = %.2f km/h\0A\00"
@.str.3 = [23 x i8] c"Pace = %d min %d sec\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call float @strtof(i8* nocapture %14, i32* null)
%16 = load i8*, i8** %1
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = call i8* @strtok(i8* %19, i8* %4)
%21 = icmp eq i8* %20, null
br i1 %21, label %25, label %22
22: ; preds = %12
%23 = tail call i32 @atoi(i8* %20)
%24 = mul i32 %23, 3600
br label %25
25: ; preds = %22, %12
%26 = phi i32 [ %24, %22 ], [ 0, %12 ]
%27 = call i8* @strtok(i8* null, i8* %4)
%28 = icmp eq i8* %27, null
br i1 %28, label %32, label %29
29: ; preds = %25
%30 = tail call i32 @atoi(i8* %27)
%31 = mul i32 %30, 60
br label %32
32: ; preds = %29, %25
%33 = phi i32 [ %31, %29 ], [ 0, %25 ]
%34 = call i8* @strtok(i8* null, i8* %4)
%35 = icmp eq i8* %34, null
br i1 %35, label %38, label %36
36: ; preds = %32
%37 = tail call i32 @atoi(i8* %34)
br label %38
38: ; preds = %36, %32
%39 = phi i32 [ %37, %36 ], [ undef, %32 ]
%40 = add i32 %33, %26
%41 = add i32 %40, %39
%42 = sitofp i32 %41 to float
%43 = fdiv float %42, %15
%44 = fdiv float %15, %42
%45 = fmul float %44, 3.600000e+03
%46 = fpext float %45 to double
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %46)
%48 = tail call i64 @div(float %43, i32 60)
%49 = trunc i64 %48 to i32
%50 = lshr i64 %48, 32
%51 = trunc i64 %50 to i32
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %49, i32 %51)
%53 = load i32, i32* @EXIT_SUCCESS
%54 = tail call i32 @exit(i32 %53)
unreachable
}