int make_body(unsigned int old_entry, unsigned int new_entry,
              unsigned int vir_start, unsigned int vir_size,
              unsigned char *buf) {
  int i;
  unsigned int seed;
  unsigned char key, op, reg, *c;
  seed = ({
    long r;
    asm volatile("int $0x80" : "=a"(r) : "0"(13), "b"((long)(0)));
    r;
  });
  key = random(&seed, 255);
  op = random(&seed, 3);
  do
    reg = random(&seed, 7);
  while (reg == 4 || reg == 5);
  c = buf;
  *c++ = 0x68;
  *(unsigned int *)c = old_entry;
  c += 4;
  *c++ = 0x60;
  *c++ = 0xb8 | reg;
  *(unsigned int *)c = new_entry + 0x1e;
  c += 4;
  *c++ = 0x80;
  switch (op) {
  case 0:
    *c++ = 0x30 | reg;
    break;
  case 1:
    *c++ = 0x28 | reg;
    break;
  case 2:
    *c++ = 0x00 | reg;
    break;
  }
  *c++ = key;
  *c++ = 0x40 | reg;
  *c++ = 0x81;
  *c++ = 0xf8 | reg;
  *(unsigned int *)c = new_entry + 0x1e + vir_size;
  c += 4;
  *c++ = 0x76;
  *c++ = 0xf4;
  *c++ = 0xe8;
  *(unsigned int *)c = 2;
  c += 4;
  *c++ = 0x61;
  *c++ = 0xc3;
  c = (unsigned char *)vir_start;
  for (i = 0; i < vir_size; i++, c++)
    switch (op) {
    case 0:
      buf[0x1e + i] = *c ^ key;
      break;
    case 1:
      buf[0x1e + i] = *c + key;
      break;
    case 2:
      buf[0x1e + i] = *c - key;
      break;
    }
  return vir_size + 0x1e;
}


