#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 */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ asctime_r(struct tm *, char *);
void asctime_r_test(struct tm *tm, char *bufSizeUnknown) {
  struct tm tm_uninit_data;
  struct tm *tm_uninit_pointer;
  char bufSize5[5];
  char bufSize25[25];
  char bufSize26[26];
  char bufSize100[100];
  asctime_r(tm, bufSize5);
  asctime_r(tm, bufSize25);
  asctime_r(tm, bufSize26);
  asctime_r(tm, bufSize100);
  asctime_r(&tm_uninit_data, bufSize100);
  asctime_r(tm_uninit_pointer, bufSize100);
  asctime_r(tm, bufSizeUnknown);
}


x86 assembly (clang, -O0):
<asctime_r_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x25(%rbp),%rsi
call   1030 <asctime_r@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <asctime_r@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <asctime_r@plt>
mov    -0x8(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1030 <asctime_r@plt>
lea    -0xd0(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1030 <asctime_r@plt>
mov    -0x20(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1030 <asctime_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <asctime_r@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctime_r_test>:
push   %r15
push   %r14
push   %rbx
sub    $0xc0,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xb(%rsp),%rsi
call   1030 <asctime_r@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <asctime_r@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <asctime_r@plt>
lea    0x50(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <asctime_r@plt>
mov    %rsp,%rdi
mov    %r15,%rsi
call   1030 <asctime_r@plt>
mov    %r15,%rsi
call   1030 <asctime_r@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <asctime_r@plt>
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @asctime_r_test(%struct.tm* %0, i8* %1) {
%3 = alloca %struct.tm*
%4 = alloca i8*
%5 = alloca %struct.tm
%6 = alloca %struct.tm*
%7 = alloca [5 x i8]
%8 = alloca [25 x i8]
%9 = alloca [26 x i8]
%10 = alloca [100 x i8]
store %struct.tm* %0, %struct.tm** %3
store i8* %1, i8** %4
%11 = load %struct.tm*, %struct.tm** %3
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%13 = call i32 @asctime_r(%struct.tm* %11, i8* %12)
%14 = load %struct.tm*, %struct.tm** %3
%15 = getelementptr inbounds [25 x i8], [25 x i8]* %8, i64 0, i64 0
%16 = call i32 @asctime_r(%struct.tm* %14, i8* %15)
%17 = load %struct.tm*, %struct.tm** %3
%18 = getelementptr inbounds [26 x i8], [26 x i8]* %9, i64 0, i64 0
%19 = call i32 @asctime_r(%struct.tm* %17, i8* %18)
%20 = load %struct.tm*, %struct.tm** %3
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%22 = call i32 @asctime_r(%struct.tm* %20, i8* %21)
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%24 = call i32 @asctime_r(%struct.tm* %5, i8* %23)
%25 = load %struct.tm*, %struct.tm** %6
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%27 = call i32 @asctime_r(%struct.tm* %25, i8* %26)
%28 = load %struct.tm*, %struct.tm** %3
%29 = load i8*, i8** %4
%30 = call i32 @asctime_r(%struct.tm* %28, i8* %29)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @asctime_r_test(%struct.tm* %0, i8* %1) {
%3 = alloca %struct.tm
%4 = alloca [5 x i8]
%5 = alloca [25 x i8]
%6 = alloca [26 x i8]
%7 = alloca [100 x i8]
%8 = bitcast %struct.tm* %3 to i8*
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [26 x i8], [26 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%13 = call i32 @asctime_r(%struct.tm* %0, i8* %9)
%14 = call i32 @asctime_r(%struct.tm* %0, i8* %10)
%15 = call i32 @asctime_r(%struct.tm* %0, i8* %11)
%16 = call i32 @asctime_r(%struct.tm* %0, i8* %12)
%17 = call i32 @asctime_r(%struct.tm* %3, i8* %12)
%18 = call i32 @asctime_r(%struct.tm* undef, i8* %12)
%19 = call i32 @asctime_r(%struct.tm* %0, i8* %1)
ret void
}