#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, int);
void backward(int d, int h, int m) {
  int d_h = d / 60;
  int d_m = d % 60;
  h -= d_h;
  m -= d_m;
  if (m < 0) {
    h -= 1;
    m += 60;
  }
  if (h < 0) {
    h += 24;
  }
  printf("%d %d\n", h, m);
}


x86 assembly (clang, -O0):
<backward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116f <backward+0x5f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3c,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1182 <backward+0x72>
mov    -0x8(%rbp),%eax
add    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backward>:
movslq %edi,%r8
imul   $0x77777777,%r8,%rcx
shr    $0x20,%rcx
sub    %r8d,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
sar    $0x5,%ecx
add    %edi,%ecx
imul   $0xffffffff88888889,%r8,%rdi
shr    $0x20,%rdi
add    %r8d,%edi
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0x5,%edi
add    %eax,%edi
imul   $0x3c,%edi,%edi
add    %esi,%ecx
sub    %r8d,%edi
lea    (%rdx,%rdi,1),%eax
add    $0x3c,%eax
add    %edi,%edx
cmovns %edx,%eax
sar    $0x1f,%edx
lea    (%rdx,%rcx,1),%esi
add    $0x18,%esi
add    %edx,%ecx
cmovns %ecx,%esi
lea    0xe95(%rip),%rdi
mov    %eax,%edx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define void @backward(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, -60
%5 = srem i32 %0, 60
%6 = add i32 %4, %1
%7 = sub nsw i32 %2, %5
%8 = icmp slt i32 %7, 0
%9 = add nsw i32 %7, 60
%10 = select i1 %8, i32 %9, i32 %7
%11 = ashr i32 %7, 31
%12 = add nsw i32 %6, %11
%13 = icmp slt i32 %12, 0
%14 = add nsw i32 %12, 24
%15 = select i1 %13, i32 %14, i32 %12
%16 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %10)
ret void
}