#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*/ led_clear();
int /*<<< orphan*/ led_set_code(int, int);
int /*<<< orphan*/ led_set_dp(int);
int timer_get_min(unsigned char);
int timer_get_ms10(unsigned char);
int timer_get_sec(unsigned char);
void display_slot(unsigned char slot) {
  led_clear();
  led_set_dp(1);
  led_set_dp(2);
  led_set_dp(3);
  led_set_dp(4);
  led_set_code(5, (timer_get_min(slot) % 10) + 0x30);
  led_set_code(4, (timer_get_min(slot) % 10) + 0x30);
  led_set_code(3, (timer_get_sec(slot) / 10) + 0x30);
  led_set_code(2, (timer_get_sec(slot) % 10) + 0x30);
  led_set_code(1, (timer_get_ms10(slot) / 10) + 0x30);
  led_set_code(0, (timer_get_ms10(slot) % 10) + 0x30);
}


x86 assembly (clang, -O0):
<display_slot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1060 <led_clear@plt>
mov    $0x1,%edi
call   1030 <led_set_dp@plt>
mov    $0x2,%edi
call   1030 <led_set_dp@plt>
mov    $0x3,%edi
call   1030 <led_set_dp@plt>
mov    $0x4,%edi
call   1030 <led_set_dp@plt>
movzbl -0x1(%rbp),%edi
call   1070 <timer_get_min@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x30,%esi
mov    $0x5,%edi
call   1080 <led_set_code@plt>
movzbl -0x1(%rbp),%edi
call   1070 <timer_get_min@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x30,%esi
mov    $0x4,%edi
call   1080 <led_set_code@plt>
movzbl -0x1(%rbp),%edi
call   1040 <timer_get_sec@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x30,%esi
mov    $0x3,%edi
call   1080 <led_set_code@plt>
movzbl -0x1(%rbp),%edi
call   1040 <timer_get_sec@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x30,%esi
mov    $0x2,%edi
call   1080 <led_set_code@plt>
movzbl -0x1(%rbp),%edi
call   1050 <timer_get_ms10@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x30,%esi
mov    $0x1,%edi
call   1080 <led_set_code@plt>
movzbl -0x1(%rbp),%edi
call   1050 <timer_get_ms10@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x30,%esi
xor    %edi,%edi
call   1080 <led_set_code@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_slot>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <led_clear@plt>
mov    $0x1,%edi
call   1030 <led_set_dp@plt>
mov    $0x2,%edi
call   1030 <led_set_dp@plt>
mov    $0x3,%edi
call   1030 <led_set_dp@plt>
mov    $0x4,%edi
call   1030 <led_set_dp@plt>
mov    %ebx,%edi
call   1070 <timer_get_min@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x30,%esi
mov    $0x5,%edi
call   1080 <led_set_code@plt>
mov    %ebx,%edi
call   1070 <timer_get_min@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x30,%esi
mov    $0x4,%edi
call   1080 <led_set_code@plt>
mov    %ebx,%edi
call   1040 <timer_get_sec@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x22,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%esi
add    $0x30,%esi
mov    $0x3,%edi
call   1080 <led_set_code@plt>
mov    %ebx,%edi
call   1040 <timer_get_sec@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x30,%esi
mov    $0x2,%edi
call   1080 <led_set_code@plt>
mov    %ebx,%edi
call   1050 <timer_get_ms10@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x22,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%esi
add    $0x30,%esi
mov    $0x1,%edi
call   1080 <led_set_code@plt>
mov    %ebx,%edi
call   1050 <timer_get_ms10@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x30,%esi
xor    %edi,%edi
pop    %rbx
jmp    1080 <led_set_code@plt>

LLVM IR (-O0):
define void @display_slot(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @led_clear()
%4 = call i32 @led_set_dp(i32 1)
%5 = call i32 @led_set_dp(i32 2)
%6 = call i32 @led_set_dp(i32 3)
%7 = call i32 @led_set_dp(i32 4)
%8 = load i8, i8* %2
%9 = call i32 @timer_get_min(i8 zeroext %8)
%10 = srem i32 %9, 10
%11 = add nsw i32 %10, 48
%12 = call i32 @led_set_code(i32 5, i32 %11)
%13 = load i8, i8* %2
%14 = call i32 @timer_get_min(i8 zeroext %13)
%15 = srem i32 %14, 10
%16 = add nsw i32 %15, 48
%17 = call i32 @led_set_code(i32 4, i32 %16)
%18 = load i8, i8* %2
%19 = call i32 @timer_get_sec(i8 zeroext %18)
%20 = sdiv i32 %19, 10
%21 = add nsw i32 %20, 48
%22 = call i32 @led_set_code(i32 3, i32 %21)
%23 = load i8, i8* %2
%24 = call i32 @timer_get_sec(i8 zeroext %23)
%25 = srem i32 %24, 10
%26 = add nsw i32 %25, 48
%27 = call i32 @led_set_code(i32 2, i32 %26)
%28 = load i8, i8* %2
%29 = call i32 @timer_get_ms10(i8 zeroext %28)
%30 = sdiv i32 %29, 10
%31 = add nsw i32 %30, 48
%32 = call i32 @led_set_code(i32 1, i32 %31)
%33 = load i8, i8* %2
%34 = call i32 @timer_get_ms10(i8 zeroext %33)
%35 = srem i32 %34, 10
%36 = add nsw i32 %35, 48
%37 = call i32 @led_set_code(i32 0, i32 %36)
ret void
}

LLVM IR (-O2):
define void @display_slot(i8 zeroext %0) {
%2 = tail call i32 (...) @led_clear()
%3 = tail call i32 @led_set_dp(i32 1)
%4 = tail call i32 @led_set_dp(i32 2)
%5 = tail call i32 @led_set_dp(i32 3)
%6 = tail call i32 @led_set_dp(i32 4)
%7 = tail call i32 @timer_get_min(i8 zeroext %0)
%8 = srem i32 %7, 10
%9 = add nsw i32 %8, 48
%10 = tail call i32 @led_set_code(i32 5, i32 %9)
%11 = tail call i32 @timer_get_min(i8 zeroext %0)
%12 = srem i32 %11, 10
%13 = add nsw i32 %12, 48
%14 = tail call i32 @led_set_code(i32 4, i32 %13)
%15 = tail call i32 @timer_get_sec(i8 zeroext %0)
%16 = sdiv i32 %15, 10
%17 = add nsw i32 %16, 48
%18 = tail call i32 @led_set_code(i32 3, i32 %17)
%19 = tail call i32 @timer_get_sec(i8 zeroext %0)
%20 = srem i32 %19, 10
%21 = add nsw i32 %20, 48
%22 = tail call i32 @led_set_code(i32 2, i32 %21)
%23 = tail call i32 @timer_get_ms10(i8 zeroext %0)
%24 = sdiv i32 %23, 10
%25 = add nsw i32 %24, 48
%26 = tail call i32 @led_set_code(i32 1, i32 %25)
%27 = tail call i32 @timer_get_ms10(i8 zeroext %0)
%28 = srem i32 %27, 10
%29 = add nsw i32 %28, 48
%30 = tail call i32 @led_set_code(i32 0, i32 %29)
ret void
}