#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 */
scalar_t__ mbox_property(int, unsigned int *);
unsigned execute_code(int file_desc, unsigned code, unsigned r0, unsigned r1,
                      unsigned r2, unsigned r3, unsigned r4, unsigned r5) {
  int i = 0;
  unsigned p[32];
  p[i++] = 0;
  p[i++] = 0x00000000;
  p[i++] = 0x30010;
  p[i++] = 28;
  p[i++] = 28;
  p[i++] = code;
  p[i++] = r0;
  p[i++] = r1;
  p[i++] = r2;
  p[i++] = r3;
  p[i++] = r4;
  p[i++] = r5;
  p[i++] = 0x00000000;
  p[0] = i * sizeof *p;
  if (mbox_property(file_desc, p) < 0)
    return 0;
  return p[5];
}


x86 assembly (clang, -O0):
<execute_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movl   $0x0,-0xa0(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movl   $0x0,-0xa0(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movl   $0x30010,-0xa0(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movl   $0x1c,-0xa0(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movl   $0x1c,-0xa0(%rbp,%rax,4)
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0x10(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    0x10(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    0x18(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movl   $0x0,-0xa0(%rbp,%rax,4)
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0xa0(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xa0(%rbp),%rsi
call   1030 <mbox_property@plt>
cmp    $0x0,%rax
jge    12a0 <execute_code+0x190>
movl   $0x0,-0x4(%rbp)
jmp    12a9 <execute_code+0x199>
mov    -0x8c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_code>:
sub    $0x88,%rsp
mov    0x98(%rsp),%r10d
mov    0x90(%rsp),%eax
movl   $0x1c,0x10(%rsp)
mov    %esi,0x14(%rsp)
mov    %edx,0x18(%rsp)
mov    %ecx,0x1c(%rsp)
mov    %r8d,0x20(%rsp)
mov    %r9d,0x24(%rsp)
mov    %eax,0x28(%rsp)
mov    %r10d,0x2c(%rsp)
movl   $0x0,0x30(%rsp)
movaps 0xea4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
call   1030 <mbox_property@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1176 <execute_code+0x66>
mov    0x14(%rsp),%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @execute_code(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca [32 x i32]
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 0, i32* %18
%20 = load i32, i32* %18
%21 = add nsw i32 %20, 1
store i32 %21, i32* %18
%22 = sext i32 %20 to i64
%23 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %22
store i32 0, i32* %23
%24 = load i32, i32* %18
%25 = add nsw i32 %24, 1
store i32 %25, i32* %18
%26 = sext i32 %24 to i64
%27 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %26
store i32 0, i32* %27
%28 = load i32, i32* %18
%29 = add nsw i32 %28, 1
store i32 %29, i32* %18
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %30
store i32 196624, i32* %31
%32 = load i32, i32* %18
%33 = add nsw i32 %32, 1
store i32 %33, i32* %18
%34 = sext i32 %32 to i64
%35 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %34
store i32 28, i32* %35
%36 = load i32, i32* %18
%37 = add nsw i32 %36, 1
store i32 %37, i32* %18
%38 = sext i32 %36 to i64
%39 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %38
store i32 28, i32* %39
%40 = load i32, i32* %11
%41 = load i32, i32* %18
%42 = add nsw i32 %41, 1
store i32 %42, i32* %18
%43 = sext i32 %41 to i64
%44 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %43
store i32 %40, i32* %44
%45 = load i32, i32* %12
%46 = load i32, i32* %18
%47 = add nsw i32 %46, 1
store i32 %47, i32* %18
%48 = sext i32 %46 to i64
%49 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %48
store i32 %45, i32* %49
%50 = load i32, i32* %13
%51 = load i32, i32* %18
%52 = add nsw i32 %51, 1
store i32 %52, i32* %18
%53 = sext i32 %51 to i64
%54 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %53
store i32 %50, i32* %54
%55 = load i32, i32* %14
%56 = load i32, i32* %18
%57 = add nsw i32 %56, 1
store i32 %57, i32* %18
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %58
store i32 %55, i32* %59
%60 = load i32, i32* %15
%61 = load i32, i32* %18
%62 = add nsw i32 %61, 1
store i32 %62, i32* %18
%63 = sext i32 %61 to i64
%64 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %63
store i32 %60, i32* %64
%65 = load i32, i32* %16
%66 = load i32, i32* %18
%67 = add nsw i32 %66, 1
store i32 %67, i32* %18
%68 = sext i32 %66 to i64
%69 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %68
store i32 %65, i32* %69
%70 = load i32, i32* %17
%71 = load i32, i32* %18
%72 = add nsw i32 %71, 1
store i32 %72, i32* %18
%73 = sext i32 %71 to i64
%74 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %73
store i32 %70, i32* %74
%75 = load i32, i32* %18
%76 = add nsw i32 %75, 1
store i32 %76, i32* %18
%77 = sext i32 %75 to i64
%78 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 %77
store i32 0, i32* %78
%79 = load i32, i32* %18
%80 = sext i32 %79 to i64
%81 = mul i64 %80, 4
%82 = trunc i64 %81 to i32
%83 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 0
store i32 %82, i32* %83
%84 = load i32, i32* %10
%85 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 0
%86 = call i64 @mbox_property(i32 %84, i32* %85)
%87 = icmp slt i64 %86, 0
br i1 %87, label %88, label %89
88: ; preds = %8
store i32 0, i32* %9
br label %92
89: ; preds = %8
%90 = getelementptr inbounds [32 x i32], [32 x i32]* %19, i64 0, i64 5
%91 = load i32, i32* %90
store i32 %91, i32* %9
br label %92
92: ; preds = %89, %88
%93 = load i32, i32* %9
ret i32 %93
}

LLVM IR (-O2):
define i32 @execute_code(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca [32 x i32]
%10 = bitcast [32 x i32]* %9 to i8*
%11 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%12 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 4
store i32 28, i32* %12
%13 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 5
store i32 %1, i32* %13
%14 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 6
store i32 %2, i32* %14
%15 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 7
store i32 %3, i32* %15
%16 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 8
store i32 %4, i32* %16
%17 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 9
store i32 %5, i32* %17
%18 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 10
store i32 %6, i32* %18
%19 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 11
store i32 %7, i32* %19
%20 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 12
store i32 0, i32* %20
%21 = bitcast [32 x i32]* %9 to <4 x i32>*
store <4 x i32> <i32 52, i32 0, i32 196624, i32 28>, <4 x i32>* %21
%22 = call i64 @mbox_property(i32 %0, i32* %11)
%23 = icmp slt i64 %22, 0
%24 = load i32, i32* %13
%25 = select i1 %23, i32 0, i32 %24
ret i32 %25
}