void Calc_Time(int *Days, int *Hrs, int *Mins, int Elapsed_Mins) {
  Elapsed_Mins += *Mins + (*Hrs * 60);
  *Mins = Elapsed_Mins % 60;
  *Hrs = (Elapsed_Mins % (24 * 60)) / 60;
  *Days = Elapsed_Mins / (24 * 60);
  if ((*Mins > 0) && (*Mins < 29))
    *Mins = 30;
  else if (*Mins > 30) {
    *Mins = 0;
    *Hrs += 1;
    if (*Hrs >= 24) {
      *Hrs = 0;
      *Days += 1;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<Calc_Time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   $0x3c,(%rcx),%ecx
add    %ecx,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
mov    -0x1c(%rbp),%eax
mov    $0x5a0,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
mov    $0x5a0,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1192 <Calc_Time+0x92>
mov    -0x18(%rbp),%rax
cmpl   $0x1d,(%rax)
jge    1192 <Calc_Time+0x92>
mov    -0x18(%rbp),%rax
movl   $0x1e,(%rax)
jmp    11e0 <Calc_Time+0xe0>
mov    -0x18(%rbp),%rax
cmpl   $0x1e,(%rax)
jle    11db <Calc_Time+0xdb>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x18,(%rax)
jl     11d6 <Calc_Time+0xd6>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    11db <Calc_Time+0xdb>
jmp    11e0 <Calc_Time+0xe0>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calc_Time>:
imul   $0x3c,(%rsi),%eax
add    (%rdx),%ecx
add    %eax,%ecx
movslq %ecx,%r9
imul   $0xffffffff88888889,%r9,%rcx
shr    $0x20,%rcx
add    %r9d,%ecx
mov    %ecx,%r8d
shr    $0x1f,%r8d
sar    $0x5,%ecx
add    %r8d,%ecx
imul   $0x3c,%ecx,%r8d
mov    %r9d,%ecx
sub    %r8d,%ecx
mov    %ecx,(%rdx)
imul   $0xffffffffb60b60b7,%r9,%rcx
shr    $0x20,%rcx
add    %r9d,%ecx
mov    %ecx,%r8d
shr    $0x1f,%r8d
sar    $0xa,%ecx
add    %r8d,%ecx
imul   $0x5a0,%ecx,%eax
sub    %eax,%r9d
movswl %r9w,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %r9d,%eax
movzwl %ax,%r8d
movswl %r8w,%eax
shr    $0xf,%r8d
sar    $0x5,%eax
add    %r8d,%eax
cwtl
mov    %eax,(%rsi)
mov    %ecx,(%rdi)
mov    (%rdx),%eax
lea    -0x1(%rax),%ecx
cmp    $0x1b,%ecx
ja     118d <Calc_Time+0x8d>
movl   $0x1e,(%rdx)
ret
cmp    $0x1f,%eax
jl     11ad <Calc_Time+0xad>
movl   $0x0,(%rdx)
mov    (%rsi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
cmp    $0x17,%eax
jl     11ad <Calc_Time+0xad>
movl   $0x0,(%rsi)
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @Calc_Time(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %7
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = mul nsw i32 %12, 60
%14 = add nsw i32 %10, %13
%15 = load i32, i32* %8
%16 = add nsw i32 %15, %14
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = srem i32 %17, 60
%19 = load i32*, i32** %7
store i32 %18, i32* %19
%20 = load i32, i32* %8
%21 = srem i32 %20, 1440
%22 = sdiv i32 %21, 60
%23 = load i32*, i32** %6
store i32 %22, i32* %23
%24 = load i32, i32* %8
%25 = sdiv i32 %24, 1440
%26 = load i32*, i32** %5
store i32 %25, i32* %26
%27 = load i32*, i32** %7
%28 = load i32, i32* %27
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %36
30: ; preds = %4
%31 = load i32*, i32** %7
%32 = load i32, i32* %31
%33 = icmp slt i32 %32, 29
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = load i32*, i32** %7
store i32 30, i32* %35
br label %55
36: ; preds = %30, %4
%37 = load i32*, i32** %7
%38 = load i32, i32* %37
%39 = icmp sgt i32 %38, 30
br i1 %39, label %40, label %54
40: ; preds = %36
%41 = load i32*, i32** %7
store i32 0, i32* %41
%42 = load i32*, i32** %6
%43 = load i32, i32* %42
%44 = add nsw i32 %43, 1
store i32 %44, i32* %42
%45 = load i32*, i32** %6
%46 = load i32, i32* %45
%47 = icmp sge i32 %46, 24
br i1 %47, label %48, label %53
48: ; preds = %40
%49 = load i32*, i32** %6
store i32 0, i32* %49
%50 = load i32*, i32** %5
%51 = load i32, i32* %50
%52 = add nsw i32 %51, 1
store i32 %52, i32* %50
br label %53
53: ; preds = %48, %40
br label %54
54: ; preds = %53, %36
br label %55
55: ; preds = %54, %34
ret void
}

LLVM IR (-O2):
define void @Calc_Time(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3) {
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = mul nsw i32 %6, 60
%8 = add i32 %5, %3
%9 = add i32 %8, %7
%10 = srem i32 %9, 60
store i32 %10, i32* %2
%11 = srem i32 %9, 1440
%12 = trunc i32 %11 to i16
%13 = sdiv i16 %12, 60
%14 = sext i16 %13 to i32
store i32 %14, i32* %1
%15 = sdiv i32 %9, 1440
store i32 %15, i32* %0
%16 = load i32, i32* %2
%17 = add i32 %16, -1
%18 = icmp ult i32 %17, 28
br i1 %18, label %19, label %20
19: ; preds = %4
store i32 30, i32* %2
br label %29
20: ; preds = %4
%21 = icmp sgt i32 %16, 30
br i1 %21, label %22, label %29
22: ; preds = %20
store i32 0, i32* %2
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 1
store i32 %24, i32* %1
%25 = icmp sgt i32 %23, 22
br i1 %25, label %26, label %29
26: ; preds = %22
store i32 0, i32* %1
%27 = load i32, i32* %0
%28 = add nsw i32 %27, 1
store i32 %28, i32* %0
br label %29
29: ; preds = %20, %26, %22, %19
ret void
}