int main(int argc, char *argv[], char *envp[]) {
  int local0;
  unsigned char *local1;
  int local2;
  int o0;
  local0 = 0;
  mid(0x20a50);
  fst(0x20a46);
  local1 = 0x20a50;
  local2 = 0;
  while (local2 <= 4) {
    o0 = *(unsigned char *)local1;
    local0 += (int)(o0 * 0x1000000) >> 24;
    local1++;
    local2++;
  }
  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)
mov    $0x20a50,%edi
mov    $0x0,%al
call   1040 <mid@plt>
mov    $0x20a46,%edi
mov    $0x0,%al
call   1050 <fst@plt>
mov    $0x20a50,%eax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jg     11b6 <main+0x86>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1179 <main+0x49>
mov    -0x1c(%rbp),%esi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20a50,%edi
xor    %eax,%eax
call   1040 <mid@plt>
mov    $0x20a46,%edi
xor    %eax,%eax
call   1050 <fst@plt>
movzbl 0x20a50,%eax
movzbl 0x20a51,%ecx
add    %eax,%ecx
movzbl 0x20a52,%eax
add    %ecx,%eax
movzbl 0x20a53,%ecx
add    %eax,%ecx
movzbl 0x20a54,%esi
add    %ecx,%esi
lea    0xe80(%rip),%rdi
xor    %eax,%eax
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 i8*
%10 = alloca i32
%11 = 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
%12 = call i32 (i32, ...) bitcast (i32 (...)* @mid to i32 (i32, ...)*)(i32 133712)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @fst to i32 (i32, ...)*)(i32 133702)
store i8* inttoptr (i64 133712 to i8*), i8** %9
store i32 0, i32* %10
br label %14
14: ; preds = %17, %3
%15 = load i32, i32* %10
%16 = icmp sle i32 %15, 4
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = load i8*, i8** %9
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
store i32 %20, i32* %11
%21 = load i32, i32* %11
%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 i8*, i8** %9
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %9
%28 = load i32, i32* %10
%29 = add nsw i32 %28, 1
store i32 %29, i32* %10
br label %14
30: ; preds = %14
%31 = load i32, i32* %8
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %31)
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 = tail call i32 (i32, ...) bitcast (i32 (...)* @mid to i32 (i32, ...)*)(i32 133712)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @fst to i32 (i32, ...)*)(i32 133702)
%6 = load i8, i8* inttoptr (i64 133712 to i8*)
%7 = zext i8 %6 to i32
%8 = load i8, i8* inttoptr (i64 133713 to i8*)
%9 = zext i8 %8 to i32
%10 = add nuw nsw i32 %7, %9
%11 = load i8, i8* inttoptr (i64 133714 to i8*)
%12 = zext i8 %11 to i32
%13 = add nuw nsw i32 %10, %12
%14 = load i8, i8* inttoptr (i64 133715 to i8*)
%15 = zext i8 %14 to i32
%16 = add nuw nsw i32 %13, %15
%17 = load i8, i8* inttoptr (i64 133716 to i8*)
%18 = zext i8 %17 to i32
%19 = add nuw nsw i32 %16, %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}