#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*/ assertEqc(char, char);
int /*<<< orphan*/ assertEqstr(char *, char *);
int /*<<< orphan*/ endTest();
int main() {
  const char text[] = "abcdefg";
  assertEqstr((char *)text, (char *)"abcdefg");
  char c = text[1];
  assertEqc(c, 'b');
  c = text[7];
  assertEqc(c, (char)0);
  char *s = (char *)((int)text + 3);
  assertEqstr(s, (char *)"defg");
  endTest();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <assertEqstr@plt>
mov    -0x7(%rbp),%al
mov    %al,-0x9(%rbp)
mov    $0x62,%esi
movsbl -0x9(%rbp),%edi
call   1040 <assertEqc@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x9(%rbp)
xor    %esi,%esi
movsbl -0x9(%rbp),%edi
call   1040 <assertEqc@plt>
lea    -0x8(%rbp),%rax
add    $0x3,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1050 <assertEqstr@plt>
mov    $0x0,%al
call   1030 <endTest@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x67666564636261,%rax
mov    %rax,0x8(%rsp)
lea    0xeb5(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <assertEqstr@plt>
movsbl 0x9(%rsp),%edi
mov    $0x62,%esi
call   1040 <assertEqc@plt>
movsbl 0xf(%rsp),%edi
xor    %esi,%esi
call   1040 <assertEqc@plt>
movslq %ebx,%rdi
or     $0x3,%rdi
lea    0xe82(%rip),%rsi
call   1050 <assertEqstr@plt>
xor    %eax,%eax
call   1030 <endTest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.text = [8 x i8] c"abcdefg\00"
@.str = [8 x i8] c"abcdefg\00"
@.str.1 = [5 x i8] c"defg\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = alloca i8
%3 = alloca i8*
%4 = bitcast [8 x i8]* %1 to i8*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = call i32 @assertEqstr(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 1
%8 = load i8, i8* %7
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = call i32 @assertEqc(i8 signext %9, i8 signext 98)
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 7
%12 = load i8, i8* %11
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = call i32 @assertEqc(i8 signext %13, i8 signext 0)
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%16 = ptrtoint i8* %15 to i32
%17 = add nsw i32 %16, 3
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %3
%20 = load i8*, i8** %3
%21 = call i32 @assertEqstr(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 (...) @endTest()
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"abcdefg\00"
@.str.1 = [5 x i8] c"defg\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to [8 x i8]*
%3 = bitcast i64* %1 to i8*
store i64 29104508263162465, i64* %1
%4 = call i32 @assertEqstr(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 1
%6 = load i8, i8* %5
%7 = call i32 @assertEqc(i8 signext %6, i8 signext 98)
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 7
%9 = load i8, i8* %8
%10 = call i32 @assertEqc(i8 signext %9, i8 signext 0)
%11 = ptrtoint i64* %1 to i64
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = or i64 %13, 3
%15 = inttoptr i64 %14 to i8*
%16 = call i32 @assertEqstr(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 (...) @endTest()
ret i32 0
}