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

/* Variables and functions */
int /*<<< orphan*/ mk_sha1(int *, int, int *);
void hmac_sha1(uint8_t *key, int key_length, uint8_t *data, int data_length,
               uint8_t *digest) {
  int b = 64;
  uint8_t ipad = 0x36;
  uint8_t opad = 0x5c;
  uint8_t k0[64];
  uint8_t k0xorIpad[64];
  uint8_t step7data[64];
  uint8_t step5data[128 + 128];
  uint8_t step8data[64 + 20];
  int i;
  for (i = 0; i < 64; i++) {
    k0[i] = 0x00;
  }
  if (key_length != b) {
    if (key_length > b) {
      mk_sha1(key, key_length, digest);
      for (i = 0; i < 20; i++) {
        k0[i] = digest[i];
      }
    } else if (key_length < b) {
      for (i = 0; i < key_length; i++) {
        k0[i] = key[i];
      }
    }
  } else {
    for (i = 0; i < b; i++) {
      k0[i] = key[i];
    }
  }
  for (i = 0; i < 64; i++) {
    k0xorIpad[i] = k0[i] ^ ipad;
  }
  for (i = 0; i < 64; i++) {
    step5data[i] = k0xorIpad[i];
  }
  for (i = 0; i < data_length; i++) {
    step5data[i + 64] = data[i];
  }
  mk_sha1(step5data, data_length + b, digest);
  for (i = 0; i < 64; i++) {
    step7data[i] = k0[i] ^ opad;
  }
  for (i = 0; i < 64; i++) {
    step8data[i] = step7data[i];
  }
  for (i = 0; i < 20; i++) {
    step8data[i + 64] = digest[i];
  }
  mk_sha1(step8data, b + 20, digest);
}


