void sample_string_A(char *s, int i) {
  s[0] = (char)(1 + (i % 254));
  s[1] = (char)(1 + ((i / 254) % 254));
  s[2] = (char)(1 + (((i / 254) / 254) % 254));
  s[3] = 'a';
  s[4] = 'b';
  s[5] = (char)(1 + ((i * (i - 3)) % 217));
  s[6] = (char)(1 + ((17 * i + 129) % 233));
  s[7] = '\0';
}


x86 assembly (clang, -O0):
<sample_string_A>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xfe,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    $0xfe,%ecx
cltd
idiv   %ecx
mov    $0xfe,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
mov    $0xfe,%ecx
cltd
idiv   %ecx
mov    $0xfe,%ecx
cltd
idiv   %ecx
mov    $0xfe,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x61,0x3(%rax)
mov    -0x8(%rbp),%rax
movb   $0x62,0x4(%rax)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x3,%ecx
imul   %ecx,%eax
mov    $0xd9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x5(%rax)
imul   $0x11,-0xc(%rbp),%eax
add    $0x81,%eax
mov    $0xe9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x7(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_string_A>:
movslq %esi,%rax
imul   $0xffffffff81020409,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x7,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
add    %eax,%edx
add    $0x1,%dl
mov    %dl,(%rdi)
movslq %ecx,%rcx
imul   $0xffffffff81020409,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%esi
shr    $0x1f,%esi
shr    $0x7,%edx
add    %esi,%edx
add    %edx,%edx
add    %ecx,%edx
add    $0x1,%dl
mov    %dl,0x1(%rdi)
imul   $0xffffffff82061029,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xf,%ecx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0xffffffff81020409,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%esi
shr    $0x1f,%esi
shr    $0x7,%edx
add    %esi,%edx
add    %edx,%edx
add    %ecx,%edx
add    $0x1,%dl
mov    %dl,0x2(%rdi)
movw   $0x6261,0x3(%rdi)
lea    -0x3(%rax),%ecx
imul   %eax,%ecx
movslq %ecx,%rcx
imul   $0xffffffff97012e03,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%esi
shr    $0x1f,%esi
shr    $0x7,%edx
add    %esi,%edx
imul   $0xd9,%edx,%edx
sub    %edx,%ecx
add    $0x1,%cl
mov    %cl,0x5(%rdi)
mov    %eax,%ecx
shl    $0x4,%ecx
lea    (%rax,%rcx,1),%edx
add    %ecx,%eax
add    $0x81,%eax
cltq
imul   $0xffffffff8ca29c05,%rax,%rcx
shr    $0x20,%rcx
add    %edx,%ecx
add    $0x81,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
shr    $0x7,%ecx
add    %edx,%ecx
imul   $0xe9,%ecx,%ecx
sub    %ecx,%eax
add    $0x1,%al
mov    %al,0x6(%rdi)
movb   $0x0,0x7(%rdi)
ret

LLVM IR (-O0):
define void @sample_string_A(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 254
%7 = add nsw i32 1, %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 254
%13 = srem i32 %12, 254
%14 = add nsw i32 1, %13
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 254
%20 = sdiv i32 %19, 254
%21 = srem i32 %20, 254
%22 = add nsw i32 1, %21
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %23, i8* %25
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 97, i8* %27
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 4
store i8 98, i8* %29
%30 = load i32, i32* %4
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 3
%33 = mul nsw i32 %30, %32
%34 = srem i32 %33, 217
%35 = add nsw i32 1, %34
%36 = trunc i32 %35 to i8
%37 = load i8*, i8** %3
%38 = getelementptr inbounds i8, i8* %37, i64 5
store i8 %36, i8* %38
%39 = load i32, i32* %4
%40 = mul nsw i32 17, %39
%41 = add nsw i32 %40, 129
%42 = srem i32 %41, 233
%43 = add nsw i32 1, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %3
%46 = getelementptr inbounds i8, i8* %45, i64 6
store i8 %44, i8* %46
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i64 7
store i8 0, i8* %48
ret void
}

LLVM IR (-O2):
define void @sample_string_A(i8* nocapture writeonly %0, i32 %1) {
%3 = srem i32 %1, 254
%4 = trunc i32 %3 to i8
%5 = add i8 %4, 1
store i8 %5, i8* %0
%6 = sdiv i32 %1, 254
%7 = srem i32 %6, 254
%8 = trunc i32 %7 to i8
%9 = add i8 %8, 1
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = sdiv i32 %1, 64516
%12 = srem i32 %11, 254
%13 = trunc i32 %12 to i8
%14 = add i8 %13, 1
%15 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %14, i8* %15
%16 = getelementptr inbounds i8, i8* %0, i64 3
store i8 97, i8* %16
%17 = getelementptr inbounds i8, i8* %0, i64 4
store i8 98, i8* %17
%18 = add nsw i32 %1, -3
%19 = mul nsw i32 %18, %1
%20 = srem i32 %19, 217
%21 = trunc i32 %20 to i8
%22 = add i8 %21, 1
%23 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %22, i8* %23
%24 = mul nsw i32 %1, 17
%25 = add nsw i32 %24, 129
%26 = srem i32 %25, 233
%27 = trunc i32 %26 to i8
%28 = add i8 %27, 1
%29 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %28, i8* %29
%30 = getelementptr inbounds i8, i8* %0, i64 7
store i8 0, i8* %30
ret void
}