#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 */
float atof(char *);
int atoi(char *);
int /*<<< orphan*/ printf(char *, float, float);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  if (argc != 4) {
    puts("Exception: inappropriate amount of arguments!");
    puts("    Usage is tempconv lower_bound upper_bound step_size");
    return 1;
  }
  float fahr, celsius;
  int lower_bound, upper_bound;
  float step_size;
  lower_bound = atoi(argv[1]);
  upper_bound = atoi(argv[2]);
  step_size = atof(argv[3]);
  if (lower_bound > upper_bound) {
    puts("Exception: lower_bound is greater than upper_bound!");
    puts("    Usage is tempconv lower_bound upper_bound step_size");
    puts("    lower_bound must be greater than upper_bound");
    return 2;
  }
  if (step_size <= 0) {
    puts("Exception: step_size is less than or equal to zero!");
    puts("    Usage is tempconv lower_bound upper_bound step_size");
    puts("    step_size must be integer or float greater than zero");
    return 3;
  }
  fahr = lower_bound;
  puts("Fahrenheit\tCelsius");
  while (fahr <= upper_bound) {
    celsius = (5.0f / 9.0f) * fahr - 32;
    printf("%.2f\t\t%.2f\n", fahr, celsius);
    fahr += step_size;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1184 <main+0x44>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    12ab <main+0x16b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atof@plt>
movss  %xmm0,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    11f2 <main+0xb2>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
movl   $0x2,-0x4(%rbp)
jmp    12ab <main+0x16b>
xorps  %xmm0,%xmm0
ucomiss -0x24(%rbp),%xmm0
jb     122f <main+0xef>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe24(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
movl   $0x3,-0x4(%rbp)
jmp    12ab <main+0x16b>
cvtsi2ssl -0x1c(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     12a4 <main+0x164>
movss  -0x14(%rbp),%xmm0
movss  0xd9b(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xd93(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
movss  -0x24(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1245 <main+0x105>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cmp    $0x4,%edi
jne    118d <main+0x4d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%r14d
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   1040 <atof@plt>
cmp    %ebp,%r14d
jle    11a5 <main+0x65>
mov    $0x2,%ebp
lea    0xf21(%rip),%rbx
lea    0xee6(%rip),%rdi
jmp    1250 <main+0x110>
mov    $0x1,%ebp
lea    0xe9d(%rip),%rbx
lea    0xe68(%rip),%rdi
jmp    125c <main+0x11c>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    123d <main+0xfd>
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %r14d,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xf74(%rip),%rdi
call   1030 <puts@plt>
movss  0x4(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
xor    %ebp,%ebp
ucomiss %xmm1,%xmm0
jb     1269 <main+0x129>
lea    0xf63(%rip),%rbx
movss  %xmm0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
movss  %xmm1,0x4(%rsp)
mulss  0xdf2(%rip),%xmm1
addss  0xdee(%rip),%xmm1
mov    %rbx,%rdi
movss  0x4(%rsp),%xmm0
call   1050 <printf@plt>
movss  0x8(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
addss  0xc(%rsp),%xmm1
ucomiss %xmm1,%xmm0
jae    1200 <main+0xc0>
jmp    1269 <main+0x129>
mov    $0x3,%ebp
lea    0xebe(%rip),%rbx
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
lea    0xdda(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Exception: inappropriate amount of arguments!\00"
@.str.1 = [56 x i8] c" Usage is tempconv lower_bound upper_bound step_size\00"
@.str.2 = [52 x i8] c"Exception: lower_bound is greater than upper_bound!\00"
@.str.3 = [49 x i8] c" lower_bound must be greater than upper_bound\00"
@.str.4 = [52 x i8] c"Exception: step_size is less than or equal to zero!\00"
@.str.5 = [57 x i8] c" step_size must be integer or float greater than zero\00"
@.str.6 = [19 x i8] c"Fahrenheit\09Celsius\00"
@.str.7 = [12 x i8] c"%.2f\09\09%.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 4
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @puts(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %62
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %8
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %9
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 3
%27 = load i8*, i8** %26
%28 = call float @atof(i8* %27)
store float %28, float* %10
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %36
32: ; preds = %16
%33 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
store i32 2, i32* %3
br label %62
36: ; preds = %16
%37 = load float, float* %10
%38 = fcmp ole float %37, 0.000000e+00
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
%41 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%42 = call i32 @puts(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0))
store i32 3, i32* %3
br label %62
43: ; preds = %36
%44 = load i32, i32* %8
%45 = sitofp i32 %44 to float
store float %45, float* %6
%46 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %47
47: ; preds = %52, %43
%48 = load float, float* %6
%49 = load i32, i32* %9
%50 = sitofp i32 %49 to float
%51 = fcmp ole float %48, %50
br i1 %51, label %52, label %61
52: ; preds = %47
%53 = load float, float* %6
%54 = call float @llvm.fmuladd.f32(float 0x3FE1C71C80000000, float %53, float -3.200000e+01)
store float %54, float* %7
%55 = load float, float* %6
%56 = load float, float* %7
%57 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), float %55, float %56)
%58 = load float, float* %10
%59 = load float, float* %6
%60 = fadd float %59, %58
store float %60, float* %6
br label %47
61: ; preds = %47
store i32 0, i32* %3
br label %62
62: ; preds = %61, %39, %32, %13
%63 = load i32, i32* %3
ret i32 %63
}

LLVM IR (-O2):
@.str = [46 x i8] c"Exception: inappropriate amount of arguments!\00"
@.str.1 = [56 x i8] c" Usage is tempconv lower_bound upper_bound step_size\00"
@.str.2 = [52 x i8] c"Exception: lower_bound is greater than upper_bound!\00"
@.str.3 = [49 x i8] c" lower_bound must be greater than upper_bound\00"
@.str.4 = [52 x i8] c"Exception: step_size is less than or equal to zero!\00"
@.str.5 = [57 x i8] c" step_size must be integer or float greater than zero\00"
@.str.6 = [19 x i8] c"Fahrenheit\09Celsius\00"
@.str.7 = [12 x i8] c"%.2f\09\09%.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = tail call float @atof(i8* %12)
%14 = icmp sgt i32 %7, %10
br i1 %14, label %28, label %15
15: ; preds = %4
%16 = fcmp ugt float %13, 0.000000e+00
br i1 %16, label %17, label %28
17: ; preds = %15
%18 = sitofp i32 %7 to float
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%20 = sitofp i32 %10 to float
%21 = fcmp ugt float %18, %20
br i1 %21, label %39, label %22
22: ; preds = %17, %22
%23 = phi float [ %26, %22 ], [ %18, %17 ]
%24 = tail call float @llvm.fmuladd.f32(float %23, float 0x3FE1C71C80000000, float -3.200000e+01)
%25 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), float %23, float %24)
%26 = fadd float %13, %23
%27 = fcmp ugt float %26, %20
br i1 %27, label %39, label %22
28: ; preds = %15, %4
%29 = phi i8* [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), %15 ]
%30 = phi i8* [ getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), %15 ]
%31 = phi i32 [ 2, %4 ], [ 3, %15 ]
%32 = tail call i32 @puts(i8* dereferenceable(1) %29)
br label %33
33: ; preds = %28, %2
%34 = phi i8* [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), %28 ]
%35 = phi i8* [ getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %30, %28 ]
%36 = phi i32 [ 1, %2 ], [ %31, %28 ]
%37 = tail call i32 @puts(i8* dereferenceable(1) %34)
%38 = tail call i32 @puts(i8* dereferenceable(1) %35)
br label %39
39: ; preds = %22, %33, %17
%40 = phi i32 [ 0, %17 ], [ %36, %33 ], [ 0, %22 ]
ret i32 %40
}