#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, const char *argv[]) {
  int hour1, minute1;
  int hour2, minute2;
  printf("请输入小时和分钟：");
  scanf("%d %d", &hour1, &minute1);
  printf("请输入第二个小时和分钟：");
  scanf("%d %d", &hour2, &minute2);
  int h = hour2 - hour1;
  int m = minute2 - minute1;
  if (m < 0) {
    m = m + 60;
    h--;
  }
  printf("时间差为：%d小时%d分钟", h, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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    0xed1(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jge    11a8 <main+0x88>
mov    -0x28(%rbp),%eax
add    $0x3c,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
sub    0xc(%rsp),%eax
mov    (%rsp),%ecx
sub    0x8(%rsp),%ecx
lea    0x3c(%rcx),%edx
mov    %ecx,%esi
sar    $0x1f,%esi
add    %eax,%esi
test   %ecx,%ecx
cmovns %ecx,%edx
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\B0\8F\E6\97\B6\E5\92\8C\E5\88\86\E9\92\9F\EF\BC\9A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [37 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E7\AC\AC\E4\BA\8C\E4\B8\AA\E5\B0\8F\E6\97\B6\E5\92\8C\E5\88\86\E9\92\9F\EF\BC\9A\00"
@.str.3 = [32 x i8] c"\E6\97\B6\E9\97\B4\E5\B7\AE\E4\B8\BA\EF\BC\9A%d\E5\B0\8F\E6\97\B6%d\E5\88\86\E9\92\9F\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
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9)
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %10
%19 = load i32, i32* %9
%20 = load i32, i32* %7
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %11
%22 = load i32, i32* %11
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %2
%25 = load i32, i32* %11
%26 = add nsw i32 %25, 60
store i32 %26, i32* %11
%27 = load i32, i32* %10
%28 = add nsw i32 %27, -1
store i32 %28, i32* %10
br label %29
29: ; preds = %24, %2
%30 = load i32, i32* %10
%31 = load i32, i32* %11
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %30, i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E5\B0\8F\E6\97\B6\E5\92\8C\E5\88\86\E9\92\9F\EF\BC\9A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [37 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E7\AC\AC\E4\BA\8C\E4\B8\AA\E5\B0\8F\E6\97\B6\E5\92\8C\E5\88\86\E9\92\9F\EF\BC\9A\00"
@.str.3 = [32 x i8] c"\E6\97\B6\E9\97\B4\E5\B7\AE\E4\B8\BA\EF\BC\9A%d\E5\B0\8F\E6\97\B6%d\E5\88\86\E9\92\9F\00"
define i32 @main(i32 %0, i8** nocapture readnone %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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%17 = sub i32 %15, %16
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = sub nsw i32 %18, %19
%21 = icmp slt i32 %20, 0
%22 = add nsw i32 %20, 60
%23 = ashr i32 %20, 31
%24 = add nsw i32 %17, %23
%25 = select i1 %21, i32 %22, i32 %20
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %24, i32 %25)
ret i32 0
}