#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 sscanf(char *, char *, int *, int *, int *, int *, int *, double *);
int tm_break_fmt_date_c_(char *date, int *year, int *month, int *day, int *hour,
                         int *minute, float *second) {
  int n;
  double dblsec;
  n = sscanf(date, "%d-%d-%d %d:%d:%lf", year, month, day, hour, minute,
             &dblsec);
  if (n == 3) {
    *hour = 0;
    *minute = 0;
    *second = 0.0;
  } else if (n == 4) {
    *minute = 0;
    *second = 0.0;
  } else if (n == 5) {
    *second = 0.0;
  } else if (n == 6) {
    *second = (float)dblsec;
  } else {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<tm_break_fmt_date_c_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x38(%rbp),%r10
lea    0xead(%rip),%rsi
lea    -0x48(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <sscanf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x3,-0x3c(%rbp)
jne    1196 <tm_break_fmt_date_c_+0x86>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
jmp    120f <tm_break_fmt_date_c_+0xff>
cmpl   $0x4,-0x3c(%rbp)
jne    11ba <tm_break_fmt_date_c_+0xaa>
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
jmp    120a <tm_break_fmt_date_c_+0xfa>
cmpl   $0x5,-0x3c(%rbp)
jne    11d4 <tm_break_fmt_date_c_+0xc4>
mov    0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
jmp    1205 <tm_break_fmt_date_c_+0xf5>
cmpl   $0x6,-0x3c(%rbp)
jne    11f4 <tm_break_fmt_date_c_+0xe4>
movsd  -0x48(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,(%rax)
jmp    1200 <tm_break_fmt_date_c_+0xf0>
movl   $0x1,-0x4(%rbp)
jmp    1216 <tm_break_fmt_date_c_+0x106>
jmp    1205 <tm_break_fmt_date_c_+0xf5>
jmp    120a <tm_break_fmt_date_c_+0xfa>
jmp    120f <tm_break_fmt_date_c_+0xff>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_break_fmt_date_c_>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%rbx
mov    %r8,%r14
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rsp,%rax
lea    0xee3(%rip),%rsi
mov    %r14,%r9
push   %rax
push   %rbx
call   1030 <sscanf@plt>
add    $0x10,%rsp
add    $0xfffffffd,%eax
cmp    $0x3,%eax
ja     116a <tm_break_fmt_date_c_+0x5a>
mov    0x20(%rsp),%rcx
xorps  %xmm0,%xmm0
lea    0xeae(%rip),%rdx
movslq (%rdx,%rax,4),%rax
add    %rdx,%rax
jmp    *%rax
movl   $0x0,(%r14)
movl   $0x0,(%rbx)
jmp    117a <tm_break_fmt_date_c_+0x6a>
mov    $0x1,%eax
jmp    1180 <tm_break_fmt_date_c_+0x70>
movsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rcx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%d-%d-%d %d:%d:%lf\00"
define i32 @tm_break_fmt_date_c_(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, float* %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca float*
%16 = alloca i32
%17 = alloca double
store i8* %0, i8** %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store float* %6, float** %15
%18 = load i8*, i8** %9
%19 = load i32*, i32** %10
%20 = load i32*, i32** %11
%21 = load i32*, i32** %12
%22 = load i32*, i32** %13
%23 = load i32*, i32** %14
%24 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %19, i32* %20, i32* %21, i32* %22, i32* %23, double* %17)
store i32 %24, i32* %16
%25 = load i32, i32* %16
%26 = icmp eq i32 %25, 3
br i1 %26, label %27, label %31
27: ; preds = %7
%28 = load i32*, i32** %13
store i32 0, i32* %28
%29 = load i32*, i32** %14
store i32 0, i32* %29
%30 = load float*, float** %15
store float 0.000000e+00, float* %30
br label %53
31: ; preds = %7
%32 = load i32, i32* %16
%33 = icmp eq i32 %32, 4
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32*, i32** %14
store i32 0, i32* %35
%36 = load float*, float** %15
store float 0.000000e+00, float* %36
br label %52
37: ; preds = %31
%38 = load i32, i32* %16
%39 = icmp eq i32 %38, 5
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = load float*, float** %15
store float 0.000000e+00, float* %41
br label %51
42: ; preds = %37
%43 = load i32, i32* %16
%44 = icmp eq i32 %43, 6
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = load double, double* %17
%47 = fptrunc double %46 to float
%48 = load float*, float** %15
store float %47, float* %48
br label %50
49: ; preds = %42
store i32 1, i32* %8
br label %54
50: ; preds = %45
br label %51
51: ; preds = %50, %40
br label %52
52: ; preds = %51, %34
br label %53
53: ; preds = %52, %27
store i32 0, i32* %8
br label %54
54: ; preds = %53, %49
%55 = load i32, i32* %8
ret i32 %55
}

LLVM IR (-O2):
@.str = [19 x i8] c"%d-%d-%d %d:%d:%lf\00"
define i32 @tm_break_fmt_date_c_(i8* nocapture %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, float* nocapture writeonly %6) {
%8 = alloca double
%9 = bitcast double* %8 to i8*
%10 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %8)
switch i32 %10, label %18 [
i32 3, label %11
i32 4, label %12
i32 5, label %16
i32 6, label %13
]
11: ; preds = %7
store i32 0, i32* %4
store i32 0, i32* %5
br label %16
12: ; preds = %7
store i32 0, i32* %5
br label %16
13: ; preds = %7
%14 = load double, double* %8
%15 = fptrunc double %14 to float
br label %16
16: ; preds = %7, %12, %13, %11
%17 = phi float [ 0.000000e+00, %11 ], [ %15, %13 ], [ 0.000000e+00, %12 ], [ 0.000000e+00, %7 ]
store float %17, float* %6
br label %18
18: ; preds = %16, %7
%19 = phi i32 [ 1, %7 ], [ 0, %16 ]
ret i32 %19
}