#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);
int main(int argc, char *argv[], char *envp[]) {
  int local0;
  int local1;
  int o0;
  local0 = 0;
  local1 = 0;
  while (local1 <= 4) {
    o0 = *(unsigned char *)(local1 + 0x20930);
    local0 += (int)(o0 * 0x1000000) >> 24;
    local1++;
  }
  printf("Sum is %d\n", local0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jg     116f <main+0x5f>
mov    -0x20(%rbp),%eax
add    $0x20930,%eax
cltq
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1138 <main+0x28>
mov    -0x1c(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movzbl 0x20930,%eax
movzbl 0x20931,%ecx
add    %eax,%ecx
movzbl 0x20932,%eax
add    %ecx,%eax
movzbl 0x20933,%ecx
add    %eax,%ecx
movzbl 0x20934,%esi
add    %ecx,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %11
11: ; preds = %14, %3
%12 = load i32, i32* %9
%13 = icmp sle i32 %12, 4
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i32, i32* %9
%16 = add nsw i32 %15, 133424
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
store i32 %20, i32* %10
%21 = load i32, i32* %10
%22 = mul nsw i32 %21, 16777216
%23 = ashr i32 %22, 24
%24 = load i32, i32* %8
%25 = add nsw i32 %24, %23
store i32 %25, i32* %8
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %11
28: ; preds = %11
%29 = load i32, i32* %8
%30 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i8, i8* inttoptr (i64 133424 to i8*)
%5 = zext i8 %4 to i32
%6 = load i8, i8* inttoptr (i64 133425 to i8*)
%7 = zext i8 %6 to i32
%8 = add nuw nsw i32 %5, %7
%9 = load i8, i8* inttoptr (i64 133426 to i8*)
%10 = zext i8 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = load i8, i8* inttoptr (i64 133427 to i8*)
%13 = zext i8 %12 to i32
%14 = add nuw nsw i32 %11, %13
%15 = load i8, i8* inttoptr (i64 133428 to i8*)
%16 = zext i8 %15 to i32
%17 = add nuw nsw i32 %14, %16
%18 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}