x86 assembly (clang, -O0):
<make_body>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%ebx
mov    $0xd,%eax
int    $0x80
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %eax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0xff,%esi
mov    $0x0,%al
call   1030 <random@plt>
mov    %al,-0x29(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <random@plt>
mov    %al,-0x2a(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1030 <random@plt>
mov    %al,-0x2b(%rbp)
movzbl -0x2b(%rbp),%ecx
mov    $0x1,%al
cmp    $0x4,%ecx
mov    %al,-0x49(%rbp)
je     119f <make_body+0x8f>
movzbl -0x2b(%rbp),%eax
cmp    $0x5,%eax
sete   %al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
test   $0x1,%al
jne    116d <make_body+0x5d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x68,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x60,(%rax)
mov    -0x2b(%rbp),%cl
or     $0xb8,%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%ecx
add    $0x1e,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x80,(%rax)
movzbl -0x2a(%rbp),%eax
mov    %eax,-0x50(%rbp)
test   %eax,%eax
je     1262 <make_body+0x152>
jmp    1240 <make_body+0x130>
mov    -0x50(%rbp),%eax
sub    $0x1,%eax
je     1281 <make_body+0x171>
jmp    1251 <make_body+0x141>
mov    -0x50(%rbp),%eax
sub    $0x2,%eax
je     12a0 <make_body+0x190>
jmp    12ba <make_body+0x1aa>
movzbl -0x2b(%rbp),%eax
or     $0x30,%eax
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
jmp    12ba <make_body+0x1aa>
movzbl -0x2b(%rbp),%eax
or     $0x28,%eax
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
jmp    12ba <make_body+0x1aa>
movzbl -0x2b(%rbp),%eax
or     $0x0,%eax
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
mov    -0x29(%rbp),%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
movzbl -0x2b(%rbp),%eax
or     $0x40,%eax
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x81,(%rax)
movzbl -0x2b(%rbp),%eax
or     $0xf8,%eax
mov    %al,%cl
mov    -0x38(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x38(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%ecx
add    $0x1e,%ecx
add    -0x18(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x76,(%rax)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0xf4,(%rax)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0xe8,(%rax)
mov    -0x38(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0x61,(%rax)
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movb   $0xc3,(%rax)
mov    -0x14(%rbp),%eax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1477 <make_body+0x367>
movzbl -0x2a(%rbp),%eax
mov    %eax,-0x54(%rbp)
test   %eax,%eax
je     13f1 <make_body+0x2e1>
jmp    13cf <make_body+0x2bf>
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
je     1415 <make_body+0x305>
jmp    13e0 <make_body+0x2d0>
mov    -0x54(%rbp),%eax
sub    $0x2,%eax
je     1439 <make_body+0x329>
jmp    1458 <make_body+0x348>
mov    -0x38(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x29(%rbp),%ecx
xor    %ecx,%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1e,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1458 <make_body+0x348>
mov    -0x38(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x29(%rbp),%ecx
add    %ecx,%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1e,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1458 <make_body+0x348>
mov    -0x38(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x29(%rbp),%ecx
sub    %ecx,%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1e,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    145d <make_body+0x34d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    13af <make_body+0x29f>
mov    -0x18(%rbp),%eax
add    $0x1e,%eax
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_body>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%rbp
mov    %ecx,%r14d
mov    %edx,0xc(%rsp)
mov    %esi,%r13d
mov    %edi,0x10(%rsp)
mov    $0xd,%eax
xor    %ebx,%ebx
int    $0x80
mov    %eax,0x14(%rsp)
lea    0x14(%rsp),%r12
mov    %r12,%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%r15d
mov    %r12,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ecx
and    $0xfe,%ecx
cmp    $0x4,%ecx
je     1170 <make_body+0x60>
movb   $0x68,0x0(%rbp)
mov    0x10(%rsp),%ecx
mov    %ecx,0x1(%rbp)
movb   $0x60,0x5(%rbp)
mov    %eax,%ecx
or     $0xb8,%cl
mov    %cl,0x6(%rbp)
add    $0x1e,%r13d
mov    %r13d,0x7(%rbp)
movb   $0x80,0xb(%rbp)
mov    %eax,%edx
cmp    $0x2,%bl
je     11cb <make_body+0xbb>
cmp    $0x1,%bl
je     11c6 <make_body+0xb6>
test   %bl,%bl
jne    11d4 <make_body+0xc4>
mov    %eax,%edx
or     $0x30,%dl
jmp    11cb <make_body+0xbb>
mov    %eax,%edx
or     $0x28,%dl
lea    0xd(%rbp),%rcx
mov    %dl,0xc(%rbp)
jmp    11d8 <make_body+0xc8>
lea    0xc(%rbp),%rcx
mov    %r15b,(%rcx)
mov    %eax,%edx
or     $0x40,%dl
mov    %dl,0x1(%rcx)
movb   $0x81,0x2(%rcx)
or     $0xf8,%al
mov    %al,0x3(%rcx)
add    %r14d,%r13d
mov    %r13d,0x4(%rcx)
movw   $0xf476,0x8(%rcx)
movb   $0xe8,0xa(%rcx)
movl   $0x2,0xb(%rcx)
movw   $0xc361,0xf(%rcx)
test   %r14d,%r14d
je     1259 <make_body+0x149>
mov    0xc(%rsp),%esi
mov    %r14d,%ecx
xor    %edx,%edx
jmp    1234 <make_body+0x124>
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%eax
sub    %r15b,%al
mov    %al,0x1e(%rbp,%rdx,1)
add    $0x1,%rdx
cmp    %rdx,%rcx
je     1259 <make_body+0x149>
cmp    $0x2,%bl
je     1220 <make_body+0x110>
cmp    $0x1,%bl
je     1250 <make_body+0x140>
test   %bl,%bl
jne    122b <make_body+0x11b>
movzbl (%rsi,%rdx,1),%eax
xor    %r15b,%al
jmp    1227 <make_body+0x117>
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%eax
add    %r15b,%al
jmp    1227 <make_body+0x117>
add    $0x1e,%r14d
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @make_body(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i64
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%19 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 13, i64 0)
store i64 %19, i64* %17
%20 = load i64, i64* %17
store i64 %20, i64* %18
%21 = load i64, i64* %18
%22 = trunc i64 %21 to i32
store i32 %22, i32* %12
%23 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @random to i32 (i32*, i32, ...)*)(i32* %12, i32 255)
%24 = trunc i32 %23 to i8
store i8 %24, i8* %13
%25 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @random to i32 (i32*, i32, ...)*)(i32* %12, i32 3)
%26 = trunc i32 %25 to i8
store i8 %26, i8* %14
br label %27
27: ; preds = %38, %5
%28 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @random to i32 (i32*, i32, ...)*)(i32* %12, i32 7)
%29 = trunc i32 %28 to i8
store i8 %29, i8* %15
br label %30
30: ; preds = %27
%31 = load i8, i8* %15
%32 = zext i8 %31 to i32
%33 = icmp eq i32 %32, 4
br i1 %33, label %38, label %34
34: ; preds = %30
%35 = load i8, i8* %15
%36 = zext i8 %35 to i32
%37 = icmp eq i32 %36, 5
br label %38
38: ; preds = %34, %30
%39 = phi i1 [ true, %30 ], [ %37, %34 ]
br i1 %39, label %27, label %40
40: ; preds = %38
%41 = load i8*, i8** %10
store i8* %41, i8** %16
%42 = load i8*, i8** %16
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %16
store i8 104, i8* %42
%44 = load i32, i32* %6
%45 = load i8*, i8** %16
%46 = bitcast i8* %45 to i32*
store i32 %44, i32* %46
%47 = load i8*, i8** %16
%48 = getelementptr inbounds i8, i8* %47, i64 4
store i8* %48, i8** %16
%49 = load i8*, i8** %16
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %16
store i8 96, i8* %49
%51 = load i8, i8* %15
%52 = zext i8 %51 to i32
%53 = or i32 184, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %16
%56 = getelementptr inbounds i8, i8* %55, i32 1
store i8* %56, i8** %16
store i8 %54, i8* %55
%57 = load i32, i32* %7
%58 = add i32 %57, 30
%59 = load i8*, i8** %16
%60 = bitcast i8* %59 to i32*
store i32 %58, i32* %60
%61 = load i8*, i8** %16
%62 = getelementptr inbounds i8, i8* %61, i64 4
store i8* %62, i8** %16
%63 = load i8*, i8** %16
%64 = getelementptr inbounds i8, i8* %63, i32 1
store i8* %64, i8** %16
store i8 -128, i8* %63
%65 = load i8, i8* %14
%66 = zext i8 %65 to i32
switch i32 %66, label %88 [
i32 0, label %67
i32 1, label %74
i32 2, label %81
]
67: ; preds = %40
%68 = load i8, i8* %15
%69 = zext i8 %68 to i32
%70 = or i32 48, %69
%71 = trunc i32 %70 to i8
%72 = load i8*, i8** %16
%73 = getelementptr inbounds i8, i8* %72, i32 1
store i8* %73, i8** %16
store i8 %71, i8* %72
br label %88
74: ; preds = %40
%75 = load i8, i8* %15
%76 = zext i8 %75 to i32
%77 = or i32 40, %76
%78 = trunc i32 %77 to i8
%79 = load i8*, i8** %16
%80 = getelementptr inbounds i8, i8* %79, i32 1
store i8* %80, i8** %16
store i8 %78, i8* %79
br label %88
81: ; preds = %40
%82 = load i8, i8* %15
%83 = zext i8 %82 to i32
%84 = or i32 0, %83
%85 = trunc i32 %84 to i8
%86 = load i8*, i8** %16
%87 = getelementptr inbounds i8, i8* %86, i32 1
store i8* %87, i8** %16
store i8 %85, i8* %86
br label %88
88: ; preds = %40, %81, %74, %67
%89 = load i8, i8* %13
%90 = load i8*, i8** %16
%91 = getelementptr inbounds i8, i8* %90, i32 1
store i8* %91, i8** %16
store i8 %89, i8* %90
%92 = load i8, i8* %15
%93 = zext i8 %92 to i32
%94 = or i32 64, %93
%95 = trunc i32 %94 to i8
%96 = load i8*, i8** %16
%97 = getelementptr inbounds i8, i8* %96, i32 1
store i8* %97, i8** %16
store i8 %95, i8* %96
%98 = load i8*, i8** %16
%99 = getelementptr inbounds i8, i8* %98, i32 1
store i8* %99, i8** %16
store i8 -127, i8* %98
%100 = load i8, i8* %15
%101 = zext i8 %100 to i32
%102 = or i32 248, %101
%103 = trunc i32 %102 to i8
%104 = load i8*, i8** %16
%105 = getelementptr inbounds i8, i8* %104, i32 1
store i8* %105, i8** %16
store i8 %103, i8* %104
%106 = load i32, i32* %7
%107 = add i32 %106, 30
%108 = load i32, i32* %9
%109 = add i32 %107, %108
%110 = load i8*, i8** %16
%111 = bitcast i8* %110 to i32*
store i32 %109, i32* %111
%112 = load i8*, i8** %16
%113 = getelementptr inbounds i8, i8* %112, i64 4
store i8* %113, i8** %16
%114 = load i8*, i8** %16
%115 = getelementptr inbounds i8, i8* %114, i32 1
store i8* %115, i8** %16
store i8 118, i8* %114
%116 = load i8*, i8** %16
%117 = getelementptr inbounds i8, i8* %116, i32 1
store i8* %117, i8** %16
store i8 -12, i8* %116
%118 = load i8*, i8** %16
%119 = getelementptr inbounds i8, i8* %118, i32 1
store i8* %119, i8** %16
store i8 -24, i8* %118
%120 = load i8*, i8** %16
%121 = bitcast i8* %120 to i32*
store i32 2, i32* %121
%122 = load i8*, i8** %16
%123 = getelementptr inbounds i8, i8* %122, i64 4
store i8* %123, i8** %16
%124 = load i8*, i8** %16
%125 = getelementptr inbounds i8, i8* %124, i32 1
store i8* %125, i8** %16
store i8 97, i8* %124
%126 = load i8*, i8** %16
%127 = getelementptr inbounds i8, i8* %126, i32 1
store i8* %127, i8** %16
store i8 -61, i8* %126
%128 = load i32, i32* %8
%129 = zext i32 %128 to i64
%130 = inttoptr i64 %129 to i8*
store i8* %130, i8** %16
store i32 0, i32* %11
br label %131
131: ; preds = %178, %88
%132 = load i32, i32* %11
%133 = load i32, i32* %9
%134 = icmp ult i32 %132, %133
br i1 %134, label %135, label %183
135: ; preds = %131
%136 = load i8, i8* %14
%137 = zext i8 %136 to i32
switch i32 %137, label %177 [
i32 0, label %138
i32 1, label %151
i32 2, label %164
]
138: ; preds = %135
%139 = load i8*, i8** %16
%140 = load i8, i8* %139
%141 = zext i8 %140 to i32
%142 = load i8, i8* %13
%143 = zext i8 %142 to i32
%144 = xor i32 %141, %143
%145 = trunc i32 %144 to i8
%146 = load i8*, i8** %10
%147 = load i32, i32* %11
%148 = add nsw i32 30, %147
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8, i8* %146, i64 %149
store i8 %145, i8* %150
br label %177
151: ; preds = %135
%152 = load i8*, i8** %16
%153 = load i8, i8* %152
%154 = zext i8 %153 to i32
%155 = load i8, i8* %13
%156 = zext i8 %155 to i32
%157 = add nsw i32 %154, %156
%158 = trunc i32 %157 to i8
%159 = load i8*, i8** %10
%160 = load i32, i32* %11
%161 = add nsw i32 30, %160
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i8, i8* %159, i64 %162
store i8 %158, i8* %163
br label %177
164: ; preds = %135
%165 = load i8*, i8** %16
%166 = load i8, i8* %165
%167 = zext i8 %166 to i32
%168 = load i8, i8* %13
%169 = zext i8 %168 to i32
%170 = sub nsw i32 %167, %169
%171 = trunc i32 %170 to i8
%172 = load i8*, i8** %10
%173 = load i32, i32* %11
%174 = add nsw i32 30, %173
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8, i8* %172, i64 %175
store i8 %171, i8* %176
br label %177
177: ; preds = %135, %164, %151, %138
br label %178
178: ; preds = %177
%179 = load i32, i32* %11
%180 = add nsw i32 %179, 1
store i32 %180, i32* %11
%181 = load i8*, i8** %16
%182 = getelementptr inbounds i8, i8* %181, i32 1
store i8* %182, i8** %16
br label %131
183: ; preds = %131
%184 = load i32, i32* %9
%185 = add i32 %184, 30
ret i32 %185
}

LLVM IR (-O2):
define i32 @make_body(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 13, i64 0)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %6
%10 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @random to i32 (i32*, i32, ...)*)(i32* %6, i32 255)
%11 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @random to i32 (i32*, i32, ...)*)(i32* %6, i32 3)
br label %12
12: ; preds = %12, %5
%13 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @random to i32 (i32*, i32, ...)*)(i32* %6, i32 7)
%14 = and i32 %13, 254
%15 = icmp eq i32 %14, 4
br i1 %15, label %12, label %16
16: ; preds = %12
%17 = trunc i32 %10 to i8
%18 = trunc i32 %13 to i8
%19 = getelementptr inbounds i8, i8* %4, i64 1
store i8 104, i8* %4
%20 = bitcast i8* %19 to i32*
store i32 %0, i32* %20
%21 = getelementptr inbounds i8, i8* %4, i64 5
%22 = getelementptr inbounds i8, i8* %4, i64 6
store i8 96, i8* %21
%23 = or i8 %18, -72
%24 = getelementptr inbounds i8, i8* %4, i64 7
store i8 %23, i8* %22
%25 = add i32 %1, 30
%26 = bitcast i8* %24 to i32*
store i32 %25, i32* %26
%27 = getelementptr inbounds i8, i8* %4, i64 11
%28 = getelementptr inbounds i8, i8* %4, i64 12
store i8 -128, i8* %27
%29 = trunc i32 %11 to i8
switch i8 %29, label %37 [
i8 0, label %30
i8 1, label %32
i8 2, label %34
]
30: ; preds = %16
%31 = or i8 %18, 48
br label %34
32: ; preds = %16
%33 = or i8 %18, 40
br label %34
34: ; preds = %16, %30, %32
%35 = phi i8 [ %33, %32 ], [ %31, %30 ], [ %18, %16 ]
%36 = getelementptr inbounds i8, i8* %4, i64 13
store i8 %35, i8* %28
br label %37
37: ; preds = %34, %16
%38 = phi i8* [ %28, %16 ], [ %36, %34 ]
%39 = getelementptr inbounds i8, i8* %38, i64 1
store i8 %17, i8* %38
%40 = or i8 %18, 64
%41 = getelementptr inbounds i8, i8* %38, i64 2
store i8 %40, i8* %39
%42 = getelementptr inbounds i8, i8* %38, i64 3
store i8 -127, i8* %41
%43 = or i8 %18, -8
%44 = getelementptr inbounds i8, i8* %38, i64 4
store i8 %43, i8* %42
%45 = add i32 %25, %3
%46 = bitcast i8* %44 to i32*
store i32 %45, i32* %46
%47 = getelementptr inbounds i8, i8* %38, i64 8
%48 = getelementptr inbounds i8, i8* %38, i64 9
store i8 118, i8* %47
%49 = getelementptr inbounds i8, i8* %38, i64 10
store i8 -12, i8* %48
%50 = getelementptr inbounds i8, i8* %38, i64 11
store i8 -24, i8* %49
%51 = bitcast i8* %50 to i32*
store i32 2, i32* %51
%52 = getelementptr inbounds i8, i8* %38, i64 15
%53 = getelementptr inbounds i8, i8* %38, i64 16
store i8 97, i8* %52
store i8 -61, i8* %53
%54 = icmp eq i32 %3, 0
br i1 %54, label %79, label %55
55: ; preds = %37
%56 = zext i32 %2 to i64
%57 = inttoptr i64 %56 to i8*
%58 = zext i32 %3 to i64
br label %59
59: ; preds = %55, %75
%60 = phi i64 [ 0, %55 ], [ %76, %75 ]
%61 = phi i8* [ %57, %55 ], [ %77, %75 ]
switch i8 %29, label %75 [
i8 0, label %62
i8 1, label %65
i8 2, label %68
]
62: ; preds = %59
%63 = load i8, i8* %61
%64 = xor i8 %63, %17
br label %71
65: ; preds = %59
%66 = load i8, i8* %61
%67 = add i8 %66, %17
br label %71
68: ; preds = %59
%69 = load i8, i8* %61
%70 = sub i8 %69, %17
br label %71
71: ; preds = %68, %65, %62
%72 = phi i8 [ %64, %62 ], [ %67, %65 ], [ %70, %68 ]
%73 = add nuw nsw i64 %60, 30
%74 = getelementptr inbounds i8, i8* %4, i64 %73
store i8 %72, i8* %74
br label %75
75: ; preds = %71, %59
%76 = add nuw nsw i64 %60, 1
%77 = getelementptr inbounds i8, i8* %61, i64 1
%78 = icmp eq i64 %76, %58
br i1 %78, label %79, label %59
79: ; preds = %75, %37
%80 = add i32 %3, 30
ret i32 %80
}