#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int numSegons;
  printf("Introdueix un numero per transformar: ");
  scanf("%d", &numSegons);
  if (numSegons >= 0) {
    printf("\nSon %d minuts i %d segons: ", numSegons / 60, numSegons % 60);
  } else
    printf("Ha de ser un numero positiu.\n");
  return (EXIT_SUCCESS);
}


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)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jl     1189 <main+0x69>
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1197 <main+0x77>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edx
test   %edx,%edx
js     117c <main+0x4c>
mov    %edx,%eax
mov    $0x88888889,%esi
imul   %rax,%rsi
shr    $0x25,%rsi
imul   $0x3c,%esi,%eax
sub    %eax,%edx
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1188 <main+0x58>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Introdueix un numero per transformar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"\0ASon %d minuts i %d segons: \00"
@.str.3 = [30 x i8] c"Ha de ser un numero positiu.\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 60
%14 = load i32, i32* %6
%15 = srem i32 %14, 60
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %15)
br label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17, %11
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str = [39 x i8] c"Introdueix un numero per transformar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"\0ASon %d minuts i %d segons: \00"
@EXIT_SUCCESS = global i32 0
@str = [29 x i8] c"Ha de ser un numero positiu.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = udiv i32 %7, 60
%11 = urem i32 %7, 60
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11)
br label %15
13: ; preds = %2
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}