#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 int64_t;

/* Variables and functions */
int load_4(unsigned char const *);
int signum(int);
int sc_check(const unsigned char *s) {
  int64_t s0 = load_4(s);
  int64_t s1 = load_4(s + 4);
  int64_t s2 = load_4(s + 8);
  int64_t s3 = load_4(s + 12);
  int64_t s4 = load_4(s + 16);
  int64_t s5 = load_4(s + 20);
  int64_t s6 = load_4(s + 24);
  int64_t s7 = load_4(s + 28);
  return (int)((signum(1559614444 - s0) + (signum(1477600026 - s1) << 1) +
                (signum(2734136534 - s2) << 2) + (signum(350157278 - s3) << 3) +
                (signum(-s4) << 4) + (signum(-s5) << 5) + (signum(-s6) << 6) +
                (signum(268435456 - s7) << 7)) >>
               8);
}


x86 assembly (clang, -O0):
<sc_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <load_4@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1040 <load_4@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1040 <load_4@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
call   1040 <load_4@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1040 <load_4@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x14,%rdi
call   1040 <load_4@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
call   1040 <load_4@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1c,%rdi
call   1040 <load_4@plt>
mov    %eax,-0x28(%rbp)
mov    $0x5cf5d3ec,%edi
sub    -0xc(%rbp),%edi
call   1030 <signum@plt>
mov    %eax,-0x44(%rbp)
mov    $0x5812631a,%edi
sub    -0x10(%rbp),%edi
call   1030 <signum@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x40(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa2f79cd6,%eax
sub    %rcx,%rax
mov    %eax,%edi
call   1030 <signum@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    $0x14def9de,%edi
sub    -0x18(%rbp),%edi
call   1030 <signum@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
xor    %edi,%edi
sub    -0x1c(%rbp),%edi
call   1030 <signum@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
shl    $0x4,%ecx
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
xor    %edi,%edi
sub    -0x20(%rbp),%edi
call   1030 <signum@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
shl    $0x5,%ecx
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
xor    %edi,%edi
sub    -0x24(%rbp),%edi
call   1030 <signum@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
shl    $0x6,%ecx
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    $0x10000000,%edi
sub    -0x28(%rbp),%edi
call   1030 <signum@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
shl    $0x7,%ecx
add    %ecx,%eax
sar    $0x8,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_check>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
call   1040 <load_4@plt>
mov    %eax,%ebx
lea    0x4(%r13),%rdi
call   1040 <load_4@plt>
mov    %eax,(%rsp)
lea    0x8(%r13),%rdi
call   1040 <load_4@plt>
mov    %eax,0x4(%rsp)
lea    0xc(%r13),%rdi
call   1040 <load_4@plt>
mov    %eax,%ebp
lea    0x10(%r13),%rdi
call   1040 <load_4@plt>
mov    %eax,%r12d
lea    0x14(%r13),%rdi
call   1040 <load_4@plt>
mov    %eax,%r14d
lea    0x18(%r13),%rdi
call   1040 <load_4@plt>
mov    %eax,%r15d
add    $0x1c,%r13
mov    %r13,%rdi
call   1040 <load_4@plt>
mov    %eax,%r13d
mov    $0x5cf5d3ec,%edi
sub    %ebx,%edi
call   1030 <signum@plt>
mov    %eax,%ebx
mov    $0x5812631a,%edi
sub    (%rsp),%edi
call   1030 <signum@plt>
lea    (%rbx,%rax,2),%ebx
mov    $0xa2f79cd6,%edi
sub    0x4(%rsp),%edi
call   1030 <signum@plt>
lea    (%rbx,%rax,4),%ebx
mov    $0x14def9de,%edi
sub    %ebp,%edi
call   1030 <signum@plt>
lea    (%rbx,%rax,8),%ebp
neg    %r12d
mov    %r12d,%edi
call   1030 <signum@plt>
mov    %eax,%ebx
shl    $0x4,%ebx
add    %ebp,%ebx
neg    %r14d
mov    %r14d,%edi
call   1030 <signum@plt>
mov    %eax,%ebp
shl    $0x5,%ebp
add    %ebx,%ebp
neg    %r15d
mov    %r15d,%edi
call   1030 <signum@plt>
mov    %eax,%ebx
shl    $0x6,%ebx
add    %ebp,%ebx
mov    $0x10000000,%edi
sub    %r13d,%edi
call   1030 <signum@plt>
shl    $0x7,%eax
add    %ebx,%eax
sar    $0x8,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sc_check(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %2
%11 = load i8*, i8** %2
%12 = call i32 @load_4(i8* %11)
store i32 %12, i32* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 4
%15 = call i32 @load_4(i8* %14)
store i32 %15, i32* %4
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 8
%18 = call i32 @load_4(i8* %17)
store i32 %18, i32* %5
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 12
%21 = call i32 @load_4(i8* %20)
store i32 %21, i32* %6
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 16
%24 = call i32 @load_4(i8* %23)
store i32 %24, i32* %7
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 20
%27 = call i32 @load_4(i8* %26)
store i32 %27, i32* %8
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i64 24
%30 = call i32 @load_4(i8* %29)
store i32 %30, i32* %9
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 28
%33 = call i32 @load_4(i8* %32)
store i32 %33, i32* %10
%34 = load i32, i32* %3
%35 = sub nsw i32 1559614444, %34
%36 = call i32 @signum(i32 %35)
%37 = load i32, i32* %4
%38 = sub nsw i32 1477600026, %37
%39 = call i32 @signum(i32 %38)
%40 = shl i32 %39, 1
%41 = add nsw i32 %36, %40
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = sub nsw i64 2734136534, %43
%45 = trunc i64 %44 to i32
%46 = call i32 @signum(i32 %45)
%47 = shl i32 %46, 2
%48 = add nsw i32 %41, %47
%49 = load i32, i32* %6
%50 = sub nsw i32 350157278, %49
%51 = call i32 @signum(i32 %50)
%52 = shl i32 %51, 3
%53 = add nsw i32 %48, %52
%54 = load i32, i32* %7
%55 = sub nsw i32 0, %54
%56 = call i32 @signum(i32 %55)
%57 = shl i32 %56, 4
%58 = add nsw i32 %53, %57
%59 = load i32, i32* %8
%60 = sub nsw i32 0, %59
%61 = call i32 @signum(i32 %60)
%62 = shl i32 %61, 5
%63 = add nsw i32 %58, %62
%64 = load i32, i32* %9
%65 = sub nsw i32 0, %64
%66 = call i32 @signum(i32 %65)
%67 = shl i32 %66, 6
%68 = add nsw i32 %63, %67
%69 = load i32, i32* %10
%70 = sub nsw i32 268435456, %69
%71 = call i32 @signum(i32 %70)
%72 = shl i32 %71, 7
%73 = add nsw i32 %68, %72
%74 = ashr i32 %73, 8
ret i32 %74
}

LLVM IR (-O2):
define i32 @sc_check(i8* %0) {
%2 = tail call i32 @load_4(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = tail call i32 @load_4(i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = tail call i32 @load_4(i8* %5)
%7 = getelementptr inbounds i8, i8* %0, i64 12
%8 = tail call i32 @load_4(i8* %7)
%9 = getelementptr inbounds i8, i8* %0, i64 16
%10 = tail call i32 @load_4(i8* %9)
%11 = getelementptr inbounds i8, i8* %0, i64 20
%12 = tail call i32 @load_4(i8* %11)
%13 = getelementptr inbounds i8, i8* %0, i64 24
%14 = tail call i32 @load_4(i8* %13)
%15 = getelementptr inbounds i8, i8* %0, i64 28
%16 = tail call i32 @load_4(i8* %15)
%17 = sub nsw i32 1559614444, %2
%18 = tail call i32 @signum(i32 %17)
%19 = sub nsw i32 1477600026, %4
%20 = tail call i32 @signum(i32 %19)
%21 = shl i32 %20, 1
%22 = add nsw i32 %21, %18
%23 = sub i32 -1560830762, %6
%24 = tail call i32 @signum(i32 %23)
%25 = shl i32 %24, 2
%26 = add nsw i32 %22, %25
%27 = sub nsw i32 350157278, %8
%28 = tail call i32 @signum(i32 %27)
%29 = shl i32 %28, 3
%30 = add nsw i32 %26, %29
%31 = sub nsw i32 0, %10
%32 = tail call i32 @signum(i32 %31)
%33 = shl i32 %32, 4
%34 = add nsw i32 %30, %33
%35 = sub nsw i32 0, %12
%36 = tail call i32 @signum(i32 %35)
%37 = shl i32 %36, 5
%38 = add nsw i32 %34, %37
%39 = sub nsw i32 0, %14
%40 = tail call i32 @signum(i32 %39)
%41 = shl i32 %40, 6
%42 = add nsw i32 %38, %41
%43 = sub nsw i32 268435456, %16
%44 = tail call i32 @signum(i32 %43)
%45 = shl i32 %44, 7
%46 = add nsw i32 %42, %45
%47 = ashr i32 %46, 8
ret i32 %47
}