#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*/ sprintf(char *, char *, int, int, int, int, int, int);
char *SMB_DOSTimToStr(int DOS_time) {
  static char SMB_Time_Temp[48];
  int DOS_sec, DOS_min, DOS_hour, DOS_day, DOS_month, DOS_year;
  SMB_Time_Temp[0] = 0;
  DOS_sec = (DOS_time & 0x001F) * 2;
  DOS_min = (DOS_time & 0x07E0) >> 5;
  DOS_hour = ((DOS_time & 0xF800) >> 11);
  DOS_day = (DOS_time & 0x001F0000) >> 16;
  DOS_month = (DOS_time & 0x01E00000) >> 21;
  DOS_year = ((DOS_time & 0xFE000000) >> 25) + 80;
  sprintf(SMB_Time_Temp, "%2d/%02d/%2d %2d:%02d:%02d", DOS_day, DOS_month,
          DOS_year, DOS_hour, DOS_min, DOS_sec);
  return (SMB_Time_Temp);
}


x86 assembly (clang, -O0):
<SMB_DOSTimToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,0x2f1e(%rip)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7e0,%eax
sar    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf800,%eax
sar    $0xb,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f0000,%eax
sar    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1e00000,%eax
sar    $0x15,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfe000000,%eax
shr    $0x19,%eax
add    $0x50,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0xc(%rbp),%r10d
mov    -0x8(%rbp),%eax
lea    0x2ead(%rip),%rdi
lea    0xe66(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <sprintf@plt>
lea    0x2e92(%rip),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SMB_DOSTimToStr>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x2f25(%rip)
lea    0x2f1e(%rip),%r14
lea    (%rdi,%rdi,1),%eax
and    $0x3e,%eax
mov    %edi,%ebx
shr    $0x5,%ebx
and    $0x3f,%ebx
mov    %edi,%r9d
shr    $0xb,%r9d
and    $0x1f,%r9d
mov    %edi,%edx
shr    $0x10,%edx
and    $0x1f,%edx
mov    %edi,%ecx
shr    $0x15,%ecx
and    $0xf,%ecx
shr    $0x19,%edi
lea    0x50(%rdi),%r8d
lea    0xea7(%rip),%rsi
mov    %r14,%rdi
push   %rax
push   %rbx
call   1030 <sprintf@plt>
add    $0x10,%rsp
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SMB_DOSTimToStr.SMB_Time_Temp = internal global [48 x i8] zeroinitializer
@.str = [27 x i8] c"%2d/%02d/%2d %2d:%02d:%02d\00"
define i8* @SMB_DOSTimToStr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
store i8 0, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @SMB_DOSTimToStr.SMB_Time_Temp, i64 0, i64 0)
%9 = load i32, i32* %2
%10 = and i32 %9, 31
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = and i32 %12, 2016
%14 = ashr i32 %13, 5
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = and i32 %15, 63488
%17 = ashr i32 %16, 11
store i32 %17, i32* %5
%18 = load i32, i32* %2
%19 = and i32 %18, 2031616
%20 = ashr i32 %19, 16
store i32 %20, i32* %6
%21 = load i32, i32* %2
%22 = and i32 %21, 31457280
%23 = ashr i32 %22, 21
store i32 %23, i32* %7
%24 = load i32, i32* %2
%25 = and i32 %24, -33554432
%26 = lshr i32 %25, 25
%27 = add i32 %26, 80
store i32 %27, i32* %8
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = load i32, i32* %8
%31 = load i32, i32* %5
%32 = load i32, i32* %4
%33 = load i32, i32* %3
%34 = call i32 @sprintf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @SMB_DOSTimToStr.SMB_Time_Temp, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33)
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @SMB_DOSTimToStr.SMB_Time_Temp, i64 0, i64 0)
}

LLVM IR (-O2):
@SMB_DOSTimToStr.SMB_Time_Temp = internal global [48 x i8] zeroinitializer
@.str = [27 x i8] c"%2d/%02d/%2d %2d:%02d:%02d\00"
define i8* @SMB_DOSTimToStr(i32 %0) {
store i8 0, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @SMB_DOSTimToStr.SMB_Time_Temp, i64 0, i64 0)
%2 = shl i32 %0, 1
%3 = and i32 %2, 62
%4 = lshr i32 %0, 5
%5 = and i32 %4, 63
%6 = lshr i32 %0, 11
%7 = and i32 %6, 31
%8 = lshr i32 %0, 16
%9 = and i32 %8, 31
%10 = lshr i32 %0, 21
%11 = and i32 %10, 15
%12 = lshr i32 %0, 25
%13 = add nuw nsw i32 %12, 80
%14 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @SMB_DOSTimToStr.SMB_Time_Temp, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13, i32 %7, i32 %5, i32 %3)
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @SMB_DOSTimToStr.SMB_Time_Temp, i64 0, i64 0)
}