x86 assembly (clang, -O0):
<hmac_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x40,-0x2c(%rbp)
movl   $0x36,-0x30(%rbp)
movl   $0x5c,-0x34(%rbp)
movl   $0x0,-0x894(%rbp)
cmpl   $0x40,-0x894(%rbp)
jge    117f <hmac_sha1+0x6f>
movslq -0x894(%rbp),%rax
movl   $0x0,-0x140(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    114c <hmac_sha1+0x3c>
mov    -0xc(%rbp),%eax
cmp    -0x2c(%rbp),%eax
je     1257 <hmac_sha1+0x147>
mov    -0xc(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jle    11f3 <hmac_sha1+0xe3>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1030 <mk_sha1@plt>
movl   $0x0,-0x894(%rbp)
cmpl   $0x14,-0x894(%rbp)
jge    11ee <hmac_sha1+0xde>
mov    -0x28(%rbp),%rax
movslq -0x894(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x894(%rbp),%rax
mov    %ecx,-0x140(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    11b1 <hmac_sha1+0xa1>
jmp    1252 <hmac_sha1+0x142>
mov    -0xc(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    124d <hmac_sha1+0x13d>
movl   $0x0,-0x894(%rbp)
mov    -0x894(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1248 <hmac_sha1+0x138>
mov    -0x8(%rbp),%rax
movslq -0x894(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x894(%rbp),%rax
mov    %ecx,-0x140(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    1209 <hmac_sha1+0xf9>
jmp    124d <hmac_sha1+0x13d>
jmp    1252 <hmac_sha1+0x142>
jmp    12a5 <hmac_sha1+0x195>
movl   $0x0,-0x894(%rbp)
mov    -0x894(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12a0 <hmac_sha1+0x190>
mov    -0x8(%rbp),%rax
movslq -0x894(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x894(%rbp),%rax
mov    %ecx,-0x140(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    1261 <hmac_sha1+0x151>
jmp    12a5 <hmac_sha1+0x195>
movl   $0x0,-0x894(%rbp)
cmpl   $0x40,-0x894(%rbp)
jge    12ef <hmac_sha1+0x1df>
movslq -0x894(%rbp),%rax
mov    -0x140(%rbp,%rax,4),%ecx
xor    -0x30(%rbp),%ecx
movslq -0x894(%rbp),%rax
mov    %ecx,-0x240(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    12af <hmac_sha1+0x19f>
movl   $0x0,-0x894(%rbp)
cmpl   $0x40,-0x894(%rbp)
jge    1336 <hmac_sha1+0x226>
movslq -0x894(%rbp),%rax
mov    -0x240(%rbp,%rax,4),%ecx
movslq -0x894(%rbp),%rax
mov    %ecx,-0x740(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    12f9 <hmac_sha1+0x1e9>
movl   $0x0,-0x894(%rbp)
mov    -0x894(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1383 <hmac_sha1+0x273>
mov    -0x18(%rbp),%rax
movslq -0x894(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x894(%rbp),%eax
add    $0x40,%eax
cltq
mov    %ecx,-0x740(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    1340 <hmac_sha1+0x230>
lea    -0x740(%rbp),%rdi
mov    -0x1c(%rbp),%esi
add    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1030 <mk_sha1@plt>
movl   $0x0,-0x894(%rbp)
cmpl   $0x40,-0x894(%rbp)
jge    13e3 <hmac_sha1+0x2d3>
movslq -0x894(%rbp),%rax
mov    -0x140(%rbp,%rax,4),%ecx
xor    -0x34(%rbp),%ecx
movslq -0x894(%rbp),%rax
mov    %ecx,-0x340(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    13a3 <hmac_sha1+0x293>
movl   $0x0,-0x894(%rbp)
cmpl   $0x40,-0x894(%rbp)
jge    142a <hmac_sha1+0x31a>
movslq -0x894(%rbp),%rax
mov    -0x340(%rbp,%rax,4),%ecx
movslq -0x894(%rbp),%rax
mov    %ecx,-0x890(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    13ed <hmac_sha1+0x2dd>
movl   $0x0,-0x894(%rbp)
cmpl   $0x14,-0x894(%rbp)
jge    1475 <hmac_sha1+0x365>
mov    -0x28(%rbp),%rax
movslq -0x894(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x894(%rbp),%eax
add    $0x40,%eax
cltq
mov    %ecx,-0x890(%rbp,%rax,4)
mov    -0x894(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x894(%rbp)
jmp    1434 <hmac_sha1+0x324>
lea    -0x890(%rbp),%rdi
mov    -0x2c(%rbp),%esi
add    $0x14,%esi
mov    -0x28(%rbp),%rdx
call   1030 <mk_sha1@plt>
add    $0x8a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac_sha1>:
push   %rbp
push   %r14
push   %rbx
sub    $0x850,%rsp
mov    %r8,%rbx
mov    %ecx,%ebp
mov    %rdx,%r14
mov    %rdi,%rax
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xf0(%rsp)
cmp    $0x40,%esi
jne    11af <hmac_sha1+0x8f>
mov    %rsp,%rdi
mov    $0x100,%edx
jmp    11f6 <hmac_sha1+0xd6>
jle    11e9 <hmac_sha1+0xc9>
mov    %rax,%rdi
mov    %rbx,%rdx
call   1040 <mk_sha1@plt>
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm1
movups 0x20(%rbx),%xmm2
movups 0x30(%rbx),%xmm3
movaps %xmm0,(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm2,0x20(%rsp)
movaps %xmm3,0x30(%rsp)
movups 0x40(%rbx),%xmm0
movaps %xmm0,0x40(%rsp)
jmp    11fe <hmac_sha1+0xde>
test   %esi,%esi
jle    11fe <hmac_sha1+0xde>
mov    %esi,%edx
shl    $0x2,%rdx
mov    %rsp,%rdi
mov    %rax,%rsi
call   1030 <memcpy@plt>
movaps 0xdfb(%rip),%xmm0
movaps (%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x200(%rsp)
movaps 0x10(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x210(%rsp)
movaps 0x20(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x220(%rsp)
movaps 0x30(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x230(%rsp)
movaps 0x40(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x240(%rsp)
movaps 0x50(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x250(%rsp)
movaps 0x60(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x260(%rsp)
movaps 0x70(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x270(%rsp)
movaps 0x80(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x280(%rsp)
movaps 0x90(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x290(%rsp)
movaps 0xa0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x2a0(%rsp)
movaps 0xb0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x2b0(%rsp)
movaps 0xc0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x2c0(%rsp)
movaps 0xd0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x2d0(%rsp)
movaps 0xe0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x2e0(%rsp)
xorps  0xf0(%rsp),%xmm0
movaps %xmm0,0x2f0(%rsp)
lea    0x450(%rsp),%rdi
lea    0x200(%rsp),%rsi
mov    $0x100,%edx
call   1030 <memcpy@plt>
test   %ebp,%ebp
jle    134d <hmac_sha1+0x22d>
lea    0x550(%rsp),%rdi
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %r14,%rsi
call   1030 <memcpy@plt>
add    $0x40,%ebp
lea    0x450(%rsp),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1040 <mk_sha1@plt>
movaps 0xca7(%rip),%xmm0
movaps (%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x100(%rsp)
movaps 0x10(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x110(%rsp)
movaps 0x20(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x120(%rsp)
movaps 0x30(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x130(%rsp)
movaps 0x40(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x140(%rsp)
movaps 0x50(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x150(%rsp)
movaps 0x60(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x160(%rsp)
movaps 0x70(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x170(%rsp)
movaps 0x80(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x180(%rsp)
movaps 0x90(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x190(%rsp)
movaps 0xa0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x1a0(%rsp)
movaps 0xb0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x1b0(%rsp)
movaps 0xc0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x1c0(%rsp)
movaps 0xd0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x1d0(%rsp)
movaps 0xe0(%rsp),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x1e0(%rsp)
xorps  0xf0(%rsp),%xmm0
movaps %xmm0,0x1f0(%rsp)
lea    0x300(%rsp),%rbp
lea    0x100(%rsp),%rsi
mov    $0x100,%edx
mov    %rbp,%rdi
call   1030 <memcpy@plt>
movups (%rbx),%xmm0
movups 0x10(%rbx),%xmm1
movups 0x20(%rbx),%xmm2
movups 0x30(%rbx),%xmm3
movaps %xmm0,0x400(%rsp)
movaps %xmm1,0x410(%rsp)
movaps %xmm2,0x420(%rsp)
movaps %xmm3,0x430(%rsp)
movups 0x40(%rbx),%xmm0
movaps %xmm0,0x440(%rsp)
mov    %rbp,%rdi
mov    $0x54,%esi
mov    %rbx,%rdx
call   1040 <mk_sha1@plt>
add    $0x850,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @hmac_sha1(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [64 x i32]
%15 = alloca [64 x i32]
%16 = alloca [64 x i32]
%17 = alloca [256 x i32]
%18 = alloca [84 x i32]
%19 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
store i32 64, i32* %11
store i32 54, i32* %12
store i32 92, i32* %13
store i32 0, i32* %19
br label %20
20: ; preds = %27, %5
%21 = load i32, i32* %19
%22 = icmp slt i32 %21, 64
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = load i32, i32* %19
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [64 x i32], [64 x i32]* %14, i64 0, i64 %25
store i32 0, i32* %26
br label %27
27: ; preds = %23
%28 = load i32, i32* %19
%29 = add nsw i32 %28, 1
store i32 %29, i32* %19
br label %20
30: ; preds = %20
%31 = load i32, i32* %7
%32 = load i32, i32* %11
%33 = icmp ne i32 %31, %32
br i1 %33, label %34, label %83
34: ; preds = %30
%35 = load i32, i32* %7
%36 = load i32, i32* %11
%37 = icmp sgt i32 %35, %36
br i1 %37, label %38, label %59
38: ; preds = %34
%39 = load i32*, i32** %6
%40 = load i32, i32* %7
%41 = load i32*, i32** %10
%42 = call i32 @mk_sha1(i32* %39, i32 %40, i32* %41)
store i32 0, i32* %19
br label %43
43: ; preds = %55, %38
%44 = load i32, i32* %19
%45 = icmp slt i32 %44, 20
br i1 %45, label %46, label %58
46: ; preds = %43
%47 = load i32*, i32** %10
%48 = load i32, i32* %19
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32, i32* %47, i64 %49
%51 = load i32, i32* %50
%52 = load i32, i32* %19
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [64 x i32], [64 x i32]* %14, i64 0, i64 %53
store i32 %51, i32* %54
br label %55
55: ; preds = %46
%56 = load i32, i32* %19
%57 = add nsw i32 %56, 1
store i32 %57, i32* %19
br label %43
58: ; preds = %43
br label %82
59: ; preds = %34
%60 = load i32, i32* %7
%61 = load i32, i32* %11
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %81
63: ; preds = %59
store i32 0, i32* %19
br label %64
64: ; preds = %77, %63
%65 = load i32, i32* %19
%66 = load i32, i32* %7
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %80
68: ; preds = %64
%69 = load i32*, i32** %6
%70 = load i32, i32* %19
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %69, i64 %71
%73 = load i32, i32* %72
%74 = load i32, i32* %19
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [64 x i32], [64 x i32]* %14, i64 0, i64 %75
store i32 %73, i32* %76
br label %77
77: ; preds = %68
%78 = load i32, i32* %19
%79 = add nsw i32 %78, 1
store i32 %79, i32* %19
br label %64
80: ; preds = %64
br label %81
81: ; preds = %80, %59
br label %82
82: ; preds = %81, %58
br label %101
83: ; preds = %30
store i32 0, i32* %19
br label %84
84: ; preds = %97, %83
%85 = load i32, i32* %19
%86 = load i32, i32* %11
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %100
88: ; preds = %84
%89 = load i32*, i32** %6
%90 = load i32, i32* %19
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %89, i64 %91
%93 = load i32, i32* %92
%94 = load i32, i32* %19
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [64 x i32], [64 x i32]* %14, i64 0, i64 %95
store i32 %93, i32* %96
br label %97
97: ; preds = %88
%98 = load i32, i32* %19
%99 = add nsw i32 %98, 1
store i32 %99, i32* %19
br label %84
100: ; preds = %84
br label %101
101: ; preds = %100, %82
store i32 0, i32* %19
br label %102
102: ; preds = %115, %101
%103 = load i32, i32* %19
%104 = icmp slt i32 %103, 64
br i1 %104, label %105, label %118
105: ; preds = %102
%106 = load i32, i32* %19
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [64 x i32], [64 x i32]* %14, i64 0, i64 %107
%109 = load i32, i32* %108
%110 = load i32, i32* %12
%111 = xor i32 %109, %110
%112 = load i32, i32* %19
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [64 x i32], [64 x i32]* %15, i64 0, i64 %113
store i32 %111, i32* %114
br label %115
115: ; preds = %105
%116 = load i32, i32* %19
%117 = add nsw i32 %116, 1
store i32 %117, i32* %19
br label %102
118: ; preds = %102
store i32 0, i32* %19
br label %119
119: ; preds = %130, %118
%120 = load i32, i32* %19
%121 = icmp slt i32 %120, 64
br i1 %121, label %122, label %133
122: ; preds = %119
%123 = load i32, i32* %19
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [64 x i32], [64 x i32]* %15, i64 0, i64 %124
%126 = load i32, i32* %125
%127 = load i32, i32* %19
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [256 x i32], [256 x i32]* %17, i64 0, i64 %128
store i32 %126, i32* %129
br label %130
130: ; preds = %122
%131 = load i32, i32* %19
%132 = add nsw i32 %131, 1
store i32 %132, i32* %19
br label %119
133: ; preds = %119
store i32 0, i32* %19
br label %134
134: ; preds = %148, %133
%135 = load i32, i32* %19
%136 = load i32, i32* %9
%137 = icmp slt i32 %135, %136
br i1 %137, label %138, label %151
138: ; preds = %134
%139 = load i32*, i32** %8
%140 = load i32, i32* %19
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i32, i32* %139, i64 %141
%143 = load i32, i32* %142
%144 = load i32, i32* %19
%145 = add nsw i32 %144, 64
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [256 x i32], [256 x i32]* %17, i64 0, i64 %146
store i32 %143, i32* %147
br label %148
148: ; preds = %138
%149 = load i32, i32* %19
%150 = add nsw i32 %149, 1
store i32 %150, i32* %19
br label %134
151: ; preds = %134
%152 = getelementptr inbounds [256 x i32], [256 x i32]* %17, i64 0, i64 0
%153 = load i32, i32* %9
%154 = load i32, i32* %11
%155 = add nsw i32 %153, %154
%156 = load i32*, i32** %10
%157 = call i32 @mk_sha1(i32* %152, i32 %155, i32* %156)
store i32 0, i32* %19
br label %158
158: ; preds = %171, %151
%159 = load i32, i32* %19
%160 = icmp slt i32 %159, 64
br i1 %160, label %161, label %174
161: ; preds = %158
%162 = load i32, i32* %19
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [64 x i32], [64 x i32]* %14, i64 0, i64 %163
%165 = load i32, i32* %164
%166 = load i32, i32* %13
%167 = xor i32 %165, %166
%168 = load i32, i32* %19
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [64 x i32], [64 x i32]* %16, i64 0, i64 %169
store i32 %167, i32* %170
br label %171
171: ; preds = %161
%172 = load i32, i32* %19
%173 = add nsw i32 %172, 1
store i32 %173, i32* %19
br label %158
174: ; preds = %158
store i32 0, i32* %19
br label %175
175: ; preds = %186, %174
%176 = load i32, i32* %19
%177 = icmp slt i32 %176, 64
br i1 %177, label %178, label %189
178: ; preds = %175
%179 = load i32, i32* %19
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [64 x i32], [64 x i32]* %16, i64 0, i64 %180
%182 = load i32, i32* %181
%183 = load i32, i32* %19
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds [84 x i32], [84 x i32]* %18, i64 0, i64 %184
store i32 %182, i32* %185
br label %186
186: ; preds = %178
%187 = load i32, i32* %19
%188 = add nsw i32 %187, 1
store i32 %188, i32* %19
br label %175
189: ; preds = %175
store i32 0, i32* %19
br label %190
190: ; preds = %203, %189
%191 = load i32, i32* %19
%192 = icmp slt i32 %191, 20
br i1 %192, label %193, label %206
193: ; preds = %190
%194 = load i32*, i32** %10
%195 = load i32, i32* %19
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i32, i32* %194, i64 %196
%198 = load i32, i32* %197
%199 = load i32, i32* %19
%200 = add nsw i32 %199, 64
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [84 x i32], [84 x i32]* %18, i64 0, i64 %201
store i32 %198, i32* %202
br label %203
203: ; preds = %193
%204 = load i32, i32* %19
%205 = add nsw i32 %204, 1
store i32 %205, i32* %19
br label %190
206: ; preds = %190
%207 = getelementptr inbounds [84 x i32], [84 x i32]* %18, i64 0, i64 0
%208 = load i32, i32* %11
%209 = add nsw i32 %208, 20
%210 = load i32*, i32** %10
%211 = call i32 @mk_sha1(i32* %207, i32 %209, i32* %210)
ret void
}

LLVM IR (-O2):
define void @hmac_sha1(i32* %0, i32 %1, i32* nocapture %2, i32 %3, i32* %4) {
%6 = bitcast i32* %0 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %2 to i8*
%9 = alloca [64 x i32]
%10 = bitcast [64 x i32]* %9 to i8*
%11 = alloca [64 x i32]
%12 = bitcast [64 x i32]* %11 to i8*
%13 = alloca [64 x i32]
%14 = bitcast [64 x i32]* %13 to i8*
%15 = alloca [256 x i32]
%16 = bitcast [256 x i32]* %15 to i8*
%17 = alloca [84 x i32]
%18 = bitcast [84 x i32]* %17 to i8*
%19 = icmp eq i32 %1, 64
br i1 %19, label %20, label %21
20: ; preds = %5
br label %30
21: ; preds = %5
%22 = icmp sgt i32 %1, 64
br i1 %22, label %28, label %23
23: ; preds = %21
%24 = icmp sgt i32 %1, 0
br i1 %24, label %25, label %30
25: ; preds = %23
%26 = zext i32 %1 to i64
%27 = shl nuw nsw i64 %26, 2
br label %30
28: ; preds = %21
%29 = tail call i32 @mk_sha1(i32* %0, i32 %1, i32* %4)
br label %30
30: ; preds = %25, %28, %20, %23
%31 = bitcast [64 x i32]* %9 to <4 x i32>*
%32 = load <4 x i32>, <4 x i32>* %31
%33 = xor <4 x i32> %32, <i32 54, i32 54, i32 54, i32 54>
%34 = bitcast [64 x i32]* %11 to <4 x i32>*
store <4 x i32> %33, <4 x i32>* %34
%35 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 4
%36 = bitcast i32* %35 to <4 x i32>*
%37 = load <4 x i32>, <4 x i32>* %36
%38 = xor <4 x i32> %37, <i32 54, i32 54, i32 54, i32 54>
%39 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 4
%40 = bitcast i32* %39 to <4 x i32>*
store <4 x i32> %38, <4 x i32>* %40
%41 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 8
%42 = bitcast i32* %41 to <4 x i32>*
%43 = load <4 x i32>, <4 x i32>* %42
%44 = xor <4 x i32> %43, <i32 54, i32 54, i32 54, i32 54>
%45 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 8
%46 = bitcast i32* %45 to <4 x i32>*
store <4 x i32> %44, <4 x i32>* %46
%47 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 12
%48 = bitcast i32* %47 to <4 x i32>*
%49 = load <4 x i32>, <4 x i32>* %48
%50 = xor <4 x i32> %49, <i32 54, i32 54, i32 54, i32 54>
%51 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 12
%52 = bitcast i32* %51 to <4 x i32>*
store <4 x i32> %50, <4 x i32>* %52
%53 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 16
%54 = bitcast i32* %53 to <4 x i32>*
%55 = load <4 x i32>, <4 x i32>* %54
%56 = xor <4 x i32> %55, <i32 54, i32 54, i32 54, i32 54>
%57 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 16
%58 = bitcast i32* %57 to <4 x i32>*
store <4 x i32> %56, <4 x i32>* %58
%59 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 20
%60 = bitcast i32* %59 to <4 x i32>*
%61 = load <4 x i32>, <4 x i32>* %60
%62 = xor <4 x i32> %61, <i32 54, i32 54, i32 54, i32 54>
%63 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 20
%64 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> %62, <4 x i32>* %64
%65 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 24
%66 = bitcast i32* %65 to <4 x i32>*
%67 = load <4 x i32>, <4 x i32>* %66
%68 = xor <4 x i32> %67, <i32 54, i32 54, i32 54, i32 54>
%69 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 24
%70 = bitcast i32* %69 to <4 x i32>*
store <4 x i32> %68, <4 x i32>* %70
%71 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 28
%72 = bitcast i32* %71 to <4 x i32>*
%73 = load <4 x i32>, <4 x i32>* %72
%74 = xor <4 x i32> %73, <i32 54, i32 54, i32 54, i32 54>
%75 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 28
%76 = bitcast i32* %75 to <4 x i32>*
store <4 x i32> %74, <4 x i32>* %76
%77 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 32
%78 = bitcast i32* %77 to <4 x i32>*
%79 = load <4 x i32>, <4 x i32>* %78
%80 = xor <4 x i32> %79, <i32 54, i32 54, i32 54, i32 54>
%81 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 32
%82 = bitcast i32* %81 to <4 x i32>*
store <4 x i32> %80, <4 x i32>* %82
%83 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 36
%84 = bitcast i32* %83 to <4 x i32>*
%85 = load <4 x i32>, <4 x i32>* %84
%86 = xor <4 x i32> %85, <i32 54, i32 54, i32 54, i32 54>
%87 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 36
%88 = bitcast i32* %87 to <4 x i32>*
store <4 x i32> %86, <4 x i32>* %88
%89 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 40
%90 = bitcast i32* %89 to <4 x i32>*
%91 = load <4 x i32>, <4 x i32>* %90
%92 = xor <4 x i32> %91, <i32 54, i32 54, i32 54, i32 54>
%93 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 40
%94 = bitcast i32* %93 to <4 x i32>*
store <4 x i32> %92, <4 x i32>* %94
%95 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 44
%96 = bitcast i32* %95 to <4 x i32>*
%97 = load <4 x i32>, <4 x i32>* %96
%98 = xor <4 x i32> %97, <i32 54, i32 54, i32 54, i32 54>
%99 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 44
%100 = bitcast i32* %99 to <4 x i32>*
store <4 x i32> %98, <4 x i32>* %100
%101 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 48
%102 = bitcast i32* %101 to <4 x i32>*
%103 = load <4 x i32>, <4 x i32>* %102
%104 = xor <4 x i32> %103, <i32 54, i32 54, i32 54, i32 54>
%105 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 48
%106 = bitcast i32* %105 to <4 x i32>*
store <4 x i32> %104, <4 x i32>* %106
%107 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 52
%108 = bitcast i32* %107 to <4 x i32>*
%109 = load <4 x i32>, <4 x i32>* %108
%110 = xor <4 x i32> %109, <i32 54, i32 54, i32 54, i32 54>
%111 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 52
%112 = bitcast i32* %111 to <4 x i32>*
store <4 x i32> %110, <4 x i32>* %112
%113 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 56
%114 = bitcast i32* %113 to <4 x i32>*
%115 = load <4 x i32>, <4 x i32>* %114
%116 = xor <4 x i32> %115, <i32 54, i32 54, i32 54, i32 54>
%117 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 56
%118 = bitcast i32* %117 to <4 x i32>*
store <4 x i32> %116, <4 x i32>* %118
%119 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 60
%120 = bitcast i32* %119 to <4 x i32>*
%121 = load <4 x i32>, <4 x i32>* %120
%122 = xor <4 x i32> %121, <i32 54, i32 54, i32 54, i32 54>
%123 = getelementptr inbounds [64 x i32], [64 x i32]* %11, i64 0, i64 60
%124 = bitcast i32* %123 to <4 x i32>*
store <4 x i32> %122, <4 x i32>* %124
%125 = icmp sgt i32 %3, 0
br i1 %125, label %126, label %131
126: ; preds = %30
%127 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 64
%128 = bitcast i32* %127 to i8*
%129 = zext i32 %3 to i64
%130 = shl nuw nsw i64 %129, 2
br label %131
131: ; preds = %126, %30
%132 = getelementptr inbounds [256 x i32], [256 x i32]* %15, i64 0, i64 0
%133 = add nsw i32 %3, 64
%134 = call i32 @mk_sha1(i32* %132, i32 %133, i32* %4)
%135 = bitcast [64 x i32]* %9 to <4 x i32>*
%136 = load <4 x i32>, <4 x i32>* %135
%137 = xor <4 x i32> %136, <i32 92, i32 92, i32 92, i32 92>
%138 = bitcast [64 x i32]* %13 to <4 x i32>*
store <4 x i32> %137, <4 x i32>* %138
%139 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 4
%140 = bitcast i32* %139 to <4 x i32>*
%141 = load <4 x i32>, <4 x i32>* %140
%142 = xor <4 x i32> %141, <i32 92, i32 92, i32 92, i32 92>
%143 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 4
%144 = bitcast i32* %143 to <4 x i32>*
store <4 x i32> %142, <4 x i32>* %144
%145 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 8
%146 = bitcast i32* %145 to <4 x i32>*
%147 = load <4 x i32>, <4 x i32>* %146
%148 = xor <4 x i32> %147, <i32 92, i32 92, i32 92, i32 92>
%149 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 8
%150 = bitcast i32* %149 to <4 x i32>*
store <4 x i32> %148, <4 x i32>* %150
%151 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 12
%152 = bitcast i32* %151 to <4 x i32>*
%153 = load <4 x i32>, <4 x i32>* %152
%154 = xor <4 x i32> %153, <i32 92, i32 92, i32 92, i32 92>
%155 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 12
%156 = bitcast i32* %155 to <4 x i32>*
store <4 x i32> %154, <4 x i32>* %156
%157 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 16
%158 = bitcast i32* %157 to <4 x i32>*
%159 = load <4 x i32>, <4 x i32>* %158
%160 = xor <4 x i32> %159, <i32 92, i32 92, i32 92, i32 92>
%161 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 16
%162 = bitcast i32* %161 to <4 x i32>*
store <4 x i32> %160, <4 x i32>* %162
%163 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 20
%164 = bitcast i32* %163 to <4 x i32>*
%165 = load <4 x i32>, <4 x i32>* %164
%166 = xor <4 x i32> %165, <i32 92, i32 92, i32 92, i32 92>
%167 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 20
%168 = bitcast i32* %167 to <4 x i32>*
store <4 x i32> %166, <4 x i32>* %168
%169 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 24
%170 = bitcast i32* %169 to <4 x i32>*
%171 = load <4 x i32>, <4 x i32>* %170
%172 = xor <4 x i32> %171, <i32 92, i32 92, i32 92, i32 92>
%173 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 24
%174 = bitcast i32* %173 to <4 x i32>*
store <4 x i32> %172, <4 x i32>* %174
%175 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 28
%176 = bitcast i32* %175 to <4 x i32>*
%177 = load <4 x i32>, <4 x i32>* %176
%178 = xor <4 x i32> %177, <i32 92, i32 92, i32 92, i32 92>
%179 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 28
%180 = bitcast i32* %179 to <4 x i32>*
store <4 x i32> %178, <4 x i32>* %180
%181 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 32
%182 = bitcast i32* %181 to <4 x i32>*
%183 = load <4 x i32>, <4 x i32>* %182
%184 = xor <4 x i32> %183, <i32 92, i32 92, i32 92, i32 92>
%185 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 32
%186 = bitcast i32* %185 to <4 x i32>*
store <4 x i32> %184, <4 x i32>* %186
%187 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 36
%188 = bitcast i32* %187 to <4 x i32>*
%189 = load <4 x i32>, <4 x i32>* %188
%190 = xor <4 x i32> %189, <i32 92, i32 92, i32 92, i32 92>
%191 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 36
%192 = bitcast i32* %191 to <4 x i32>*
store <4 x i32> %190, <4 x i32>* %192
%193 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 40
%194 = bitcast i32* %193 to <4 x i32>*
%195 = load <4 x i32>, <4 x i32>* %194
%196 = xor <4 x i32> %195, <i32 92, i32 92, i32 92, i32 92>
%197 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 40
%198 = bitcast i32* %197 to <4 x i32>*
store <4 x i32> %196, <4 x i32>* %198
%199 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 44
%200 = bitcast i32* %199 to <4 x i32>*
%201 = load <4 x i32>, <4 x i32>* %200
%202 = xor <4 x i32> %201, <i32 92, i32 92, i32 92, i32 92>
%203 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 44
%204 = bitcast i32* %203 to <4 x i32>*
store <4 x i32> %202, <4 x i32>* %204
%205 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 48
%206 = bitcast i32* %205 to <4 x i32>*
%207 = load <4 x i32>, <4 x i32>* %206
%208 = xor <4 x i32> %207, <i32 92, i32 92, i32 92, i32 92>
%209 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 48
%210 = bitcast i32* %209 to <4 x i32>*
store <4 x i32> %208, <4 x i32>* %210
%211 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 52
%212 = bitcast i32* %211 to <4 x i32>*
%213 = load <4 x i32>, <4 x i32>* %212
%214 = xor <4 x i32> %213, <i32 92, i32 92, i32 92, i32 92>
%215 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 52
%216 = bitcast i32* %215 to <4 x i32>*
store <4 x i32> %214, <4 x i32>* %216
%217 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 56
%218 = bitcast i32* %217 to <4 x i32>*
%219 = load <4 x i32>, <4 x i32>* %218
%220 = xor <4 x i32> %219, <i32 92, i32 92, i32 92, i32 92>
%221 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 56
%222 = bitcast i32* %221 to <4 x i32>*
store <4 x i32> %220, <4 x i32>* %222
%223 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 60
%224 = bitcast i32* %223 to <4 x i32>*
%225 = load <4 x i32>, <4 x i32>* %224
%226 = xor <4 x i32> %225, <i32 92, i32 92, i32 92, i32 92>
%227 = getelementptr inbounds [64 x i32], [64 x i32]* %13, i64 0, i64 60
%228 = bitcast i32* %227 to <4 x i32>*
store <4 x i32> %226, <4 x i32>* %228
%229 = getelementptr inbounds [84 x i32], [84 x i32]* %17, i64 0, i64 64
%230 = bitcast i32* %229 to i8*
%231 = getelementptr inbounds [84 x i32], [84 x i32]* %17, i64 0, i64 0
%232 = call i32 @mk_sha1(i32* %231, i32 84, i32* %4)
ret void
}