#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 */
typedef int /*<<< orphan*/ p;
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char c = 12;
  char b = 255;
  int *p;
  printf("Output = %d\n", (c ^ b) + 1);
  char a[] = "somerandomstringoflowercaseletters";
  printf("%s\n", a);
  int i;
  for (i = 0; i < (sizeof(a) - 1); i++) {
    a[i] = a[i] ^ 32;
  }
  printf("%d\n", sizeof(c));
  printf("%d\n", sizeof(p));
  printf("%s\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0xc,-0x5(%rbp)
movb   $0xff,-0x6(%rbp)
movsbl -0x5(%rbp),%esi
movsbl -0x6(%rbp),%eax
xor    %eax,%esi
add    $0x1,%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x23,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
movslq -0x44(%rbp),%rax
cmp    $0x22,%rax
jae    11b2 <main+0x92>
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
xor    $0x20,%eax
mov    %al,%cl
movslq -0x44(%rbp),%rax
mov    %cl,-0x40(%rbp,%rax,1)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1180 <main+0x60>
lea    0xe50(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xee2(%rip),%rdi
mov    $0xfffffff4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movaps 0xeef(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x737265,0x1f(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <puts@plt>
movb   $0x53,(%rsp)
movaps 0xe91(%rip),%xmm0
movups 0x1(%rsp),%xmm1
movups 0x11(%rsp),%xmm2
xorps  %xmm0,%xmm1
movups %xmm1,0x1(%rsp)
xorps  %xmm0,%xmm2
movups %xmm2,0x11(%rsp)
xorb   $0x20,0x21(%rsp)
lea    0xe84(%rip),%rbx
mov    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x8,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Output = %d\0A\00"
@__const.main.a = [35 x i8] c"somerandomstringoflowercaseletters\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32*
%5 = alloca [35 x i8]
%6 = alloca i32
store i32 0, i32* %1
store i8 12, i8* %2
store i8 -1, i8* %3
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = xor i32 %8, %10
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = bitcast [35 x i8]* %5 to i8*
%15 = getelementptr inbounds [35 x i8], [35 x i8]* %5, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i32 0, i32* %6
br label %17
17: ; preds = %32, %0
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = icmp ult i64 %19, 34
br i1 %20, label %21, label %35
21: ; preds = %17
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [35 x i8], [35 x i8]* %5, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = xor i32 %26, 32
%28 = trunc i32 %27 to i8
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [35 x i8], [35 x i8]* %5, i64 0, i64 %30
store i8 %28, i8* %31
br label %32
32: ; preds = %21
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %17
35: ; preds = %17
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 1)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 8)
%38 = getelementptr inbounds [35 x i8], [35 x i8]* %5, i64 0, i64 0
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Output = %d\0A\00"
@__const.main.a = [35 x i8] c"somerandomstringoflowercaseletters\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [35 x i8]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 -12)
%3 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 0
%4 = call i32 @puts(i8* %3)
%5 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 0
store i8 83, i8* %5
%6 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 1
%7 = bitcast i8* %6 to <16 x i8>*
%8 = load <16 x i8>, <16 x i8>* %7
%9 = xor <16 x i8> %8, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
%10 = bitcast i8* %6 to <16 x i8>*
store <16 x i8> %9, <16 x i8>* %10
%11 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 17
%12 = bitcast i8* %11 to <16 x i8>*
%13 = load <16 x i8>, <16 x i8>* %12
%14 = xor <16 x i8> %13, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
%15 = bitcast i8* %11 to <16 x i8>*
store <16 x i8> %14, <16 x i8>* %15
%16 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 33
%17 = load i8, i8* %16
%18 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 33
%19 = xor i8 %17, 32
store i8 %19, i8* %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 1)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 8)
%22 = call i32 @puts(i8* %3)
ret i32 0
}