#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*/ bar(long *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(void) {
  int i;
  long beforea[3];
  long a[7];
  long aftera[3];
  bar(a, 7 + 1);
  bar(a, 7 + 0);
  for (i = 0; i < 7 + 1; i++) {
    a[i] = 0;
  }
  {
    char beforebuf[8];
    char buf[8];
    char afterbuf[8];
    sprintf(buf, "%d", 123456789);
    return 1 & ((a[4] + beforea[1] + aftera[1] + beforebuf[1] + buf[2] +
                 afterbuf[3]) /
                100000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x8,%esi
call   1030 <bar@plt>
lea    -0x60(%rbp),%rdi
mov    $0x7,%esi
call   1030 <bar@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    117a <main+0x5a>
movslq -0x8(%rbp),%rax
movq   $0x0,-0x60(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <main+0x35>
lea    -0x90(%rbp),%rdi
lea    0xe78(%rip),%rsi
mov    $0x75bcd15,%edx
call   1040 <sprintf@plt>
mov    -0x40(%rbp),%rax
add    -0x18(%rbp),%rax
add    -0x78(%rbp),%rax
movsbq -0x87(%rbp),%rcx
ff
add    %rcx,%rax
movsbq -0x8e(%rbp),%rcx
ff
add    %rcx,%rax
movsbq -0x95(%rbp),%rcx
ff
add    %rcx,%rax
mov    $0x186a0,%ecx
cqto
idiv   %rcx
and    $0x1,%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <bar@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <bar@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
lea    0xe9e(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    $0x75bcd15,%edx
call   1040 <sprintf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i64]
%4 = alloca [7 x i64]
%5 = alloca [3 x i64]
%6 = alloca [8 x i8]
%7 = alloca [8 x i8]
%8 = alloca [8 x i8]
store i32 0, i32* %1
%9 = getelementptr inbounds [7 x i64], [7 x i64]* %4, i64 0, i64 0
%10 = call i32 @bar(i64* %9, i32 8)
%11 = getelementptr inbounds [7 x i64], [7 x i64]* %4, i64 0, i64 0
%12 = call i32 @bar(i64* %11, i32 7)
store i32 0, i32* %2
br label %13
13: ; preds = %20, %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 8
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [7 x i64], [7 x i64]* %4, i64 0, i64 %18
store i64 0, i64* %19
br label %20
20: ; preds = %16
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %13
23: ; preds = %13
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%25 = call i32 @sprintf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 123456789)
%26 = getelementptr inbounds [7 x i64], [7 x i64]* %4, i64 0, i64 4
%27 = load i64, i64* %26
%28 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 1
%29 = load i64, i64* %28
%30 = add nsw i64 %27, %29
%31 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 1
%32 = load i64, i64* %31
%33 = add nsw i64 %30, %32
%34 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 1
%35 = load i8, i8* %34
%36 = sext i8 %35 to i64
%37 = add nsw i64 %33, %36
%38 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 2
%39 = load i8, i8* %38
%40 = sext i8 %39 to i64
%41 = add nsw i64 %37, %40
%42 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 3
%43 = load i8, i8* %42
%44 = sext i8 %43 to i64
%45 = add nsw i64 %41, %44
%46 = sdiv i64 %45, 100000
%47 = and i64 1, %46
%48 = trunc i64 %47 to i32
ret i32 %48
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [7 x i64]
%2 = bitcast [7 x i64]* %1 to i8*
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [7 x i64], [7 x i64]* %1, i64 0, i64 0
%5 = call i32 @bar(i64* %4, i32 8)
%6 = call i32 @bar(i64* %4, i32 7)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 123456789)
ret i32 0
}