#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*/ all_test();
int /*<<< orphan*/ calculate_sec(int, int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int input_sec, sec, min, hr;
  if (argc == 2 && strcmp(argv[1], "-t") == 0) {
    all_test();
    printf("All test pass\n");
  } else {
    puts("Intast et antal sekunder der skal omregnes: ");
    scanf("%d", &input_sec);
    calculate_sec(input_sec, &sec, &min, &hr);
    printf("\n%d sekunder omregnet til timer, minutter og sekunder:\n",
           input_sec);
    printf("%d time, %d minutter og %d sekunder\n", hr, min, sec);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11b8 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe71(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11b8 <main+0x58>
mov    $0x0,%al
call   1080 <all_test@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1210 <main+0xb0>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
lea    0xe74(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x14(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <calculate_sec@plt>
mov    -0x14(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
cmp    $0x2,%edi
jne    117e <main+0x1e>
mov    0x8(%rsi),%rdi
lea    0xe8c(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11e1 <main+0x81>
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x8(%rsp),%edi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <calculate_sec@plt>
mov    0x8(%rsp),%esi
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11f4 <main+0x94>
xor    %eax,%eax
call   1080 <all_test@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-t\00"
@.str.1 = [15 x i8] c"All test pass\0A\00"
@.str.2 = [45 x i8] c"Intast et antal sekunder der skal omregnes: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [56 x i8] c"\0A%d sekunder omregnet til timer, minutter og sekunder:\0A\00"
@.str.5 = [37 x i8] c"%d time, %d minutter og %d sekunder\0A\00"
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %21
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = call i32 (...) @all_test()
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %32
21: ; preds = %12, %2
%22 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%24 = load i32, i32* %6
%25 = call i32 @calculate_sec(i32 %24, i32* %7, i32* %8, i32* %9)
%26 = load i32, i32* %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %9
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
br label %32
32: ; preds = %21, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-t\00"
@.str.2 = [45 x i8] c"Intast et antal sekunder der skal omregnes: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [56 x i8] c"\0A%d sekunder omregnet til timer, minutter og sekunder:\0A\00"
@.str.5 = [37 x i8] c"%d time, %d minutter og %d sekunder\0A\00"
@str = [14 x i8] c"All test pass\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = icmp eq i32 %0, 2
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = tail call i32 (...) @all_test()
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %31
20: ; preds = %12, %2
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%23 = load i32, i32* %3
%24 = call i32 @calculate_sec(i32 %23, i32* %4, i32* %5, i32* %6)
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %6
%28 = load i32, i32* %5
%29 = load i32, i32* %4
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %27, i32 %28, i32 %29)
br label %31
31: ; preds = %20, %17
ret i32 0
}