#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 /*<<< orphan*/ scanf(char *, long long *);
int main() {
  long long a[4], min1 = 1 << 23, min2;
  for (int i = 0; i < 4; ++i) {
    scanf("%I64d", a + i);
    if (i != 1)
      min1 = min1 > a[i] ? a[i] : min1;
  }
  a[0] -= min1;
  min2 = a[0] < a[1] ? a[0] : a[1];
  printf("%I64d", 256 * min1 + 32 * min2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x800000,-0x38(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x4,-0x44(%rbp)
jge    11b5 <main+0x95>
lea    -0x30(%rbp),%rsi
movslq -0x44(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xea2(%rip),%rdi
call   1040 <scanf@plt>
cmpl   $0x1,-0x44(%rbp)
je     11a2 <main+0x82>
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,8),%rax
jle    1192 <main+0x72>
movslq -0x44(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0x50(%rbp)
jmp    119a <main+0x7a>
mov    -0x38(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    11a7 <main+0x87>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    113e <main+0x1e>
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    11df <main+0xbf>
mov    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    11e7 <main+0xc7>
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
shl    $0x8,%rax
mov    -0x40(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
mov    %eax,%esi
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xed2(%rip),%r14
mov    %rsp,%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%rax
cmp    $0x800000,%rax
mov    $0x800000,%ebx
cmovl  %rax,%rbx
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
cmp    %rax,%rbx
cmovg  %rax,%rbx
lea    0x18(%rsp),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
mov    0x18(%rsp),%rax
cmp    %rax,%rbx
cmovg  %rax,%rbx
mov    (%rsp),%rax
mov    0x8(%rsp),%rsi
sub    %rbx,%rax
mov    %rax,(%rsp)
shl    $0x8,%ebx
cmp    %rsi,%rax
cmovl  %eax,%esi
shl    $0x5,%esi
add    %ebx,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%I64d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i64]
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
store i64 8388608, i64* %3
store i32 0, i32* %5
br label %6
6: ; preds = %34, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %37
9: ; preds = %6
%10 = getelementptr inbounds [4 x i64], [4 x i64]* %2, i64 0, i64 0
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %10, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %13)
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 1
br i1 %16, label %17, label %33
17: ; preds = %9
%18 = load i64, i64* %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [4 x i64], [4 x i64]* %2, i64 0, i64 %20
%22 = load i64, i64* %21
%23 = icmp sgt i64 %18, %22
br i1 %23, label %24, label %29
24: ; preds = %17
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [4 x i64], [4 x i64]* %2, i64 0, i64 %26
%28 = load i64, i64* %27
br label %31
29: ; preds = %17
%30 = load i64, i64* %3
br label %31
31: ; preds = %29, %24
%32 = phi i64 [ %28, %24 ], [ %30, %29 ]
store i64 %32, i64* %3
br label %33
33: ; preds = %31, %9
br label %34
34: ; preds = %33
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %6
37: ; preds = %6
%38 = load i64, i64* %3
%39 = getelementptr inbounds [4 x i64], [4 x i64]* %2, i64 0, i64 0
%40 = load i64, i64* %39
%41 = sub nsw i64 %40, %38
store i64 %41, i64* %39
%42 = getelementptr inbounds [4 x i64], [4 x i64]* %2, i64 0, i64 0
%43 = load i64, i64* %42
%44 = getelementptr inbounds [4 x i64], [4 x i64]* %2, i64 0, i64 1
%45 = load i64, i64* %44
%46 = icmp slt i64 %43, %45
br i1 %46, label %47, label %50
47: ; preds = %37
%48 = getelementptr inbounds [4 x i64], [4 x i64]* %2, i64 0, i64 0
%49 = load i64, i64* %48
br label %53
50: ; preds = %37
%51 = getelementptr inbounds [4 x i64], [4 x i64]* %2, i64 0, i64 1
%52 = load i64, i64* %51
br label %53
53: ; preds = %50, %47
%54 = phi i64 [ %49, %47 ], [ %52, %50 ]
store i64 %54, i64* %4
%55 = load i64, i64* %3
%56 = mul nsw i64 256, %55
%57 = load i64, i64* %4
%58 = mul nsw i64 32, %57
%59 = add nsw i64 %56, %58
%60 = trunc i64 %59 to i32
%61 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %60)
%62 = load i32, i32* %1
ret i32 %62
}

LLVM IR (-O2):
@.str = [6 x i8] c"%I64d\00"
define i32 @main() {
%1 = alloca [4 x i64]
%2 = bitcast [4 x i64]* %1 to i8*
%3 = getelementptr inbounds [4 x i64], [4 x i64]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %3)
%5 = load i64, i64* %3
%6 = icmp slt i64 %5, 8388608
%7 = select i1 %6, i64 %5, i64 8388608
%8 = getelementptr inbounds [4 x i64], [4 x i64]* %1, i64 0, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %8)
%10 = getelementptr inbounds [4 x i64], [4 x i64]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %10)
%12 = load i64, i64* %10
%13 = icmp sgt i64 %7, %12
%14 = select i1 %13, i64 %12, i64 %7
%15 = getelementptr inbounds [4 x i64], [4 x i64]* %1, i64 0, i64 3
%16 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %15)
%17 = load i64, i64* %15
%18 = icmp sgt i64 %14, %17
%19 = select i1 %18, i64 %17, i64 %14
%20 = load i64, i64* %3
%21 = sub nsw i64 %20, %19
store i64 %21, i64* %3
%22 = load i64, i64* %8
%23 = icmp slt i64 %21, %22
%24 = select i1 %23, i64 %21, i64 %22
%25 = shl nsw i64 %19, 8
%26 = shl nsw i64 %24, 5
%27 = add nsw i64 %26, %25
%28 = trunc i64 %27 to i32
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %28)
ret i32 0
}