#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 scanf(char *, ...);
int leggiOra(int *minuti) {
  int h, m, ret;
  ret = scanf("%d.%d", &h, &m);
  if (ret != 2) {
    scanf("%*s");
    return 0;
  }
  if (h <= 24 && h >= 0 && m < 60 && m >= 0) {
    *minuti = (h * 60 + m) % 1440;
    return 1;
  } else
    return 0;
  ;
}


x86 assembly (clang, -O0):
<leggiOra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <scanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
je     1159 <leggiOra+0x49>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a9 <leggiOra+0x99>
cmpl   $0x18,-0x14(%rbp)
jg     11a2 <leggiOra+0x92>
cmpl   $0x0,-0x14(%rbp)
jl     11a2 <leggiOra+0x92>
cmpl   $0x3c,-0x18(%rbp)
jge    11a2 <leggiOra+0x92>
cmpl   $0x0,-0x18(%rbp)
jl     11a2 <leggiOra+0x92>
imul   $0x3c,-0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x5a0,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11a9 <leggiOra+0x99>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leggiOra>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xee2(%rip),%rdi
xor    %ebx,%ebx
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <scanf@plt>
cmp    $0x2,%eax
jne    116f <leggiOra+0x5f>
mov    0x4(%rsp),%eax
cmp    $0x18,%eax
ja     117d <leggiOra+0x6d>
mov    (%rsp),%ecx
cmp    $0x3b,%ecx
jg     117d <leggiOra+0x6d>
test   %ecx,%ecx
js     117d <leggiOra+0x6d>
imul   $0x3c,%eax,%eax
add    %ecx,%eax
movzwl %ax,%ecx
imul   $0x2d83,%ecx,%ecx
shr    $0x18,%ecx
imul   $0x5a0,%ecx,%ecx
sub    %ecx,%eax
movzwl %ax,%eax
mov    %eax,(%r14)
mov    $0x1,%ebx
jmp    117d <leggiOra+0x6d>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d.%d\00"
@.str.1 = [4 x i8] c"%*s\00"
define i32 @leggiOra(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %32
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp sle i32 %13, 24
br i1 %14, label %15, label %31
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %31
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp slt i32 %19, 60
br i1 %20, label %21, label %31
21: ; preds = %18
%22 = load i32, i32* %5
%23 = icmp sge i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = load i32, i32* %4
%26 = mul nsw i32 %25, 60
%27 = load i32, i32* %5
%28 = add nsw i32 %26, %27
%29 = srem i32 %28, 1440
%30 = load i32*, i32** %3
store i32 %29, i32* %30
store i32 1, i32* %2
br label %32
31: ; preds = %21, %18, %15, %12
store i32 0, i32* %2
br label %32
32: ; preds = %31, %24, %10
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d.%d\00"
@.str.1 = [4 x i8] c"%*s\00"
define i32 @leggiOra(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = icmp eq i32 %6, 2
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %24
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp ult i32 %11, 25
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 60
%15 = select i1 %12, i1 %14, i1 false
%16 = icmp sgt i32 %13, -1
%17 = select i1 %15, i1 %16, i1 false
br i1 %17, label %18, label %24
18: ; preds = %10
%19 = mul nuw nsw i32 %11, 60
%20 = add nuw nsw i32 %19, %13
%21 = trunc i32 %20 to i16
%22 = urem i16 %21, 1440
%23 = zext i16 %22 to i32
store i32 %23, i32* %0
br label %24
24: ; preds = %10, %18, %8
%25 = phi i32 [ 0, %8 ], [ 1, %18 ], [ 0, %10 ]
ret i32 %25
}