#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 /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htobe32(int);
uint32_t K(int t) {
  if (0 <= t && t <= 19)
    return htobe32(0x5A827999);
  else if (20 <= t && t <= 39)
    return htobe32(0x6ED9EBA1);
  else if (40 <= t && t <= 59)
    return htobe32(0x8F1BBCDC);
  else if (60 <= t && t <= 79)
    return htobe32(0xCA62C1D6);
}


x86 assembly (clang, -O0):
<K>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     1142 <K+0x32>
cmpl   $0x13,-0x8(%rbp)
jg     1142 <K+0x32>
mov    $0x5a827999,%edi
call   1030 <htobe32@plt>
mov    %eax,-0x4(%rbp)
jmp    11cf <K+0xbf>
mov    $0x14,%eax
cmp    -0x8(%rbp),%eax
jg     116c <K+0x5c>
cmpl   $0x27,-0x8(%rbp)
jg     116c <K+0x5c>
mov    $0x6ed9eba1,%edi
call   1030 <htobe32@plt>
mov    %eax,-0x4(%rbp)
jmp    11cf <K+0xbf>
mov    $0x28,%eax
cmp    -0x8(%rbp),%eax
jg     1196 <K+0x86>
cmpl   $0x3b,-0x8(%rbp)
jg     1196 <K+0x86>
mov    $0x8f1bbcdc,%edi
call   1030 <htobe32@plt>
mov    %eax,-0x4(%rbp)
jmp    11cf <K+0xbf>
mov    $0x3c,%eax
cmp    -0x8(%rbp),%eax
jg     11c0 <K+0xb0>
cmpl   $0x4f,-0x8(%rbp)
jg     11c0 <K+0xb0>
mov    $0xca62c1d6,%edi
call   1030 <htobe32@plt>
mov    %eax,-0x4(%rbp)
jmp    11cf <K+0xbf>
jmp    11c5 <K+0xb5>
jmp    11ca <K+0xba>
jmp    11cf <K+0xbf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<K>:
mov    $0x5a827999,%eax
cmp    $0x14,%edi
jb     1141 <K+0x31>
lea    -0x14(%rdi),%ecx
mov    $0x6ed9eba1,%eax
cmp    $0x14,%ecx
jb     1141 <K+0x31>
lea    -0x28(%rdi),%ecx
mov    $0x8f1bbcdc,%eax
cmp    $0x14,%ecx
jb     1141 <K+0x31>
add    $0xffffffc4,%edi
mov    $0xca62c1d6,%eax
cmp    $0x13,%edi
ja     1148 <K+0x38>
mov    %eax,%edi
jmp    1030 <htobe32@plt>
ret

LLVM IR (-O0):
define i32 @K(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 19
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @htobe32(i32 1518500249)
store i32 %10, i32* %2
br label %38
11: ; preds = %6, %1
%12 = load i32, i32* %3
%13 = icmp sle i32 20, %12
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp sle i32 %15, 39
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @htobe32(i32 1859775393)
store i32 %18, i32* %2
br label %38
19: ; preds = %14, %11
%20 = load i32, i32* %3
%21 = icmp sle i32 40, %20
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %3
%24 = icmp sle i32 %23, 59
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @htobe32(i32 -1894007588)
store i32 %26, i32* %2
br label %38
27: ; preds = %22, %19
%28 = load i32, i32* %3
%29 = icmp sle i32 60, %28
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i32, i32* %3
%32 = icmp sle i32 %31, 79
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @htobe32(i32 -899497514)
store i32 %34, i32* %2
br label %38
35: ; preds = %30, %27
br label %36
36: ; preds = %35
br label %37
37: ; preds = %36
br label %38
38: ; preds = %9, %17, %25, %33, %37
%39 = load i32, i32* %2
ret i32 %39
}

LLVM IR (-O2):
define i32 @K(i32 %0) {
%2 = icmp ult i32 %0, 20
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = add i32 %0, -20
%5 = icmp ult i32 %4, 20
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = add i32 %0, -40
%8 = icmp ult i32 %7, 20
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = add i32 %0, -60
%11 = icmp ult i32 %10, 20
br i1 %11, label %12, label %15
12: ; preds = %9, %6, %3, %1
%13 = phi i32 [ 1518500249, %1 ], [ 1859775393, %3 ], [ -1894007588, %6 ], [ -899497514, %9 ]
%14 = tail call i32 @htobe32(i32 %13)
br label %15
15: ; preds = %12, %9
%16 = phi i32 [ undef, %9 ], [ %14, %12 ]
ret i32 %16
}