#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 */
double atof(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int args, char **argv) {
  if (args < 2) {
    printf("no values given\n");
    return -1;
  }
  int elements = args;
  double temp_f[elements];
  double temp_c[elements];
  int ctr = 0;
  for (ctr = 0; ctr < elements; ctr++) {
    temp_f[ctr] = atof(argv[ctr]);
    temp_c[ctr] = (temp_f[ctr] - 32) / 1.8;
  }
  printf("Temperatures in degree Celsius:\n\t");
  for (ctr = 1; ctr < elements; ctr++) {
    printf("%f, ", temp_c[ctr]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115a <main+0x3a>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1281 <main+0x161>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    121b <main+0xfb>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
mov    -0x48(%rbp),%rcx
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rdx
movsd  %xmm0,(%rcx,%rdx,8)
movslq -0x34(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
movsd  0xe14(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe00(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b5 <main+0x95>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1265 <main+0x145>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xdf3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1230 <main+0x110>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x1,%edi
jg     116a <main+0x2a>
lea    0xedd(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%r15d
jmp    1207 <main+0xc7>
mov    %rsi,%r15
mov    %edi,%ebx
mov    %rsp,-0x30(%rbp)
mov    %edi,%r13d
mov    %rsp,%r14
lea    0xf(,%r13,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
xor    %r12d,%r12d
xchg   %ax,%ax
mov    (%r15,%r12,8),%rdi
call   1050 <atof@plt>
addsd  0xe5f(%rip),%xmm0
divsd  0xe5f(%rip),%xmm0
movsd  %xmm0,(%r14,%r12,8)
add    $0x1,%r12
cmp    %r12,%r13
jne    1190 <main+0x50>
lea    0xe51(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x2,%ebx
jl     11f9 <main+0xb9>
mov    $0x1,%ebx
lea    0xe58(%rip),%r12
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    11e0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x30(%rbp),%rsp
mov    %r15d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"no values given\0A\00"
@.str.1 = [34 x i8] c"Temperatures in degree Celsius:\0A\09\00"
@.str.2 = [5 x i8] c"%f, \00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %68
15: ; preds = %2
%16 = load i32, i32* %4
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %7
%20 = alloca double, i64 %18
store i64 %18, i64* %8
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = alloca double, i64 %22
store i64 %22, i64* %9
store i32 0, i32* %10
store i32 0, i32* %10
br label %24
24: ; preds = %47, %15
%25 = load i32, i32* %10
%26 = load i32, i32* %6
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %50
28: ; preds = %24
%29 = load i8**, i8*** %5
%30 = load i32, i32* %10
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call double @atof(i8* %33)
%35 = load i32, i32* %10
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %20, i64 %36
store double %34, double* %37
%38 = load i32, i32* %10
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds double, double* %20, i64 %39
%41 = load double, double* %40
%42 = fsub double %41, 3.200000e+01
%43 = fdiv double %42, 1.800000e+00
%44 = load i32, i32* %10
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %23, i64 %45
store double %43, double* %46
br label %47
47: ; preds = %28
%48 = load i32, i32* %10
%49 = add nsw i32 %48, 1
store i32 %49, i32* %10
br label %24
50: ; preds = %24
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %10
br label %52
52: ; preds = %62, %50
%53 = load i32, i32* %10
%54 = load i32, i32* %6
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %65
56: ; preds = %52
%57 = load i32, i32* %10
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %23, i64 %58
%60 = load double, double* %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %60)
br label %62
62: ; preds = %56
%63 = load i32, i32* %10
%64 = add nsw i32 %63, 1
store i32 %64, i32* %10
br label %52
65: ; preds = %52
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
%67 = load i8*, i8** %7
br label %68
68: ; preds = %65, %13
%69 = load i32, i32* %3
ret i32 %69
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"Temperatures in degree Celsius:\0A\09\00"
@.str.2 = [5 x i8] c"%f, \00"
@str = [16 x i8] c"no values given\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %32
6: ; preds = %2
%7 = zext i32 %0 to i64
%8 = tail call i8* @llvm.stacksave()
%9 = alloca double, i64 %7
br label %10
10: ; preds = %6, %10
%11 = phi i64 [ 0, %6 ], [ %18, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call double @atof(i8* %13)
%15 = fadd double %14, -3.200000e+01
%16 = fdiv double %15, 1.800000e+00
%17 = getelementptr inbounds double, double* %9, i64 %11
store double %16, double* %17
%18 = add nuw nsw i64 %11, 1
%19 = icmp eq i64 %18, %7
br i1 %19, label %20, label %10
20: ; preds = %10
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp sgt i32 %0, 1
br i1 %22, label %23, label %30
23: ; preds = %20, %23
%24 = phi i64 [ %28, %23 ], [ 1, %20 ]
%25 = getelementptr inbounds double, double* %9, i64 %24
%26 = load double, double* %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %26)
%28 = add nuw nsw i64 %24, 1
%29 = icmp eq i64 %28, %7
br i1 %29, label %30, label %23
30: ; preds = %23, %20
%31 = tail call i32 @putchar(i32 10)
tail call void @llvm.stackrestore(i8* %8)
br label %32
32: ; preds = %30, %4
%33 = phi i32 [ -1, %4 ], [ 0, %30 ]
ret i32 %33
}