#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 */
struct timespec {
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ lcd_goto(int, int /*<<< orphan*/);
int /*<<< orphan*/ lcd_write(char *, int, int);
int rel_time_min;
void actuator_lcd_new_time_hook(struct timespec abs_time,
                                struct timespec rel_time) {
  int tot_time_sec = abs_time.tv_sec;
  int tot_time_min = tot_time_sec / 60;
  tot_time_sec = (tot_time_sec % 60);
  int rel_time_sec = rel_time.tv_sec;
  int rel_time_min = rel_time_min = rel_time_sec / 60;
  rel_time_sec = (rel_time_sec % 60);
  lcd_goto(0, 0);
  lcd_write("%02d:%02d", tot_time_min, tot_time_sec);
  lcd_goto(1, 0);
  lcd_write("%02d:%02d", rel_time_min, rel_time_sec);
}


x86 assembly (clang, -O0):
<actuator_lcd_new_time_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <lcd_goto@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe75(%rip),%rdi
call   1030 <lcd_write@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <lcd_goto@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe57(%rip),%rdi
call   1030 <lcd_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<actuator_lcd_new_time_hook>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
movslq %edi,%r14
imul   $0xffffffff88888889,%r14,%r12
shr    $0x20,%r12
add    %r14d,%r12d
mov    %r12d,%eax
shr    $0x1f,%eax
sar    $0x5,%r12d
add    %eax,%r12d
imul   $0x3c,%r12d,%eax
sub    %eax,%r14d
movslq %esi,%r15
imul   $0xffffffff88888889,%r15,%rbx
shr    $0x20,%rbx
add    %r15d,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x5,%ebx
add    %eax,%ebx
imul   $0x3c,%ebx,%eax
sub    %eax,%r15d
xor    %edi,%edi
xor    %esi,%esi
call   1040 <lcd_goto@plt>
lea    0xe81(%rip),%r13
mov    %r13,%rdi
mov    %r12d,%esi
mov    %r14d,%edx
call   1030 <lcd_write@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <lcd_goto@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <lcd_write@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [10 x i8] c"%02d:%02d\00"
@rel_time_min = global i32 0
define void @actuator_lcd_new_time_hook(i32 %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %0, i32* %9
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 %1, i32* %10
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = sdiv i32 %13, 60
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = srem i32 %15, 60
store i32 %16, i32* %5
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%18 = load i32, i32* %17
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = sdiv i32 %19, 60
store i32 %20, i32* %8
store i32 %20, i32* %8
%21 = load i32, i32* %7
%22 = srem i32 %21, 60
store i32 %22, i32* %7
%23 = call i32 @lcd_goto(i32 0, i32 0)
%24 = load i32, i32* %6
%25 = load i32, i32* %5
%26 = call i32 @lcd_write(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25)
%27 = call i32 @lcd_goto(i32 1, i32 0)
%28 = load i32, i32* %8
%29 = load i32, i32* %7
%30 = call i32 @lcd_write(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %28, i32 %29)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%02d:%02d\00"
@rel_time_min = global i32 0
define void @actuator_lcd_new_time_hook(i32 %0, i32 %1) {
%3 = sdiv i32 %0, 60
%4 = srem i32 %0, 60
%5 = sdiv i32 %1, 60
%6 = srem i32 %1, 60
%7 = tail call i32 @lcd_goto(i32 0, i32 0)
%8 = tail call i32 @lcd_write(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%9 = tail call i32 @lcd_goto(i32 1, i32 0)
%10 = tail call i32 @lcd_write(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}