#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ getisotime(int, char, char, char, char, char, char);
time_t isodate_915(char *p, int hs) {
  return getisotime(1900 + p[0], p[1], p[2], p[3], p[4], p[5],
                    hs == 0 ? p[6] : 0);
}


x86 assembly (clang, -O0):
<isodate_915>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x76c,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0xf(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%al
mov    %al,-0xd(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    117a <isodate_915+0x6a>
mov    -0x8(%rbp),%rax
movsbl 0x6(%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1184 <isodate_915+0x74>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1184 <isodate_915+0x74>
mov    -0xd(%rbp),%r9b
mov    -0xe(%rbp),%r8b
mov    -0xf(%rbp),%cl
mov    -0x10(%rbp),%dl
mov    -0x11(%rbp),%sil
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%eax
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %al,%eax
mov    %eax,(%rsp)
call   1030 <getisotime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isodate_915>:
push   %rax
mov    %rdi,%rax
movsbl (%rdi),%edi
mov    0x1(%rax),%cl
mov    0x2(%rax),%dl
mov    0x3(%rax),%r8b
mov    0x4(%rax),%r9b
mov    0x5(%rax),%r10b
test   %esi,%esi
je     1131 <isodate_915+0x21>
xor    %eax,%eax
jmp    1134 <isodate_915+0x24>
mov    0x6(%rax),%al
add    $0x76c,%edi
movsbl %al,%eax
mov    %eax,(%rsp)
movsbl %cl,%esi
movsbl %dl,%edx
movsbl %r8b,%ecx
movsbl %r9b,%r8d
movsbl %r10b,%r9d
call   1030 <getisotime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isodate_915(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = add nsw i32 1900, %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 3
%18 = load i8, i8* %17
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 4
%21 = load i8, i8* %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 5
%24 = load i8, i8* %23
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %2
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 6
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
br label %33
32: ; preds = %2
br label %33
33: ; preds = %32, %27
%34 = phi i32 [ %31, %27 ], [ 0, %32 ]
%35 = trunc i32 %34 to i8
%36 = call i32 @getisotime(i32 %9, i8 signext %12, i8 signext %15, i8 signext %18, i8 signext %21, i8 signext %24, i8 signext %35)
ret i32 %36
}

LLVM IR (-O2):
define i32 @isodate_915(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 3
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 4
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 5
%13 = load i8, i8* %12
%14 = icmp eq i32 %1, 0
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = getelementptr inbounds i8, i8* %0, i64 6
%17 = load i8, i8* %16
br label %18
18: ; preds = %2, %15
%19 = phi i8 [ %17, %15 ], [ 0, %2 ]
%20 = sext i8 %3 to i32
%21 = add nsw i32 %20, 1900
%22 = tail call i32 @getisotime(i32 %21, i8 signext %5, i8 signext %7, i8 signext %9, i8 signext %11, i8 signext %13, i8 signext %19)
ret i32 %22
}