#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 subraster_struct {
  int dummy;
};

/* Variables and functions */
int atoi(char *);
char *optarg;
int /*<<< orphan*/ strcat(int /*<<< orphan*/, char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int /*<<< orphan*/ today;
struct subraster_struct *todaysp;
struct subraster_struct *rasttoday(char **expression, int size,
                                   struct subraster_struct *basesp, int arg1,
                                   int arg2, int arg3) {
  char *texsubexpr(), optarg[2050];
  char *timestamp(), *today = optarg;
  struct subraster_struct *rasterize(), *todaysp = NULL;
  int ifmt = 1, tzdelta = 0;
  if (*(*expression) == '[') {
    *expression = texsubexpr(*expression, optarg, 2047, "[", "]", 0, 0);
    if (*optarg != '\000') {
      char *comma = strchr(optarg, ',');
      int iarg, nargs = (comma == NULL ? 1 : 2);
      if (comma != NULL)
        *comma = '\000';
      for (iarg = 1; iarg <= nargs; iarg++) {
        char *arg = (iarg == 1 ? optarg : comma + 1);
        if (((*arg) != '\000' && *("+-") != '\000' &&
             strchr("+-", (*arg)) != (char *)NULL))
          tzdelta = atoi(arg);
        else
          ifmt = atoi(arg);
      }
    }
  }
  strcpy(today, "\\text{");
  strcat(today, timestamp(tzdelta, ifmt));
  strcat(today, "}");
  todaysp = rasterize(today, size);
  return (todaysp);
}


x86 assembly (clang, -O0):
<rasttoday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x880,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    -0x830(%rbp),%rax
mov    %rax,-0x838(%rbp)
movq   $0x0,-0x840(%rbp)
movl   $0x1,-0x844(%rbp)
movl   $0x0,-0x848(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    1346 <rasttoday+0x1d6>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0x830(%rbp),%rsi
mov    $0x7ff,%edx
lea    0xe15(%rip),%rcx
lea    0xe10(%rip),%r8
xor    %r9d,%r9d
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1040 <texsubexpr@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
movsbl -0x830(%rbp),%eax
cmp    $0x0,%eax
je     1341 <rasttoday+0x1d1>
lea    -0x830(%rbp),%rdi
mov    $0x2c,%esi
call   1060 <strchr@plt>
mov    %rax,-0x850(%rbp)
mov    -0x850(%rbp),%rdx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x858(%rbp)
cmpq   $0x0,-0x850(%rbp)
je     126b <rasttoday+0xfb>
mov    -0x850(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x854(%rbp)
mov    -0x854(%rbp),%eax
cmp    -0x858(%rbp),%eax
jg     133c <rasttoday+0x1cc>
cmpl   $0x1,-0x854(%rbp)
jne    12a7 <rasttoday+0x137>
lea    -0x830(%rbp),%rax
mov    %rax,-0x868(%rbp)
jmp    12b9 <rasttoday+0x149>
mov    -0x850(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x868(%rbp)
mov    -0x868(%rbp),%rax
mov    %rax,-0x860(%rbp)
mov    -0x860(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1311 <rasttoday+0x1a1>
mov    -0x860(%rbp),%rax
lea    0xd1c(%rip),%rdi
movsbl (%rax),%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
je     1311 <rasttoday+0x1a1>
mov    -0x860(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x848(%rbp)
jmp    1323 <rasttoday+0x1b3>
mov    -0x860(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x844(%rbp)
jmp    1328 <rasttoday+0x1b8>
mov    -0x854(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x854(%rbp)
jmp    1275 <rasttoday+0x105>
jmp    1341 <rasttoday+0x1d1>
jmp    1346 <rasttoday+0x1d6>
mov    -0x838(%rbp),%rax
mov    %eax,%edi
lea    0xcb1(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x838(%rbp),%rax
mov    %eax,-0x86c(%rbp)
mov    -0x848(%rbp),%edi
mov    -0x844(%rbp),%esi
mov    $0x0,%al
call   1050 <timestamp@plt>
mov    -0x86c(%rbp),%edi
mov    %rax,%rsi
call   1080 <strcat@plt>
mov    -0x838(%rbp),%rax
mov    %eax,%edi
lea    0xc75(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x838(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1090 <rasterize@plt>
mov    %rax,-0x840(%rbp)
mov    -0x840(%rbp),%rax
add    $0x880,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rasttoday>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
mov    %esi,0xc(%rsp)
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%ebp
xor    %r12d,%r12d
cmpb   $0x5b,(%rdi)
jne    126a <rasttoday+0xfa>
movl   $0x0,(%rsp)
lea    0xe56(%rip),%rcx
lea    0xe51(%rip),%r8
xor    %r12d,%r12d
lea    0x10(%rsp),%rsi
mov    $0x7ff,%edx
xor    %r9d,%r9d
xor    %eax,%eax
call   1040 <texsubexpr@plt>
mov    %rax,(%rbx)
cmpb   $0x0,0x10(%rsp)
je     126a <rasttoday+0xfa>
lea    0x10(%rsp),%rdi
mov    $0x2c,%esi
call   1060 <strchr@plt>
mov    %rax,%r14
test   %rax,%rax
je     11f9 <rasttoday+0x89>
movb   $0x0,(%r14)
mov    $0x3,%r13d
jmp    11ff <rasttoday+0x8f>
mov    $0x2,%r13d
add    $0x1,%r14
add    $0xffffffff,%r13d
mov    $0x1,%ebp
xor    %r15d,%r15d
xor    %r12d,%r12d
jmp    1233 <rasttoday+0xc3>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
add    $0x1,%r15d
cmp    %r15d,%r13d
je     126a <rasttoday+0xfa>
test   %r15d,%r15d
mov    %r14,%rbx
lea    0x10(%rsp),%rax
cmove  %rax,%rbx
movzbl (%rbx),%eax
test   %al,%al
je     1220 <rasttoday+0xb0>
movsbl %al,%esi
lea    0xdb1(%rip),%rdi
call   1060 <strchr@plt>
test   %rax,%rax
je     1220 <rasttoday+0xb0>
mov    %rbx,%rdi
call   1070 <atoi@plt>
mov    %eax,%r12d
jmp    122a <rasttoday+0xba>
lea    0x10(%rsp),%rbx
lea    0xd91(%rip),%rsi
mov    %ebx,%edi
call   1030 <strcpy@plt>
mov    %r12d,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <timestamp@plt>
mov    %ebx,%edi
mov    %rax,%rsi
call   1080 <strcat@plt>
lea    0xd74(%rip),%rsi
mov    %ebx,%edi
call   1080 <strcat@plt>
mov    %rbx,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1090 <rasterize@plt>
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.subraster_struct = type { i32 }
@.str = [2 x i8] c"[\00"
@.str.1 = [2 x i8] c"]\00"
@.str.2 = [3 x i8] c"+-\00"
@.str.3 = [7 x i8] c"\\text{\00"
@.str.4 = [2 x i8] c"}\00"
@optarg = global i8* null
@today = global i32 0
@todaysp = global %struct.subraster_struct* null
define %struct.subraster_struct* @rasttoday(i8** %0, i32 %1, %struct.subraster_struct* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8**
%8 = alloca i32
%9 = alloca %struct.subraster_struct*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [2050 x i8]
%14 = alloca i8*
%15 = alloca %struct.subraster_struct*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8*
store i8** %0, i8*** %7
store i32 %1, i32* %8
store %struct.subraster_struct* %2, %struct.subraster_struct** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%22 = getelementptr inbounds [2050 x i8], [2050 x i8]* %13, i64 0, i64 0
store i8* %22, i8** %14
store %struct.subraster_struct* null, %struct.subraster_struct** %15
store i32 1, i32* %16
store i32 0, i32* %17
%23 = load i8**, i8*** %7
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 91
br i1 %27, label %28, label %85
28: ; preds = %6
%29 = load i8**, i8*** %7
%30 = load i8*, i8** %29
%31 = getelementptr inbounds [2050 x i8], [2050 x i8]* %13, i64 0, i64 0
%32 = call i8* (i8*, i8*, i32, i8*, i8*, i32, i32, ...) bitcast (i8* (...)* @texsubexpr to i8* (i8*, i8*, i32, i8*, i8*, i32, i32, ...)*)(i8* %30, i8* %31, i32 2047, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
%33 = load i8**, i8*** %7
store i8* %32, i8** %33
%34 = getelementptr inbounds [2050 x i8], [2050 x i8]* %13, i64 0, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %84
38: ; preds = %28
%39 = getelementptr inbounds [2050 x i8], [2050 x i8]* %13, i64 0, i64 0
%40 = call i8* @strchr(i8* %39, i8 signext 44)
store i8* %40, i8** %18
%41 = load i8*, i8** %18
%42 = icmp eq i8* %41, null
%43 = zext i1 %42 to i64
%44 = select i1 %42, i32 1, i32 2
store i32 %44, i32* %20
%45 = load i8*, i8** %18
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %49
47: ; preds = %38
%48 = load i8*, i8** %18
store i8 0, i8* %48
br label %49
49: ; preds = %47, %38
store i32 1, i32* %19
br label %50
50: ; preds = %80, %49
%51 = load i32, i32* %19
%52 = load i32, i32* %20
%53 = icmp sle i32 %51, %52
br i1 %53, label %54, label %83
54: ; preds = %50
%55 = load i32, i32* %19
%56 = icmp eq i32 %55, 1
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = getelementptr inbounds [2050 x i8], [2050 x i8]* %13, i64 0, i64 0
br label %62
59: ; preds = %54
%60 = load i8*, i8** %18
%61 = getelementptr inbounds i8, i8* %60, i64 1
br label %62
62: ; preds = %59, %57
%63 = phi i8* [ %58, %57 ], [ %61, %59 ]
store i8* %63, i8** %21
%64 = load i8*, i8** %21
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %76
68: ; preds = %62
%69 = load i8*, i8** %21
%70 = load i8, i8* %69
%71 = call i8* @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %70)
%72 = icmp ne i8* %71, null
br i1 %72, label %73, label %76
73: ; preds = %68
%74 = load i8*, i8** %21
%75 = call i32 @atoi(i8* %74)
store i32 %75, i32* %17
br label %79
76: ; preds = %68, %62
%77 = load i8*, i8** %21
%78 = call i32 @atoi(i8* %77)
store i32 %78, i32* %16
br label %79
79: ; preds = %76, %73
br label %80
80: ; preds = %79
%81 = load i32, i32* %19
%82 = add nsw i32 %81, 1
store i32 %82, i32* %19
br label %50
83: ; preds = %50
br label %84
84: ; preds = %83, %28
br label %85
85: ; preds = %84, %6
%86 = load i8*, i8** %14
%87 = ptrtoint i8* %86 to i32
%88 = call i32 @strcpy(i32 %87, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%89 = load i8*, i8** %14
%90 = ptrtoint i8* %89 to i32
%91 = load i32, i32* %17
%92 = load i32, i32* %16
%93 = call i8* (i32, i32, ...) bitcast (i8* (...)* @timestamp to i8* (i32, i32, ...)*)(i32 %91, i32 %92)
%94 = call i32 @strcat(i32 %90, i8* %93)
%95 = load i8*, i8** %14
%96 = ptrtoint i8* %95 to i32
%97 = call i32 @strcat(i32 %96, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%98 = load i8*, i8** %14
%99 = load i32, i32* %8
%100 = call %struct.subraster_struct* (i8*, i32, ...) bitcast (%struct.subraster_struct* (...)* @rasterize to %struct.subraster_struct* (i8*, i32, ...)*)(i8* %98, i32 %99)
store %struct.subraster_struct* %100, %struct.subraster_struct** %15
%101 = load %struct.subraster_struct*, %struct.subraster_struct** %15
ret %struct.subraster_struct* %101
}

LLVM IR (-O2):
%struct.subraster_struct = type { i32 }
@.str = [2 x i8] c"[\00"
@.str.1 = [2 x i8] c"]\00"
@.str.2 = [3 x i8] c"+-\00"
@.str.3 = [7 x i8] c"\\text{\00"
@.str.4 = [2 x i8] c"}\00"
@optarg = global i8* null
@today = global i32 0
@todaysp = global %struct.subraster_struct* null
define %struct.subraster_struct* @rasttoday(i8** nocapture %0, i32 %1, %struct.subraster_struct* nocapture readnone %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [2050 x i8]
%8 = getelementptr inbounds [2050 x i8], [2050 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %0
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 91
br i1 %11, label %12, label %43
12: ; preds = %6
%13 = call i8* (i8*, i8*, i32, i8*, i8*, i32, i32, ...) bitcast (i8* (...)* @texsubexpr to i8* (i8*, i8*, i32, i8*, i8*, i32, i32, ...)*)(i8* %9, i8* %8, i32 2047, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
store i8* %13, i8** %0
%14 = load i8, i8* %8
%15 = icmp eq i8 %14, 0
br i1 %15, label %43, label %16
16: ; preds = %12
%17 = call i8* @strchr(i8* %8, i8 signext 44)
%18 = icmp eq i8* %17, null
br i1 %18, label %20, label %19
19: ; preds = %16
store i8 0, i8* %17
br label %20
20: ; preds = %19, %16
%21 = phi i32 [ 3, %19 ], [ 2, %16 ]
%22 = getelementptr inbounds i8, i8* %17, i64 1
br label %23
23: ; preds = %20, %38
%24 = phi i32 [ 1, %20 ], [ %40, %38 ]
%25 = phi i32 [ 1, %20 ], [ %41, %38 ]
%26 = phi i32 [ 0, %20 ], [ %39, %38 ]
%27 = icmp eq i32 %25, 1
%28 = select i1 %27, i8* %8, i8* %22
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %23
%32 = call i8* @strchr(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %29)
%33 = icmp eq i8* %32, null
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = call i32 @atoi(i8* %28)
br label %38
36: ; preds = %31, %23
%37 = call i32 @atoi(i8* %28)
br label %38
38: ; preds = %36, %34
%39 = phi i32 [ %35, %34 ], [ %26, %36 ]
%40 = phi i32 [ %24, %34 ], [ %37, %36 ]
%41 = add nuw nsw i32 %25, 1
%42 = icmp eq i32 %41, %21
br i1 %42, label %43, label %23
43: ; preds = %38, %12, %6
%44 = phi i32 [ 0, %12 ], [ 0, %6 ], [ %39, %38 ]
%45 = phi i32 [ 1, %12 ], [ 1, %6 ], [ %40, %38 ]
%46 = ptrtoint [2050 x i8]* %7 to i64
%47 = trunc i64 %46 to i32
%48 = call i32 @strcpy(i32 %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%49 = call i8* (i32, i32, ...) bitcast (i8* (...)* @timestamp to i8* (i32, i32, ...)*)(i32 %44, i32 %45)
%50 = call i32 @strcat(i32 %47, i8* %49)
%51 = call i32 @strcat(i32 %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%52 = call %struct.subraster_struct* (i8*, i32, ...) bitcast (%struct.subraster_struct* (...)* @rasterize to %struct.subraster_struct* (i8*, i32, ...)*)(i8* %8, i32 %1)
ret %struct.subraster_struct* %52
}