#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 EXIT_SUCCESS;
int /*<<< orphan*/ GetNextValue(char *, int *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char str[81];
  int next[81];
  strcpy(str, "abab");
  GetNextValue(str, next);
  strcpy(str, "abcabc");
  GetNextValue(str, next);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1040 <GetNextValue@plt>
lea    -0x70(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1040 <GetNextValue@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1a8,%rsp
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0x60(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <GetNextValue@plt>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <GetNextValue@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"abab\00"
@.str.1 = [7 x i8] c"abcabc\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [81 x i8]
%7 = alloca [81 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [81 x i32], [81 x i32]* %7, i64 0, i64 0
%12 = call i32 @GetNextValue(i8* %10, i32* %11)
%13 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [81 x i8], [81 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [81 x i32], [81 x i32]* %7, i64 0, i64 0
%17 = call i32 @GetNextValue(i8* %15, i32* %16)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"abab\00"
@.str.1 = [7 x i8] c"abcabc\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [81 x i8]
%4 = alloca [81 x i32]
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%6 = bitcast [81 x i32]* %4 to i8*
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [81 x i32], [81 x i32]* %4, i64 0, i64 0
%9 = call i32 @GetNextValue(i8* %5, i32* %8)
%10 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @GetNextValue(i8* %5, i32* %8)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}