#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*/ strcpy(char *, char *);
int /*<<< orphan*/ warnx(char *, int);
void remember(int *rememberindex, int *y, int *m, int *d, char **ed, int yy,
              int mm, int dd, char *extra) {
  static int warned = 0;
  if (*rememberindex >= 125 - 1) {
    if (warned == 0)
      warnx("Index > %d, ignored", 125);
    warned++;
    return;
  }
  y[*rememberindex] = yy;
  m[*rememberindex] = mm;
  d[*rememberindex] = dd;
  if (extra != NULL)
    strcpy(ed[*rememberindex], extra);
  else
    ed[*rememberindex][0] = '\0';
  *rememberindex += 1;
}


x86 assembly (clang, -O0):
<remember>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x7c,(%rax)
jl     1189 <remember+0x69>
cmpl   $0x0,0x2ed6(%rip)
jne    1175 <remember+0x55>
lea    0xe95(%rip),%rdi
mov    $0x7d,%esi
call   1040 <warnx@plt>
mov    0x2eb9(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eb0(%rip)
jmp    1201 <remember+0xe1>
mov    -0x2c(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    0x10(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    0x18(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
cmpq   $0x0,0x20(%rbp)
je     11e4 <remember+0xc4>
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x20(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11f6 <remember+0xd6>
mov    -0x28(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remember>:
push   %rbx
mov    %rdi,%rbx
movslq (%rdi),%rdi
cmp    $0x7c,%rdi
jl     1157 <remember+0x37>
mov    0x2f01(%rip),%eax
lea    0x2efa(%rip),%rbx
test   %eax,%eax
jne    1193 <remember+0x73>
lea    0xebb(%rip),%rdi
mov    $0x7d,%esi
call   1040 <warnx@plt>
mov    0x2edf(%rip),%eax
jmp    1193 <remember+0x73>
mov    %rsi,%rax
mov    0x20(%rsp),%rsi
mov    0x18(%rsp),%r10d
mov    0x10(%rsp),%r11d
mov    %r9d,(%rax,%rdi,4)
movslq (%rbx),%rax
mov    %r11d,(%rdx,%rax,4)
movslq (%rbx),%rax
mov    %r10d,(%rcx,%rax,4)
movslq (%rbx),%rax
mov    (%r8,%rax,8),%rdi
test   %rsi,%rsi
je     118e <remember+0x6e>
call   1030 <strcpy@plt>
jmp    1191 <remember+0x71>
movb   $0x0,(%rdi)
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@remember.warned = internal global i32 0
@.str = [20 x i8] c"Index > %d, ignored\00"
define void @remember(i32* %0, i32* %1, i32* %2, i32* %3, i8** %4, i32 %5, i32 %6, i32 %7, i8* %8) {
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i8**
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
store i32* %0, i32** %10
store i32* %1, i32** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i8** %4, i8*** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i8* %8, i8** %18
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = icmp sge i32 %20, 124
br i1 %21, label %22, label %30
22: ; preds = %9
%23 = load i32, i32* @remember.warned
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @warnx(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 125)
br label %27
27: ; preds = %25, %22
%28 = load i32, i32* @remember.warned
%29 = add nsw i32 %28, 1
store i32 %29, i32* @remember.warned
br label %72
30: ; preds = %9
%31 = load i32, i32* %15
%32 = load i32*, i32** %11
%33 = load i32*, i32** %10
%34 = load i32, i32* %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %32, i64 %35
store i32 %31, i32* %36
%37 = load i32, i32* %16
%38 = load i32*, i32** %12
%39 = load i32*, i32** %10
%40 = load i32, i32* %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %38, i64 %41
store i32 %37, i32* %42
%43 = load i32, i32* %17
%44 = load i32*, i32** %13
%45 = load i32*, i32** %10
%46 = load i32, i32* %45
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %44, i64 %47
store i32 %43, i32* %48
%49 = load i8*, i8** %18
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %60
51: ; preds = %30
%52 = load i8**, i8*** %14
%53 = load i32*, i32** %10
%54 = load i32, i32* %53
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %52, i64 %55
%57 = load i8*, i8** %56
%58 = load i8*, i8** %18
%59 = call i32 @strcpy(i8* %57, i8* %58)
br label %68
60: ; preds = %30
%61 = load i8**, i8*** %14
%62 = load i32*, i32** %10
%63 = load i32, i32* %62
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %61, i64 %64
%66 = load i8*, i8** %65
%67 = getelementptr inbounds i8, i8* %66, i64 0
store i8 0, i8* %67
br label %68
68: ; preds = %60, %51
%69 = load i32*, i32** %10
%70 = load i32, i32* %69
%71 = add nsw i32 %70, 1
store i32 %71, i32* %69
br label %72
72: ; preds = %68, %27
ret void
}

LLVM IR (-O2):
@remember.warned = internal unnamed_addr global i32 0
@.str = [20 x i8] c"Index > %d, ignored\00"
define void @remember(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i8** nocapture %4, i32 %5, i32 %6, i32 %7, i8* %8) {
%10 = load i32, i32* %0
%11 = icmp sgt i32 %10, 123
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* @remember.warned
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %37
15: ; preds = %12
%16 = tail call i32 @warnx(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 125)
%17 = load i32, i32* @remember.warned
br label %37
18: ; preds = %9
%19 = sext i32 %10 to i64
%20 = getelementptr inbounds i32, i32* %1, i64 %19
store i32 %5, i32* %20
%21 = load i32, i32* %0
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %2, i64 %22
store i32 %6, i32* %23
%24 = load i32, i32* %0
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %3, i64 %25
store i32 %7, i32* %26
%27 = icmp eq i8* %8, null
%28 = load i32, i32* %0
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %4, i64 %29
%31 = load i8*, i8** %30
br i1 %27, label %34, label %32
32: ; preds = %18
%33 = tail call i32 @strcpy(i8* %31, i8* %8)
br label %35
34: ; preds = %18
store i8 0, i8* %31
br label %35
35: ; preds = %34, %32
%36 = load i32, i32* %0
br label %37
37: ; preds = %12, %15, %35
%38 = phi i32 [ %36, %35 ], [ %17, %15 ], [ %13, %12 ]
%39 = phi i32* [ %0, %35 ], [ @remember.warned, %15 ], [ @remember.warned, %12 ]
%40 = add nsw i32 %38, 1
store i32 %40, i32* %39
ret void
}