void foo(double a[32], double b[2][32]) {
  int i;
  for (i = 0; i < 32; i++)
    a[i] = (b[0][i] > b[1][i]) ? b[0][i] : b[1][i];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    118e <foo+0x8e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
ucomisd 0x100(%rax,%rcx,8),%xmm0
jbe    1158 <foo+0x58>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    116e <foo+0x6e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  0x100(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <foo+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x200(%rsi),%rax
cmp    %rdi,%rax
jbe    1153 <foo+0x53>
lea    0x100(%rdi),%rax
cmp    %rsi,%rax
jbe    1153 <foo+0x53>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsd  (%rsi,%rax,8),%xmm0
maxsd  0x100(%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
movsd  0x8(%rsi,%rax,8),%xmm0
maxsd  0x108(%rsi,%rax,8),%xmm0
movsd  %xmm0,0x8(%rdi,%rax,8)
add    $0x2,%rax
cmp    $0x20,%rax
jne    1120 <foo+0x20>
ret
movupd (%rsi),%xmm0
movupd 0x100(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,(%rdi)
movupd 0x10(%rsi),%xmm0
movupd 0x110(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x10(%rdi)
movupd 0x20(%rsi),%xmm0
movupd 0x120(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x20(%rdi)
movupd 0x30(%rsi),%xmm0
movupd 0x130(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x30(%rdi)
movupd 0x40(%rsi),%xmm0
movupd 0x140(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x40(%rdi)
movupd 0x50(%rsi),%xmm0
movupd 0x150(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x50(%rdi)
movupd 0x60(%rsi),%xmm0
movupd 0x160(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x60(%rdi)
movupd 0x70(%rsi),%xmm0
movupd 0x170(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x70(%rdi)
movupd 0x80(%rsi),%xmm0
movupd 0x180(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x80(%rdi)
movupd 0x90(%rsi),%xmm0
movupd 0x190(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0x90(%rdi)
movupd 0xa0(%rsi),%xmm0
movupd 0x1a0(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0xa0(%rdi)
movupd 0xb0(%rsi),%xmm0
movupd 0x1b0(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0xb0(%rdi)
movupd 0xc0(%rsi),%xmm0
movupd 0x1c0(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0xc0(%rdi)
movupd 0xd0(%rsi),%xmm0
movupd 0x1d0(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0xd0(%rdi)
movupd 0xe0(%rsi),%xmm0
movupd 0x1e0(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0xe0(%rdi)
movupd 0xf0(%rsi),%xmm0
movupd 0x1f0(%rsi),%xmm1
maxpd  %xmm1,%xmm0
movupd %xmm0,0xf0(%rdi)
ret

LLVM IR (-O0):
define void @foo(double* %0, [32 x double]* %1) {
%3 = alloca double*
%4 = alloca [32 x double]*
%5 = alloca i32
store double* %0, double** %3
store [32 x double]* %1, [32 x double]** %4
store i32 0, i32* %5
br label %6
6: ; preds = %43, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 32
br i1 %8, label %9, label %46
9: ; preds = %6
%10 = load [32 x double]*, [32 x double]** %4
%11 = getelementptr inbounds [32 x double], [32 x double]* %10, i64 0
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [32 x double], [32 x double]* %11, i64 0, i64 %13
%15 = load double, double* %14
%16 = load [32 x double]*, [32 x double]** %4
%17 = getelementptr inbounds [32 x double], [32 x double]* %16, i64 1
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [32 x double], [32 x double]* %17, i64 0, i64 %19
%21 = load double, double* %20
%22 = fcmp ogt double %15, %21
br i1 %22, label %23, label %30
23: ; preds = %9
%24 = load [32 x double]*, [32 x double]** %4
%25 = getelementptr inbounds [32 x double], [32 x double]* %24, i64 0
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [32 x double], [32 x double]* %25, i64 0, i64 %27
%29 = load double, double* %28
br label %37
30: ; preds = %9
%31 = load [32 x double]*, [32 x double]** %4
%32 = getelementptr inbounds [32 x double], [32 x double]* %31, i64 1
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [32 x double], [32 x double]* %32, i64 0, i64 %34
%36 = load double, double* %35
br label %37
37: ; preds = %30, %23
%38 = phi double [ %29, %23 ], [ %36, %30 ]
%39 = load double*, double** %3
%40 = load i32, i32* %5
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %39, i64 %41
store double %38, double* %42
br label %43
43: ; preds = %37
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %6
46: ; preds = %6
ret void
}

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