#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 */
char I2C1_Rd(int);
int /*<<< orphan*/ I2C1_Repeated_Start();
int /*<<< orphan*/ I2C1_Start();
int /*<<< orphan*/ I2C1_Stop();
int /*<<< orphan*/ I2C1_Wr(int);
void Read_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_Repeated_Start();
  I2C1_Wr(0xD1);
  *sec = I2C1_Rd(1);
  *min = I2C1_Rd(1);
  *hr = I2C1_Rd(1);
  *week_day = I2C1_Rd(1);
  *day = I2C1_Rd(1);
  *mn = I2C1_Rd(1);
  *year = I2C1_Rd(0);
  I2C1_Stop();
}


x86 assembly (clang, -O0):
<Read_Time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x0,%al
call   1060 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1050 <I2C1_Wr@plt>
xor    %edi,%edi
call   1050 <I2C1_Wr@plt>
mov    $0x0,%al
call   1070 <I2C1_Repeated_Start@plt>
mov    $0xd1,%edi
call   1050 <I2C1_Wr@plt>
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %cl,(%rax)
xor    %edi,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,%cl
mov    0x10(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <I2C1_Stop@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_Time>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x40(%rsp),%rax
mov    %rax,(%rsp)
xor    %eax,%eax
call   1060 <I2C1_Start@plt>
mov    $0xd0,%edi
call   1050 <I2C1_Wr@plt>
xor    %edi,%edi
call   1050 <I2C1_Wr@plt>
xor    %eax,%eax
call   1070 <I2C1_Repeated_Start@plt>
mov    $0xd1,%edi
call   1050 <I2C1_Wr@plt>
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,0x0(%rbp)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,(%rbx)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,0x0(%r13)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,(%r12)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,(%r15)
mov    $0x1,%edi
call   1030 <I2C1_Rd@plt>
mov    %al,(%r14)
xor    %edi,%edi
call   1030 <I2C1_Rd@plt>
mov    (%rsp),%rcx
mov    %al,(%rcx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <I2C1_Stop@plt>

LLVM IR (-O0):
define void @Read_Time(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %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 = call i32 (...) @I2C1_Repeated_Start()
%19 = call i32 @I2C1_Wr(i32 209)
%20 = call signext i8 @I2C1_Rd(i32 1)
%21 = load i8*, i8** %8
store i8 %20, i8* %21
%22 = call signext i8 @I2C1_Rd(i32 1)
%23 = load i8*, i8** %9
store i8 %22, i8* %23
%24 = call signext i8 @I2C1_Rd(i32 1)
%25 = load i8*, i8** %10
store i8 %24, i8* %25
%26 = call signext i8 @I2C1_Rd(i32 1)
%27 = load i8*, i8** %11
store i8 %26, i8* %27
%28 = call signext i8 @I2C1_Rd(i32 1)
%29 = load i8*, i8** %12
store i8 %28, i8* %29
%30 = call signext i8 @I2C1_Rd(i32 1)
%31 = load i8*, i8** %13
store i8 %30, i8* %31
%32 = call signext i8 @I2C1_Rd(i32 0)
%33 = load i8*, i8** %14
store i8 %32, i8* %33
%34 = call i32 (...) @I2C1_Stop()
ret void
}

LLVM IR (-O2):
define void @Read_Time(i8* nocapture writeonly %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3, i8* nocapture writeonly %4, i8* nocapture writeonly %5, i8* nocapture writeonly %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 (...) @I2C1_Repeated_Start()
%12 = tail call i32 @I2C1_Wr(i32 209)
%13 = tail call signext i8 @I2C1_Rd(i32 1)
store i8 %13, i8* %0
%14 = tail call signext i8 @I2C1_Rd(i32 1)
store i8 %14, i8* %1
%15 = tail call signext i8 @I2C1_Rd(i32 1)
store i8 %15, i8* %2
%16 = tail call signext i8 @I2C1_Rd(i32 1)
store i8 %16, i8* %3
%17 = tail call signext i8 @I2C1_Rd(i32 1)
store i8 %17, i8* %4
%18 = tail call signext i8 @I2C1_Rd(i32 1)
store i8 %18, i8* %5
%19 = tail call signext i8 @I2C1_Rd(i32 0)
store i8 %19, i8* %6
%20 = tail call i32 (...) @I2C1_Stop()
ret void
}