#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 getopt(int, char **, char *);
int /*<<< orphan*/ print_temperatures(int);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char **argv) {
  bool reverse = false;
  int arg = 0;
  while ((arg = getopt(argc, argv, "r")) != -1) {
    switch (arg) {
    case 'r':
      reverse = true;
      break;
    case '?':
    default:
      break;
    }
  }
  printf("%10s   %10s\n", "Celsius", "Fahrenheit");
  printf("%10s---%10s\n", "-------", "----------");
  if (reverse) {
    for (int celsius = 200; celsius >= -100; celsius -= 10)
      print_temperatures(celsius);
  } else {
    for (int celsius = -100; celsius <= 200; celsius += 10)
      print_temperatures(celsius);
  }
  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)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
je     11b3 <main+0x83>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x3f,%eax
je     11a4 <main+0x74>
jmp    1187 <main+0x57>
mov    -0x24(%rbp),%eax
sub    $0x72,%eax
jne    11a9 <main+0x79>
jmp    1198 <main+0x68>
movl   $0x1,-0x14(%rbp)
jmp    11ae <main+0x7e>
jmp    11a9 <main+0x79>
jmp    11ae <main+0x7e>
jmp    1154 <main+0x24>
lea    0xe48(%rip),%rdi
lea    0xe4e(%rip),%rsi
lea    0xe4f(%rip),%rdx
call   1040 <printf@plt>
lea    0xe4e(%rip),%rdi
lea    0xe57(%rip),%rsi
lea    0xe4d(%rip),%rdx
call   1040 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
je     121d <main+0xed>
movl   $0xc8,-0x1c(%rbp)
cmpl   $0xffffff9c,-0x1c(%rbp)
jl     1218 <main+0xe8>
mov    -0x1c(%rbp),%edi
call   1030 <print_temperatures@plt>
mov    -0x1c(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f8 <main+0xc8>
jmp    124c <main+0x11c>
movl   $0xffffff9c,-0x20(%rbp)
cmpl   $0xc8,-0x20(%rbp)
jg     1247 <main+0x117>
mov    -0x20(%rbp),%edi
call   1030 <print_temperatures@plt>
mov    -0x20(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x20(%rbp)
jmp    1224 <main+0xf4>
jmp    124c <main+0x11c>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%r15b
lea    0xeb3(%rip),%r14
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <getopt@plt>
cmp    $0x72,%eax
je     1169 <main+0x39>
cmp    $0xffffffff,%eax
jne    1150 <main+0x20>
jmp    116e <main+0x3e>
xor    %r15d,%r15d
jmp    1150 <main+0x20>
lea    0xe8d(%rip),%rdi
lea    0xe93(%rip),%rsi
lea    0xe94(%rip),%rdx
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
lea    0xe9c(%rip),%rsi
lea    0xe92(%rip),%rdx
call   1040 <printf@plt>
xor    %r9d,%r9d
test   $0x1,%r15b
mov    $0x78,%r8d
mov    $0xfffffff6,%edx
mov    $0x6e,%eax
cmovne %edx,%eax
mov    %eax,0x28(%rsp)
mov    $0xfffffff6,%edi
mov    $0x64,%ebp
mov    $0xa,%edx
mov    $0x5a,%eax
cmovne %edx,%eax
mov    %eax,0x24(%rsp)
mov    $0xa,%ebx
mov    $0x1e,%ecx
mov    $0x46,%eax
cmovne %ecx,%eax
mov    %eax,0x20(%rsp)
mov    $0x50,%r10d
mov    $0x28,%eax
mov    $0x3c,%esi
mov    $0x3c,%edx
cmovne %eax,%edx
mov    %edx,0x1c(%rsp)
cmovne %esi,%eax
mov    %eax,0x2c(%rsp)
mov    $0x46,%esi
cmovne %esi,%ecx
mov    %ecx,0x30(%rsp)
mov    $0x50,%ecx
mov    $0x14,%eax
cmovne %eax,%ecx
mov    %ecx,0x18(%rsp)
cmovne %r10d,%eax
mov    %eax,0x34(%rsp)
mov    $0x5a,%edx
cmovne %edx,%ebx
mov    %ebx,0x38(%rsp)
mov    $0x64,%eax
cmovne %r9d,%eax
mov    %eax,0x14(%rsp)
cmove  %r9d,%ebp
mov    %ebp,0x3c(%rsp)
mov    $0x6e,%eax
cmovne %eax,%edi
mov    %edi,0x40(%rsp)
mov    $0x78,%ecx
mov    $0xffffffec,%eax
cmovne %eax,%ecx
mov    %ecx,0x10(%rsp)
cmovne %r8d,%eax
mov    %eax,0x48(%rsp)
mov    $0xffffffe2,%ecx
mov    $0x82,%eax
cmovne %ecx,%eax
mov    %eax,0xc(%rsp)
mov    $0x82,%eax
cmovne %eax,%ecx
mov    %ecx,0x44(%rsp)
mov    $0xffffffd8,%ecx
mov    $0x8c,%r15d
cmovne %ecx,%r15d
mov    $0x8c,%eax
cmovne %eax,%ecx
mov    %ecx,0x4c(%rsp)
mov    $0xffffffce,%ecx
mov    $0x96,%r13d
cmovne %ecx,%r13d
mov    $0x96,%eax
cmovne %eax,%ecx
mov    %ecx,0x50(%rsp)
mov    $0xffffffc4,%ecx
mov    $0xa0,%r12d
cmovne %ecx,%r12d
mov    $0xa0,%eax
cmovne %eax,%ecx
mov    %ecx,0x54(%rsp)
mov    $0xffffffba,%ecx
mov    $0xaa,%ebp
cmovne %ecx,%ebp
mov    $0xaa,%eax
cmovne %eax,%ecx
mov    %ecx,0x58(%rsp)
mov    $0xffffffb0,%ecx
mov    $0xb4,%ebx
cmovne %ecx,%ebx
mov    $0xb4,%eax
cmovne %eax,%ecx
mov    %ecx,0x5c(%rsp)
mov    $0xffffffa6,%ecx
mov    $0xbe,%r14d
cmovne %ecx,%r14d
mov    $0xbe,%eax
cmovne %eax,%ecx
mov    %ecx,0x60(%rsp)
mov    $0xffffff9c,%ecx
mov    $0xc8,%edi
cmovne %ecx,%edi
mov    $0xc8,%eax
cmovne %eax,%ecx
mov    %ecx,0x64(%rsp)
call   1030 <print_temperatures@plt>
mov    %r14d,%edi
call   1030 <print_temperatures@plt>
mov    %ebx,%edi
call   1030 <print_temperatures@plt>
mov    %ebp,%edi
call   1030 <print_temperatures@plt>
mov    %r12d,%edi
call   1030 <print_temperatures@plt>
mov    %r13d,%edi
call   1030 <print_temperatures@plt>
mov    %r15d,%edi
call   1030 <print_temperatures@plt>
mov    0xc(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x10(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x28(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x14(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x24(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x18(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x20(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x1c(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    $0x32,%edi
call   1030 <print_temperatures@plt>
mov    0x2c(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x30(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x34(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x38(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x3c(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x40(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x48(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x44(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x4c(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x50(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x54(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x58(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x5c(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x60(%rsp),%edi
call   1030 <print_temperatures@plt>
mov    0x64(%rsp),%edi
call   1030 <print_temperatures@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [13 x i8] c"%10s %10s\0A\00"
@.str.2 = [8 x i8] c"Celsius\00"
@.str.3 = [11 x i8] c"Fahrenheit\00"
@.str.4 = [13 x i8] c"%10s---%10s\0A\00"
@.str.5 = [8 x i8] c"-------\00"
@.str.6 = [11 x i8] c"----------\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %10
10: ; preds = %20, %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @getopt(i32 %11, i8** %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %13, i32* %7
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %21
15: ; preds = %10
%16 = load i32, i32* %7
switch i32 %16, label %19 [
i32 114, label %17
i32 63, label %18
]
17: ; preds = %15
store i32 1, i32* %6
br label %20
18: ; preds = %15
br label %19
19: ; preds = %15, %18
br label %20
20: ; preds = %19, %17
br label %10
21: ; preds = %10
%22 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%24 = load i32, i32* %6
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %37
26: ; preds = %21
store i32 200, i32* %8
br label %27
27: ; preds = %33, %26
%28 = load i32, i32* %8
%29 = icmp sge i32 %28, -100
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load i32, i32* %8
%32 = call i32 @print_temperatures(i32 %31)
br label %33
33: ; preds = %30
%34 = load i32, i32* %8
%35 = sub nsw i32 %34, 10
store i32 %35, i32* %8
br label %27
36: ; preds = %27
br label %48
37: ; preds = %21
store i32 -100, i32* %9
br label %38
38: ; preds = %44, %37
%39 = load i32, i32* %9
%40 = icmp sle i32 %39, 200
br i1 %40, label %41, label %47
41: ; preds = %38
%42 = load i32, i32* %9
%43 = call i32 @print_temperatures(i32 %42)
br label %44
44: ; preds = %41
%45 = load i32, i32* %9
%46 = add nsw i32 %45, 10
store i32 %46, i32* %9
br label %38
47: ; preds = %38
br label %48
48: ; preds = %47, %36
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [13 x i8] c"%10s %10s\0A\00"
@.str.2 = [8 x i8] c"Celsius\00"
@.str.3 = [11 x i8] c"Fahrenheit\00"
@.str.4 = [13 x i8] c"%10s---%10s\0A\00"
@.str.5 = [8 x i8] c"-------\00"
@.str.6 = [11 x i8] c"----------\00"
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %5, %2
%4 = phi i1 [ true, %2 ], [ false, %5 ]
br label %5
5: ; preds = %3, %5
%6 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
switch i32 %6, label %5 [
i32 -1, label %7
i32 114, label %3
]
7: ; preds = %5
%8 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%10 = select i1 %4, i32 -100, i32 200
%11 = select i1 %4, i32 -90, i32 190
%12 = select i1 %4, i32 -80, i32 180
%13 = select i1 %4, i32 -70, i32 170
%14 = select i1 %4, i32 -60, i32 160
%15 = select i1 %4, i32 -50, i32 150
%16 = select i1 %4, i32 -40, i32 140
%17 = select i1 %4, i32 -30, i32 130
%18 = select i1 %4, i32 -20, i32 120
%19 = select i1 %4, i32 -10, i32 110
%20 = select i1 %4, i32 0, i32 100
%21 = select i1 %4, i32 10, i32 90
%22 = select i1 %4, i32 20, i32 80
%23 = select i1 %4, i32 30, i32 70
%24 = select i1 %4, i32 40, i32 60
%25 = select i1 %4, i32 60, i32 40
%26 = select i1 %4, i32 70, i32 30
%27 = select i1 %4, i32 80, i32 20
%28 = select i1 %4, i32 90, i32 10
%29 = select i1 %4, i32 100, i32 0
%30 = select i1 %4, i32 110, i32 -10
%31 = select i1 %4, i32 120, i32 -20
%32 = select i1 %4, i32 130, i32 -30
%33 = select i1 %4, i32 140, i32 -40
%34 = select i1 %4, i32 150, i32 -50
%35 = select i1 %4, i32 160, i32 -60
%36 = select i1 %4, i32 170, i32 -70
%37 = select i1 %4, i32 180, i32 -80
%38 = select i1 %4, i32 190, i32 -90
%39 = select i1 %4, i32 200, i32 -100
%40 = tail call i32 @print_temperatures(i32 %10)
%41 = tail call i32 @print_temperatures(i32 %11)
%42 = tail call i32 @print_temperatures(i32 %12)
%43 = tail call i32 @print_temperatures(i32 %13)
%44 = tail call i32 @print_temperatures(i32 %14)
%45 = tail call i32 @print_temperatures(i32 %15)
%46 = tail call i32 @print_temperatures(i32 %16)
%47 = tail call i32 @print_temperatures(i32 %17)
%48 = tail call i32 @print_temperatures(i32 %18)
%49 = tail call i32 @print_temperatures(i32 %19)
%50 = tail call i32 @print_temperatures(i32 %20)
%51 = tail call i32 @print_temperatures(i32 %21)
%52 = tail call i32 @print_temperatures(i32 %22)
%53 = tail call i32 @print_temperatures(i32 %23)
%54 = tail call i32 @print_temperatures(i32 %24)
%55 = tail call i32 @print_temperatures(i32 50)
%56 = tail call i32 @print_temperatures(i32 %25)
%57 = tail call i32 @print_temperatures(i32 %26)
%58 = tail call i32 @print_temperatures(i32 %27)
%59 = tail call i32 @print_temperatures(i32 %28)
%60 = tail call i32 @print_temperatures(i32 %29)
%61 = tail call i32 @print_temperatures(i32 %30)
%62 = tail call i32 @print_temperatures(i32 %31)
%63 = tail call i32 @print_temperatures(i32 %32)
%64 = tail call i32 @print_temperatures(i32 %33)
%65 = tail call i32 @print_temperatures(i32 %34)
%66 = tail call i32 @print_temperatures(i32 %35)
%67 = tail call i32 @print_temperatures(i32 %36)
%68 = tail call i32 @print_temperatures(i32 %37)
%69 = tail call i32 @print_temperatures(i32 %38)
%70 = tail call i32 @print_temperatures(i32 %39)
ret i32 0
}