#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 Dec2Bcd(char);
int /*<<< orphan*/ I2C1_Start();
int /*<<< orphan*/ I2C1_Stop();
int /*<<< orphan*/ I2C1_Wr(int);
void Write_Time(char sec, char min, char hr, char week_day, char day, char mn,
                char year) {
  I2C1_Start();
  I2C1_Wr(0xD0);
  I2C1_Wr(0);
  I2C1_Wr(Dec2Bcd(sec));
  I2C1_Wr(Dec2Bcd(min));
  I2C1_Wr(Dec2Bcd(hr));
  I2C1_Wr(Dec2Bcd(week_day));
  I2C1_Wr(Dec2Bcd(day));
  I2C1_Wr(Dec2Bcd(mn));
  I2C1_Wr(Dec2Bcd(year));
  I2C1_Stop();
  I2C1_Start();
  I2C1_Wr(0xD0);
  I2C1_Wr(0);
  I2C1_Wr(0);
  I2C1_Stop();
}


x86 assembly (clang, -O0):
<Write_Time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8d,-0x18(%rbp)
mov    %ecx,%eax
mov    -0x18(%rbp),%ecx
mov    %eax,-0x14(%rbp)
mov    %edx,%eax
mov    -0x14(%rbp),%edx
mov    %eax,-0x10(%rbp)
mov    %esi,%eax
mov    -0x10(%rbp),%esi
mov    %eax,-0xc(%rbp)
mov    %edi,%r8d
mov    -0xc(%rbp),%edi
mov    %r9b,%al
mov    0x10(%rbp),%r9b
mov    %r8b,-0x1(%rbp)
mov    %dil,-0x2(%rbp)
mov    %sil,-0x3(%rbp)
mov    %dl,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    $0x0,%al
call   1050 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1040 <I2C1_Wr@plt>
xor    %edi,%edi
call   1040 <I2C1_Wr@plt>
movsbl -0x1(%rbp),%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
movsbl -0x2(%rbp),%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
movsbl -0x3(%rbp),%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
movsbl -0x4(%rbp),%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
movsbl -0x5(%rbp),%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
movsbl -0x6(%rbp),%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
movsbl 0x10(%rbp),%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
mov    $0x0,%al
call   1030 <I2C1_Stop@plt>
mov    $0x0,%al
call   1050 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1040 <I2C1_Wr@plt>
xor    %edi,%edi
call   1040 <I2C1_Wr@plt>
xor    %edi,%edi
call   1040 <I2C1_Wr@plt>
mov    $0x0,%al
call   1030 <I2C1_Stop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write_Time>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r15d
mov    %r8d,%r12d
mov    %ecx,%r13d
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
movsbl 0x40(%rsp),%eax
mov    %eax,0x4(%rsp)
xor    %eax,%eax
call   1050 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1040 <I2C1_Wr@plt>
xor    %edi,%edi
call   1040 <I2C1_Wr@plt>
mov    %r14d,%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
mov    %ebp,%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
mov    %ebx,%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
mov    %r13d,%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
mov    %r12d,%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
mov    %r15d,%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
mov    0x4(%rsp),%edi
call   1060 <Dec2Bcd@plt>
mov    %eax,%edi
call   1040 <I2C1_Wr@plt>
xor    %eax,%eax
call   1030 <I2C1_Stop@plt>
xor    %eax,%eax
call   1050 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1040 <I2C1_Wr@plt>
xor    %edi,%edi
call   1040 <I2C1_Wr@plt>
xor    %edi,%edi
call   1040 <I2C1_Wr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <I2C1_Stop@plt>

LLVM IR (-O0):
define void @Write_Time(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6) {
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
store i8 %0, i8* %8
store i8 %1, i8* %9
store i8 %2, i8* %10
store i8 %3, i8* %11
store i8 %4, i8* %12
store i8 %5, i8* %13
store i8 %6, i8* %14
%15 = call i32 (...) @I2C1_Start()
%16 = call i32 @I2C1_Wr(i32 208)
%17 = call i32 @I2C1_Wr(i32 0)
%18 = load i8, i8* %8
%19 = call i32 @Dec2Bcd(i8 signext %18)
%20 = call i32 @I2C1_Wr(i32 %19)
%21 = load i8, i8* %9
%22 = call i32 @Dec2Bcd(i8 signext %21)
%23 = call i32 @I2C1_Wr(i32 %22)
%24 = load i8, i8* %10
%25 = call i32 @Dec2Bcd(i8 signext %24)
%26 = call i32 @I2C1_Wr(i32 %25)
%27 = load i8, i8* %11
%28 = call i32 @Dec2Bcd(i8 signext %27)
%29 = call i32 @I2C1_Wr(i32 %28)
%30 = load i8, i8* %12
%31 = call i32 @Dec2Bcd(i8 signext %30)
%32 = call i32 @I2C1_Wr(i32 %31)
%33 = load i8, i8* %13
%34 = call i32 @Dec2Bcd(i8 signext %33)
%35 = call i32 @I2C1_Wr(i32 %34)
%36 = load i8, i8* %14
%37 = call i32 @Dec2Bcd(i8 signext %36)
%38 = call i32 @I2C1_Wr(i32 %37)
%39 = call i32 (...) @I2C1_Stop()
%40 = call i32 (...) @I2C1_Start()
%41 = call i32 @I2C1_Wr(i32 208)
%42 = call i32 @I2C1_Wr(i32 0)
%43 = call i32 @I2C1_Wr(i32 0)
%44 = call i32 (...) @I2C1_Stop()
ret void
}

LLVM IR (-O2):
define void @Write_Time(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6) {
%8 = tail call i32 (...) @I2C1_Start()
%9 = tail call i32 @I2C1_Wr(i32 208)
%10 = tail call i32 @I2C1_Wr(i32 0)
%11 = tail call i32 @Dec2Bcd(i8 signext %0)
%12 = tail call i32 @I2C1_Wr(i32 %11)
%13 = tail call i32 @Dec2Bcd(i8 signext %1)
%14 = tail call i32 @I2C1_Wr(i32 %13)
%15 = tail call i32 @Dec2Bcd(i8 signext %2)
%16 = tail call i32 @I2C1_Wr(i32 %15)
%17 = tail call i32 @Dec2Bcd(i8 signext %3)
%18 = tail call i32 @I2C1_Wr(i32 %17)
%19 = tail call i32 @Dec2Bcd(i8 signext %4)
%20 = tail call i32 @I2C1_Wr(i32 %19)
%21 = tail call i32 @Dec2Bcd(i8 signext %5)
%22 = tail call i32 @I2C1_Wr(i32 %21)
%23 = tail call i32 @Dec2Bcd(i8 signext %6)
%24 = tail call i32 @I2C1_Wr(i32 %23)
%25 = tail call i32 (...) @I2C1_Stop()
%26 = tail call i32 (...) @I2C1_Start()
%27 = tail call i32 @I2C1_Wr(i32 208)
%28 = tail call i32 @I2C1_Wr(i32 0)
%29 = tail call i32 @I2C1_Wr(i32 0)
%30 = tail call i32 (...) @I2C1_Stop()
ret void
}