#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 */
int /*<<< orphan*/ printf(char *, int, int, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float data[10][31];
  int i, j;
  float high = 0, low = 1000;
  int h_c = 0, h_d = 0;
  int l_c = 0, l_d = 0;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 31; j++) {
      printf("Enter the Temp. on Day %d of City %d: ", j + 1, i + 1);
      scanf("%f", &data[i][j]);
      if (data[i][j] > high) {
        high = data[i][j];
        h_c = i + 1;
        h_d = j + 1;
      }
      if (data[i][j] < low) {
        low = data[i][j];
        l_c = i + 1;
        l_d = j + 1;
      }
    }
  }
  printf("MAX: City =%d Day=%d Temp= %.2f \n", h_c, h_d, high);
  printf("MIN: City =%d Day=%d Temp= %.2f \n", l_c, l_d, low);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x500,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4ec(%rbp)
ff
movss  0xebb(%rip),%xmm0
movss  %xmm0,-0x4f0(%rbp)
ff
movl   $0x0,-0x4f4(%rbp)
movl   $0x0,-0x4f8(%rbp)
movl   $0x0,-0x4fc(%rbp)
movl   $0x0,-0x500(%rbp)
movl   $0x0,-0x4e4(%rbp)
cmpl   $0xa,-0x4e4(%rbp)
jge    1312 <main+0x1f2>
movl   $0x0,-0x4e8(%rbp)
cmpl   $0x1f,-0x4e8(%rbp)
jge    12f9 <main+0x1d9>
mov    -0x4e8(%rbp),%esi
add    $0x1,%esi
mov    -0x4e4(%rbp),%edx
add    $0x1,%edx
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x4e4(%rbp),%rax
lea    -0x4e0(%rbp),%rsi
imul   $0x7c,%rax,%rax
add    %rax,%rsi
movslq -0x4e8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe3e(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x4e4(%rbp),%rcx
lea    -0x4e0(%rbp),%rax
imul   $0x7c,%rcx,%rcx
add    %rcx,%rax
movslq -0x4e8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss -0x4ec(%rbp),%xmm0
jbe    1267 <main+0x147>
movslq -0x4e4(%rbp),%rcx
lea    -0x4e0(%rbp),%rax
imul   $0x7c,%rcx,%rcx
add    %rcx,%rax
movslq -0x4e8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4ec(%rbp)
ff
mov    -0x4e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4f4(%rbp)
mov    -0x4e8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4f8(%rbp)
movslq -0x4e4(%rbp),%rcx
lea    -0x4e0(%rbp),%rax
imul   $0x7c,%rcx,%rcx
add    %rcx,%rax
movslq -0x4e8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0x4f0(%rbp),%xmm0
ff
ucomiss %xmm1,%xmm0
jbe    12e0 <main+0x1c0>
movslq -0x4e4(%rbp),%rcx
lea    -0x4e0(%rbp),%rax
imul   $0x7c,%rcx,%rcx
add    %rcx,%rax
movslq -0x4e8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x4f0(%rbp)
ff
mov    -0x4e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4fc(%rbp)
mov    -0x4e8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x500(%rbp)
jmp    12e5 <main+0x1c5>
mov    -0x4e8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e8(%rbp)
jmp    1196 <main+0x76>
jmp    12fe <main+0x1de>
mov    -0x4e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4e4(%rbp)
jmp    117f <main+0x5f>
mov    -0x4f4(%rbp),%esi
mov    -0x4f8(%rbp),%edx
movss  -0x4ec(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xcfd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4fc(%rbp),%esi
mov    -0x500(%rbp),%edx
movss  -0x4f0(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xcf9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x500,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x508,%rsp
xorps  %xmm0,%xmm0
movss  0xec4(%rip),%xmm1
lea    0x30(%rsp),%r13
lea    0xebc(%rip),%rbp
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %ebx,%ebx
xor    %r12d,%r12d
xor    %edx,%edx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
addq   $0x1,0x10(%rsp)
mov    $0xffffffffffffffe1,%r14
mov    %r13,0x28(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,0xc(%rsp)
mov    %esi,0x24(%rsp)
mov    %edx,0x8(%rsp)
movss  %xmm0,0x1c(%rsp)
movss  %xmm1,0x20(%rsp)
lea    0x20(%r14),%r15d
mov    %rbp,%rdi
mov    %r15d,%esi
mov    0x10(%rsp),%rbx
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    0x24(%rsp),%esi
mov    0x8(%rsp),%edx
movss  0x0(%r13),%xmm1
movss  0x1c(%rsp),%xmm2
ucomiss %xmm2,%xmm1
cmova  %ebx,%esi
cmova  %r15d,%edx
movss  0x20(%rsp),%xmm3
ucomiss %xmm1,%xmm3
cmova  %ebx,%r12d
movaps %xmm1,%xmm0
mov    0xc(%rsp),%eax
cmova  %r15d,%eax
mov    %eax,0xc(%rsp)
mov    0xc(%rsp),%ebx
maxss  %xmm2,%xmm0
minss  %xmm3,%xmm1
add    $0x4,%r13
inc    %r14
jne    1180 <main+0x60>
mov    0x28(%rsp),%r13
add    $0x7c,%r13
cmpq   $0xa,0x10(%rsp)
jne    1160 <main+0x40>
cvtss2sd %xmm0,%xmm0
lea    0xdfc(%rip),%rdi
mov    $0x1,%al
movss  %xmm1,0x8(%rsp)
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe00(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x508,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Enter the Temp. on Day %d of City %d: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [34 x i8] c"MAX: City =%d Day=%d Temp= %.2f \0A\00"
@.str.3 = [34 x i8] c"MIN: City =%d Day=%d Temp= %.2f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [31 x float]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %5
store float 1.000000e+03, float* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %3
br label %11
11: ; preds = %79, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %82
14: ; preds = %11
store i32 0, i32* %4
br label %15
15: ; preds = %75, %14
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 31
br i1 %17, label %18, label %78
18: ; preds = %15
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
%23 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %22)
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x [31 x float]], [10 x [31 x float]]* %2, i64 0, i64 %25
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [31 x float], [31 x float]* %26, i64 0, i64 %28
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %29)
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [10 x [31 x float]], [10 x [31 x float]]* %2, i64 0, i64 %32
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [31 x float], [31 x float]* %33, i64 0, i64 %35
%37 = load float, float* %36
%38 = load float, float* %5
%39 = fcmp ogt float %37, %38
br i1 %39, label %40, label %52
40: ; preds = %18
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [10 x [31 x float]], [10 x [31 x float]]* %2, i64 0, i64 %42
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [31 x float], [31 x float]* %43, i64 0, i64 %45
%47 = load float, float* %46
store float %47, float* %5
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %8
br label %52
52: ; preds = %40, %18
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [10 x [31 x float]], [10 x [31 x float]]* %2, i64 0, i64 %54
%56 = load i32, i32* %4
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [31 x float], [31 x float]* %55, i64 0, i64 %57
%59 = load float, float* %58
%60 = load float, float* %6
%61 = fcmp olt float %59, %60
br i1 %61, label %62, label %74
62: ; preds = %52
%63 = load i32, i32* %3
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [10 x [31 x float]], [10 x [31 x float]]* %2, i64 0, i64 %64
%66 = load i32, i32* %4
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [31 x float], [31 x float]* %65, i64 0, i64 %67
%69 = load float, float* %68
store float %69, float* %6
%70 = load i32, i32* %3
%71 = add nsw i32 %70, 1
store i32 %71, i32* %9
%72 = load i32, i32* %4
%73 = add nsw i32 %72, 1
store i32 %73, i32* %10
br label %74
74: ; preds = %62, %52
br label %75
75: ; preds = %74
%76 = load i32, i32* %4
%77 = add nsw i32 %76, 1
store i32 %77, i32* %4
br label %15
78: ; preds = %15
br label %79
79: ; preds = %78
%80 = load i32, i32* %3
%81 = add nsw i32 %80, 1
store i32 %81, i32* %3
br label %11
82: ; preds = %11
%83 = load i32, i32* %7
%84 = load i32, i32* %8
%85 = load float, float* %5
%86 = fpext float %85 to double
%87 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %83, i32 %84, double %86)
%88 = load i32, i32* %9
%89 = load i32, i32* %10
%90 = load float, float* %6
%91 = fpext float %90 to double
%92 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %88, i32 %89, double %91)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Enter the Temp. on Day %d of City %d: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [34 x i8] c"MAX: City =%d Day=%d Temp= %.2f \0A\00"
@.str.3 = [34 x i8] c"MIN: City =%d Day=%d Temp= %.2f \0A\00"
define i32 @main() {
%1 = alloca [10 x [31 x float]]
%2 = bitcast [10 x [31 x float]]* %1 to i8*
br label %3
3: ; preds = %0, %36
%4 = phi i64 [ 0, %0 ], [ %11, %36 ]
%5 = phi i32 [ 0, %0 ], [ %34, %36 ]
%6 = phi i32 [ 0, %0 ], [ %33, %36 ]
%7 = phi i32 [ 0, %0 ], [ %30, %36 ]
%8 = phi i32 [ 0, %0 ], [ %29, %36 ]
%9 = phi float [ 1.000000e+03, %0 ], [ %32, %36 ]
%10 = phi float [ 0.000000e+00, %0 ], [ %28, %36 ]
%11 = add nuw nsw i64 %4, 1
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %3, %13
%14 = phi i64 [ 0, %3 ], [ %21, %13 ]
%15 = phi i32 [ %5, %3 ], [ %34, %13 ]
%16 = phi i32 [ %6, %3 ], [ %33, %13 ]
%17 = phi i32 [ %7, %3 ], [ %30, %13 ]
%18 = phi i32 [ %8, %3 ], [ %29, %13 ]
%19 = phi float [ %9, %3 ], [ %32, %13 ]
%20 = phi float [ %10, %3 ], [ %28, %13 ]
%21 = add nuw nsw i64 %14, 1
%22 = trunc i64 %21 to i32
%23 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %12)
%24 = getelementptr inbounds [10 x [31 x float]], [10 x [31 x float]]* %1, i64 0, i64 %4, i64 %14
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %24)
%26 = load float, float* %24
%27 = fcmp ogt float %26, %20
%28 = select i1 %27, float %26, float %20
%29 = select i1 %27, i32 %12, i32 %18
%30 = select i1 %27, i32 %22, i32 %17
%31 = fcmp olt float %26, %19
%32 = select i1 %31, float %26, float %19
%33 = select i1 %31, i32 %12, i32 %16
%34 = select i1 %31, i32 %22, i32 %15
%35 = icmp eq i64 %21, 31
br i1 %35, label %36, label %13
36: ; preds = %13
%37 = icmp eq i64 %11, 10
br i1 %37, label %38, label %3
38: ; preds = %36
%39 = fpext float %28 to double
%40 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %29, i32 %30, double %39)
%41 = fpext float %32 to double
%42 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %33, i32 %34, double %41)
ret i32 0
}