#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 uint64_t;
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int join(int, char *, int *, int /*<<< orphan*/ *, int *, int, int *, int *,
         int *, int);
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
scalar_t__ strcmp(char *, char *);
int main() {
  int status = 0;
  uint64_t src_size = 7;
  uint64_t dst_size = 3;
  uint64_t offset = 0;
  int32_t *src_lnk, *src_fld;
  int32_t *dst_lnk, *dst_fld;
  uint64_t *nn_dst_fld;
  char *join_type = "sum";
  src_lnk = malloc(src_size * sizeof("int32_t"));
  src_fld = malloc(src_size * sizeof("int32_t"));
  dst_lnk = malloc(dst_size * sizeof("int32_t"));
  dst_fld = malloc(dst_size * sizeof("int32_t"));
  nn_dst_fld = malloc(dst_size * sizeof("uint64_t"));
  src_lnk[0] = 10;
  src_lnk[1] = 10;
  src_lnk[2] = 10;
  src_lnk[3] = 10;
  src_lnk[4] = 20;
  src_lnk[5] = 20;
  src_lnk[6] = 30;
  src_fld[0] = 1;
  src_fld[1] = 3;
  src_fld[2] = 5;
  src_fld[3] = 3;
  src_fld[4] = 3;
  src_fld[5] = 2;
  src_fld[6] = 1;
  dst_lnk[0] = 10;
  dst_lnk[1] = 20;
  dst_lnk[2] = 30;
  nn_dst_fld[0] = 0;
  nn_dst_fld[1] = 0;
  nn_dst_fld[2] = 0;
  if (strcmp(join_type, "sum") == 0) {
    dst_fld[0] = 0;
    dst_fld[1] = 0;
    dst_fld[2] = 0;
  } else if (strcmp(join_type, "min") == 0) {
    dst_fld[0] = 127;
    dst_fld[1] = 127;
    dst_fld[2] = 127;
  } else if (strcmp(join_type, "max") == 0) {
    dst_fld[0] = -1;
    dst_fld[1] = -1;
    dst_fld[2] = -1;
  } else if (strcmp(join_type, "min_idx") == 0 ||
             strcmp(join_type, "max_idx") == 0 ||
             strcmp(join_type, "and") == 0) {
    dst_fld[0] = -1;
    dst_fld[1] = -1;
    dst_fld[2] = -1;
  } else if (strcmp(join_type, "or") == 0) {
    dst_fld[0] = 0;
    dst_fld[1] = 0;
    dst_fld[2] = 0;
  }
  status = join(offset, join_type, src_fld, NULL, src_lnk, src_size, dst_fld,
                nn_dst_fld, dst_lnk, dst_size);
  printf("\n==================================\n");
  puts(join_type);
  int64_t i;
  for (i = 0; i < dst_size; i++) {
    printf("%d\n", dst_fld[i]);
  }
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x78,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe7d(%rip),%rax
mov    %rax,-0x50(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x28(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x18(%rbp),%rax
imul   $0x9,%rax,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x28(%rbp),%rax
movl   $0xa,0x4(%rax)
mov    -0x28(%rbp),%rax
movl   $0xa,0x8(%rax)
mov    -0x28(%rbp),%rax
movl   $0xa,0xc(%rax)
mov    -0x28(%rbp),%rax
movl   $0x14,0x10(%rax)
mov    -0x28(%rbp),%rax
movl   $0x14,0x14(%rax)
mov    -0x28(%rbp),%rax
movl   $0x1e,0x18(%rax)
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x30(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x30(%rbp),%rax
movl   $0x5,0x8(%rax)
mov    -0x30(%rbp),%rax
movl   $0x3,0xc(%rax)
mov    -0x30(%rbp),%rax
movl   $0x3,0x10(%rax)
mov    -0x30(%rbp),%rax
movl   $0x2,0x14(%rax)
mov    -0x30(%rbp),%rax
movl   $0x1,0x18(%rax)
mov    -0x38(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x38(%rbp),%rax
movl   $0x14,0x4(%rax)
mov    -0x38(%rbp),%rax
movl   $0x1e,0x8(%rax)
mov    -0x48(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x48(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x48(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    -0x50(%rbp),%rdi
lea    0xd37(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12fd <main+0x1ad>
mov    -0x40(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x40(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x40(%rbp),%rax
movl   $0x0,0x8(%rax)
jmp    143c <main+0x2ec>
mov    -0x50(%rbp),%rdi
lea    0xcfc(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    133c <main+0x1ec>
mov    -0x40(%rbp),%rax
movl   $0x7f,(%rax)
mov    -0x40(%rbp),%rax
movl   $0x7f,0x4(%rax)
mov    -0x40(%rbp),%rax
movl   $0x7f,0x8(%rax)
jmp    1437 <main+0x2e7>
mov    -0x50(%rbp),%rdi
lea    0xcc1(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    137b <main+0x22b>
mov    -0x40(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x40(%rbp),%rax
movl   $0xffffffff,0x4(%rax)
mov    -0x40(%rbp),%rax
movl   $0xffffffff,0x8(%rax)
jmp    1432 <main+0x2e2>
mov    -0x50(%rbp),%rdi
lea    0xc86(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     13c9 <main+0x279>
mov    -0x50(%rbp),%rdi
lea    0xc74(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     13c9 <main+0x279>
mov    -0x50(%rbp),%rdi
lea    0xc62(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    13ee <main+0x29e>
mov    -0x40(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x40(%rbp),%rax
movl   $0xffffffff,0x4(%rax)
mov    -0x40(%rbp),%rax
movl   $0xffffffff,0x8(%rax)
jmp    142d <main+0x2dd>
mov    -0x50(%rbp),%rdi
lea    0xc27(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1428 <main+0x2d8>
mov    -0x40(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x40(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x40(%rbp),%rax
movl   $0x0,0x8(%rax)
jmp    142d <main+0x2dd>
jmp    1432 <main+0x2e2>
jmp    1437 <main+0x2e7>
jmp    143c <main+0x2ec>
mov    -0x1c(%rbp),%edi
mov    -0x50(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    -0x40(%rbp),%rbx
mov    -0x48(%rbp),%r11
mov    -0x38(%rbp),%r10
mov    -0x18(%rbp),%eax
xor    %ecx,%ecx
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1070 <join@plt>
mov    %eax,-0x10(%rbp)
lea    0xba2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    14cb <main+0x37b>
mov    -0x40(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xb92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1498 <main+0x348>
mov    -0x10(%rbp),%eax
add    $0x78,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x38,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    $0x38,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    $0x18,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    $0x18,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    $0x1b,%edi
call   1060 <malloc@plt>
mov    %rax,%r13
movaps 0xe5d(%rip),%xmm0
movups %xmm0,(%r14)
movabs $0x1400000014,%rax
mov    %rax,0x10(%r14)
movl   $0x1e,0x18(%r14)
movaps 0xe4c(%rip),%xmm0
movups %xmm0,(%r15)
movabs $0x200000003,%rax
mov    %rax,0x10(%r15)
movl   $0x1,0x18(%r15)
movabs $0x140000000a,%rax
mov    %rax,(%r12)
movl   $0x1e,0x8(%r12)
movq   $0x0,0x0(%r13)
movl   $0x0,0x8(%r13)
lea    0xe14(%rip),%rdi
mov    %rdi,%rsi
call   1050 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
mov    %r12,(%rsp)
je     12c8 <main+0x178>
lea    0xdf6(%rip),%rdi
lea    0xdf3(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12c3 <main+0x173>
lea    0xdda(%rip),%rdi
lea    0xddb(%rip),%rsi
call   1050 <strcmp@plt>
mov    $0xffffffff,%ebp
test   %rax,%rax
je     12c8 <main+0x178>
lea    0xdbd(%rip),%rdi
lea    0xdc2(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12c8 <main+0x178>
lea    0xda5(%rip),%rdi
lea    0xdb2(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12c8 <main+0x178>
lea    0xd8d(%rip),%rdi
lea    0xda2(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12c8 <main+0x178>
lea    0xd75(%rip),%rdi
lea    0xd8e(%rip),%rsi
call   1050 <strcmp@plt>
mov    $0x0,%ebp
test   %rax,%rax
jne    12d0 <main+0x180>
jmp    12c8 <main+0x178>
mov    $0x7f,%ebp
mov    %ebp,(%rbx)
mov    %ebp,0x4(%rbx)
mov    %ebp,0x8(%rbx)
lea    0xd49(%rip),%r12
xor    %edi,%edi
mov    %r12,%rsi
mov    %r15,%rdx
xor    %ecx,%ecx
mov    %r14,%r8
mov    $0x7,%r9d
push   $0x3
push   0x8(%rsp)
push   %r13
push   %rbx
call   1070 <join@plt>
add    $0x20,%rsp
mov    %eax,%r14d
lea    0xd41(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
lea    0xd27(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"sum\00"
@.str.1 = [4 x i8] c"min\00"
@.str.2 = [4 x i8] c"max\00"
@.str.3 = [8 x i8] c"min_idx\00"
@.str.4 = [8 x i8] c"max_idx\00"
@.str.5 = [4 x i8] c"and\00"
@.str.6 = [3 x i8] c"or\00"
@.str.7 = [37 x i8] c"\0A==================================\0A\00"
@.str.8 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 7, i32* %3
store i32 3, i32* %4
store i32 0, i32* %5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = trunc i64 %15 to i32
%17 = call i32* @malloc(i32 %16)
store i32* %17, i32** %6
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 8
%21 = trunc i64 %20 to i32
%22 = call i32* @malloc(i32 %21)
store i32* %22, i32** %7
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 8
%26 = trunc i64 %25 to i32
%27 = call i32* @malloc(i32 %26)
store i32* %27, i32** %8
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 8
%31 = trunc i64 %30 to i32
%32 = call i32* @malloc(i32 %31)
store i32* %32, i32** %9
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = mul i64 %34, 9
%36 = trunc i64 %35 to i32
%37 = call i32* @malloc(i32 %36)
store i32* %37, i32** %10
%38 = load i32*, i32** %6
%39 = getelementptr inbounds i32, i32* %38, i64 0
store i32 10, i32* %39
%40 = load i32*, i32** %6
%41 = getelementptr inbounds i32, i32* %40, i64 1
store i32 10, i32* %41
%42 = load i32*, i32** %6
%43 = getelementptr inbounds i32, i32* %42, i64 2
store i32 10, i32* %43
%44 = load i32*, i32** %6
%45 = getelementptr inbounds i32, i32* %44, i64 3
store i32 10, i32* %45
%46 = load i32*, i32** %6
%47 = getelementptr inbounds i32, i32* %46, i64 4
store i32 20, i32* %47
%48 = load i32*, i32** %6
%49 = getelementptr inbounds i32, i32* %48, i64 5
store i32 20, i32* %49
%50 = load i32*, i32** %6
%51 = getelementptr inbounds i32, i32* %50, i64 6
store i32 30, i32* %51
%52 = load i32*, i32** %7
%53 = getelementptr inbounds i32, i32* %52, i64 0
store i32 1, i32* %53
%54 = load i32*, i32** %7
%55 = getelementptr inbounds i32, i32* %54, i64 1
store i32 3, i32* %55
%56 = load i32*, i32** %7
%57 = getelementptr inbounds i32, i32* %56, i64 2
store i32 5, i32* %57
%58 = load i32*, i32** %7
%59 = getelementptr inbounds i32, i32* %58, i64 3
store i32 3, i32* %59
%60 = load i32*, i32** %7
%61 = getelementptr inbounds i32, i32* %60, i64 4
store i32 3, i32* %61
%62 = load i32*, i32** %7
%63 = getelementptr inbounds i32, i32* %62, i64 5
store i32 2, i32* %63
%64 = load i32*, i32** %7
%65 = getelementptr inbounds i32, i32* %64, i64 6
store i32 1, i32* %65
%66 = load i32*, i32** %8
%67 = getelementptr inbounds i32, i32* %66, i64 0
store i32 10, i32* %67
%68 = load i32*, i32** %8
%69 = getelementptr inbounds i32, i32* %68, i64 1
store i32 20, i32* %69
%70 = load i32*, i32** %8
%71 = getelementptr inbounds i32, i32* %70, i64 2
store i32 30, i32* %71
%72 = load i32*, i32** %10
%73 = getelementptr inbounds i32, i32* %72, i64 0
store i32 0, i32* %73
%74 = load i32*, i32** %10
%75 = getelementptr inbounds i32, i32* %74, i64 1
store i32 0, i32* %75
%76 = load i32*, i32** %10
%77 = getelementptr inbounds i32, i32* %76, i64 2
store i32 0, i32* %77
%78 = load i8*, i8** %11
%79 = call i64 @strcmp(i8* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %88
81: ; preds = %0
%82 = load i32*, i32** %9
%83 = getelementptr inbounds i32, i32* %82, i64 0
store i32 0, i32* %83
%84 = load i32*, i32** %9
%85 = getelementptr inbounds i32, i32* %84, i64 1
store i32 0, i32* %85
%86 = load i32*, i32** %9
%87 = getelementptr inbounds i32, i32* %86, i64 2
store i32 0, i32* %87
br label %144
88: ; preds = %0
%89 = load i8*, i8** %11
%90 = call i64 @strcmp(i8* %89, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %99
92: ; preds = %88
%93 = load i32*, i32** %9
%94 = getelementptr inbounds i32, i32* %93, i64 0
store i32 127, i32* %94
%95 = load i32*, i32** %9
%96 = getelementptr inbounds i32, i32* %95, i64 1
store i32 127, i32* %96
%97 = load i32*, i32** %9
%98 = getelementptr inbounds i32, i32* %97, i64 2
store i32 127, i32* %98
br label %143
99: ; preds = %88
%100 = load i8*, i8** %11
%101 = call i64 @strcmp(i8* %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %110
103: ; preds = %99
%104 = load i32*, i32** %9
%105 = getelementptr inbounds i32, i32* %104, i64 0
store i32 -1, i32* %105
%106 = load i32*, i32** %9
%107 = getelementptr inbounds i32, i32* %106, i64 1
store i32 -1, i32* %107
%108 = load i32*, i32** %9
%109 = getelementptr inbounds i32, i32* %108, i64 2
store i32 -1, i32* %109
br label %142
110: ; preds = %99
%111 = load i8*, i8** %11
%112 = call i64 @strcmp(i8* %111, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%113 = icmp eq i64 %112, 0
br i1 %113, label %122, label %114
114: ; preds = %110
%115 = load i8*, i8** %11
%116 = call i64 @strcmp(i8* %115, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%117 = icmp eq i64 %116, 0
br i1 %117, label %122, label %118
118: ; preds = %114
%119 = load i8*, i8** %11
%120 = call i64 @strcmp(i8* %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %129
122: ; preds = %118, %114, %110
%123 = load i32*, i32** %9
%124 = getelementptr inbounds i32, i32* %123, i64 0
store i32 -1, i32* %124
%125 = load i32*, i32** %9
%126 = getelementptr inbounds i32, i32* %125, i64 1
store i32 -1, i32* %126
%127 = load i32*, i32** %9
%128 = getelementptr inbounds i32, i32* %127, i64 2
store i32 -1, i32* %128
br label %141
129: ; preds = %118
%130 = load i8*, i8** %11
%131 = call i64 @strcmp(i8* %130, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%132 = icmp eq i64 %131, 0
br i1 %132, label %133, label %140
133: ; preds = %129
%134 = load i32*, i32** %9
%135 = getelementptr inbounds i32, i32* %134, i64 0
store i32 0, i32* %135
%136 = load i32*, i32** %9
%137 = getelementptr inbounds i32, i32* %136, i64 1
store i32 0, i32* %137
%138 = load i32*, i32** %9
%139 = getelementptr inbounds i32, i32* %138, i64 2
store i32 0, i32* %139
br label %140
140: ; preds = %133, %129
br label %141
141: ; preds = %140, %122
br label %142
142: ; preds = %141, %103
br label %143
143: ; preds = %142, %92
br label %144
144: ; preds = %143, %81
%145 = load i32, i32* %5
%146 = load i8*, i8** %11
%147 = load i32*, i32** %7
%148 = load i32*, i32** %6
%149 = load i32, i32* %3
%150 = load i32*, i32** %9
%151 = load i32*, i32** %10
%152 = load i32*, i32** %8
%153 = load i32, i32* %4
%154 = call i32 @join(i32 %145, i8* %146, i32* %147, i32* null, i32* %148, i32 %149, i32* %150, i32* %151, i32* %152, i32 %153)
store i32 %154, i32* %2
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
%156 = load i8*, i8** %11
%157 = call i32 @puts(i8* %156)
store i32 0, i32* %12
br label %158
158: ; preds = %169, %144
%159 = load i32, i32* %12
%160 = load i32, i32* %4
%161 = icmp slt i32 %159, %160
br i1 %161, label %162, label %172
162: ; preds = %158
%163 = load i32*, i32** %9
%164 = load i32, i32* %12
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds i32, i32* %163, i64 %165
%167 = load i32, i32* %166
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %167)
br label %169
169: ; preds = %162
%170 = load i32, i32* %12
%171 = add nsw i32 %170, 1
store i32 %171, i32* %12
br label %158
172: ; preds = %158
%173 = load i32, i32* %2
ret i32 %173
}

LLVM IR (-O2):
@.str = [4 x i8] c"sum\00"
@.str.1 = [4 x i8] c"min\00"
@.str.2 = [4 x i8] c"max\00"
@.str.3 = [8 x i8] c"min_idx\00"
@.str.4 = [8 x i8] c"max_idx\00"
@.str.5 = [4 x i8] c"and\00"
@.str.6 = [3 x i8] c"or\00"
@.str.8 = [4 x i8] c"%d\0A\00"
@str = [36 x i8] c"\0A==================================\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 56)
%2 = tail call i32* @malloc(i32 56)
%3 = tail call i32* @malloc(i32 24)
%4 = tail call i32* @malloc(i32 24)
%5 = tail call i32* @malloc(i32 27)
%6 = bitcast i32* %1 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 10, i32 10>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %1, i64 4
store i32 20, i32* %7
%8 = getelementptr inbounds i32, i32* %1, i64 5
store i32 20, i32* %8
%9 = getelementptr inbounds i32, i32* %1, i64 6
store i32 30, i32* %9
%10 = bitcast i32* %2 to <4 x i32>*
store <4 x i32> <i32 1, i32 3, i32 5, i32 3>, <4 x i32>* %10
%11 = getelementptr inbounds i32, i32* %2, i64 4
store i32 3, i32* %11
%12 = getelementptr inbounds i32, i32* %2, i64 5
store i32 2, i32* %12
%13 = getelementptr inbounds i32, i32* %2, i64 6
store i32 1, i32* %13
store i32 10, i32* %3
%14 = getelementptr inbounds i32, i32* %3, i64 1
store i32 20, i32* %14
%15 = getelementptr inbounds i32, i32* %3, i64 2
store i32 30, i32* %15
store i32 0, i32* %5
%16 = getelementptr inbounds i32, i32* %5, i64 1
store i32 0, i32* %16
%17 = getelementptr inbounds i32, i32* %5, i64 2
store i32 0, i32* %17
%18 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %38, label %20
20: ; preds = %0
%21 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %38, label %23
23: ; preds = %20
%24 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %38, label %26
26: ; preds = %23
%27 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %38, label %29
29: ; preds = %26
%30 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %38, label %32
32: ; preds = %29
%33 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %35, %26, %29, %32, %23, %20, %0
%39 = phi i32 [ 0, %0 ], [ 127, %20 ], [ -1, %23 ], [ -1, %32 ], [ -1, %29 ], [ -1, %26 ], [ 0, %35 ]
store i32 %39, i32* %4
%40 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %39, i32* %40
%41 = getelementptr inbounds i32, i32* %4, i64 2
store i32 %39, i32* %41
br label %42
42: ; preds = %38, %35
%43 = tail call i32 @join(i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2, i32* null, i32* %1, i32 7, i32* %4, i32* %5, i32* %3, i32 3)
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%46 = load i32, i32* %4
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds i32, i32* %4, i64 1
%49 = load i32, i32* %48
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %49)
%51 = getelementptr inbounds i32, i32* %4, i64 2
%52 = load i32, i32* %51
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %52)
ret i32 %43
}