#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*/ printf(char *, ...);
int strlen(char *);
int main() {
  char *a = "fuck u";
  int i;
  printf("%s\n", a);
  printf("%lld\n", (long long)&a);
  long long aa;
  for (i = 0; i < strlen(a); ++i) {
    aa += a[i] << (8 * i);
  }
  printf("%lld\n", aa);
  printf("%lld\n", 128782101083494l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cmp    %ecx,%eax
jge    11ad <main+0x8d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
cltq
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1165 <main+0x45>
mov    -0x20(%rbp),%rsi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe45(%rip),%rdi
movabs $0x75206b637566,%rsi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
mov    %rdi,0x8(%rsp)
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
xor    %r15d,%r15d
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rdi
call   1040 <strlen@plt>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x8(%rsp),%rdi
movsbl (%rdi,%rbx,1),%eax
mov    %r15d,%ecx
shl    %cl,%eax
cltq
add    %rax,%r14
add    $0x1,%rbx
call   1040 <strlen@plt>
cltq
add    $0x8,%r15d
cmp    %rax,%rbx
jl     1170 <main+0x40>
lea    0xe69(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movabs $0x75206b637566,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"fuck u\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = ptrtoint i8** %2 to i64
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %7)
store i32 0, i32* %3
br label %9
9: ; preds = %27, %0
%10 = load i32, i32* %3
%11 = load i8*, i8** %2
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %30
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i32, i32* %3
%22 = mul nsw i32 8, %21
%23 = shl i32 %20, %22
%24 = sext i32 %23 to i64
%25 = load i64, i64* %4
%26 = add nsw i64 %25, %24
store i64 %26, i64* %4
br label %27
27: ; preds = %14
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %9
30: ; preds = %9
%31 = load i64, i64* %4
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 128782101083494)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"fuck u\00"
@.str.2 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = ptrtoint i8** %1 to i64
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %4)
%6 = load i8*, i8** %1
%7 = call i32 @strlen(i8* %6)
%8 = icmp sgt i32 %7, 0
br label %9
9: ; preds = %0, %9
%10 = phi i64 [ 0, %0 ], [ %21, %9 ]
%11 = phi i64 [ undef, %0 ], [ %20, %9 ]
%12 = load i8*, i8** %1
%13 = getelementptr inbounds i8, i8* %12, i64 %10
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = trunc i64 %10 to i32
%17 = shl nsw i32 %16, 3
%18 = shl i32 %15, %17
%19 = sext i32 %18 to i64
%20 = add nsw i64 %11, %19
%21 = add nuw nsw i64 %10, 1
%22 = call i32 @strlen(i8* %12)
%23 = sext i32 %22 to i64
%24 = icmp slt i64 %21, %23
br i1 %24, label %9, label %25
25: ; preds = %9
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 %20)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 128782101083494)
ret i32 0
}