#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*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
size_t strlen(char *);
void _spew_one(int linenum) {
  char buf[80];
  linenum %= strlen("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345"
                    "6789!@#$%^&*()-_=+[]");
  memcpy(buf,
         "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&"
         "*()-_=+[]" +
             linenum,
         strlen("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
                "!@#$%^&*()-_=+[]") -
             linenum);
  memcpy(buf +
             strlen("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345"
                    "6789!@#$%^&*()-_=+[]") -
             linenum,
         "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&"
         "*()-_=+[]",
         linenum);
  buf[strlen("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#"
             "$%^&*()-_=+[]")] = '\0';
  printf("%s\n", buf);
}


x86 assembly (clang, -O0):
<_spew_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x4(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x78(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xe92(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
lea    0xe84(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x78(%rbp),%rdi
mov    -0x70(%rbp),%rsi
movslq -0x4(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    0xe5a(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x68(%rbp),%rdi
add    %rax,%rdi
movslq -0x4(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x4(%rbp),%edx
lea    0xe38(%rip),%rsi
call   1050 <memcpy@plt>
lea    0xe2c(%rip),%rdi
call   1030 <strlen@plt>
movb   $0x0,-0x60(%rbp,%rax,1)
lea    -0x60(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_spew_one>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movslq %edi,%rbx
mov    %rbx,%rax
shr    %rax
movabs $0x6906906906906907,%rcx
90 06 69
mul    %rcx
shr    $0x4,%rdx
imul   $0x4e,%rdx,%rax
sub    %rax,%rbx
lea    0xeaf(%rip),%r14
lea    (%r14,%rbx,1),%rsi
mov    $0x4e,%edx
sub    %ebx,%edx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <memcpy@plt>
lea    0x4e(%rsp),%rdi
sub    %rbx,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
movb   $0x0,0x4e(%rsp)
lea    0xeca(%rip),%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [79 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @_spew_one(i32 %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 %0, i32* %2
%4 = call i64 @strlen(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = urem i64 %6, %4
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i64 %11
%13 = call i64 @strlen(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = sub i64 %13, %15
%17 = trunc i64 %16 to i32
%18 = call i32 @memcpy(i8* %9, i8* %12, i32 %17)
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%20 = call i64 @strlen(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%21 = getelementptr inbounds i8, i8* %19, i64 %20
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = sub i64 0, %23
%25 = getelementptr inbounds i8, i8* %21, i64 %24
%26 = load i32, i32* %2
%27 = call i32 @memcpy(i8* %25, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = call i64 @strlen(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%29 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %28
store i8 0, i8* %29
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %30)
ret void
}

LLVM IR (-O2):
@.str = [79 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_=+[]\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @_spew_one(i32 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = sext i32 %0 to i64
%5 = urem i64 %4, 78
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds [79 x i8], [79 x i8]* @.str, i64 0, i64 %5
%8 = sub nuw nsw i32 78, %6
%9 = call i32 @memcpy(i8* %3, i8* %7, i32 %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 78
%11 = sub nsw i64 0, %5
%12 = getelementptr inbounds i8, i8* %10, i64 %11
%13 = call i32 @memcpy(i8* %12, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 %6)
store i8 0, i8* %10
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}