#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*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
int /*<<< orphan*/ isprint(char);
char *optarg;
int optind;
char optopt;
double pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  const int resolution = 14;
  const int P1 = 0;
  const int P2 = 100;
  double bit_temperature = 0;
  char *raw_data = NULL;
  double raw_data_value = 0.0;
  double multiplier = 0.0;
  int index;
  int c;
  unsigned int raw_data_hex[1];
  switch (resolution) {
  case 14:
    bit_temperature = 0.03125;
    break;
  case 13:
    bit_temperature = 0.0625;
    break;
  case 12:
    bit_temperature = 0.125;
    break;
  case 11:
    bit_temperature = 0.25;
    break;
  default:
    fprintf(stderr, "ERROR! Range not supported!\n");
    return -1;
    break;
  }
  while ((c = getopt(argc, argv, "c:p:t:l:")) != -1)
    switch (c) {
    case 'l':
      puts("Converting temperature data from lmm73 sensor");
      raw_data = optarg;
      sscanf(raw_data, "%x", raw_data_hex);
      printf("Raw_Data_Hexadecimal: %x\n", raw_data_hex[0]);
      printf("Decimal             : %d\n", raw_data_hex[0]);
      while (multiplier != resolution + 1) {
        if (((raw_data_hex[0] & (1 << 0))) == 1) {
          raw_data_value =
              raw_data_value + (bit_temperature * pow(2.0, multiplier));
        }
        raw_data_hex[0] = raw_data_hex[0] >> 1;
        multiplier++;
      }
      printf("Temperature in °C   : %.2f°C\n", raw_data_value);
      break;
    case 'p':
      puts("Converting pressure data from cioi2c sensor");
      raw_data = optarg;
      sscanf(raw_data, "%x", raw_data_hex);
      printf("Raw_Data_Hexadecimal :   %x\n", raw_data_hex[0]);
      printf("Decimal              :   %d\n", raw_data_hex[0]);
      raw_data_value = ((double)raw_data_hex[0] - 4096) / 8192 * (P2 - P1) + P1;
      printf("Pressure in bar      : %.3f bar\n", raw_data_value);
      break;
    case 't':
      puts("Converting temperature data from cioi2c sensor");
      raw_data = optarg;
      sscanf(raw_data, "%x", raw_data_hex);
      printf("Raw_Data_Hexadecimal :   %x\n", raw_data_hex[0]);
      printf("Decimal              :   %d\n", raw_data_hex[0]);
      raw_data_value = ((double)raw_data_hex[0] * 0.1) - 50;
      printf("Temperature in °C      : %.3f °C\n", raw_data_value);
      break;
    case '?':
      if (optopt == 'i')
        fprintf(stderr, "Option -%c requires an argument.\n", optopt);
      else if (isprint(optopt))
        fprintf(stderr, "Unknown option `-%c'.\n", optopt);
      else
        fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
      return 1;
    default:
      abort();
    }
  for (index = optind; index < argc; index++)
    printf("Non-option argument %s\n", argv[index]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xe,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x64,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe2d(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe62(%rip),%rdx
call   10a0 <getopt@plt>
mov    %eax,-0x48(%rbp)
cmp    $0xffffffff,%eax
je     1521 <main+0x3a1>
mov    -0x48(%rbp),%eax
mov    %eax,-0x50(%rbp)
sub    $0x3f,%eax
je     146c <main+0x2ec>
jmp    120b <main+0x8b>
mov    -0x50(%rbp),%eax
sub    $0x6c,%eax
je     123e <main+0xbe>
jmp    121c <main+0x9c>
mov    -0x50(%rbp),%eax
sub    $0x70,%eax
je     1337 <main+0x1b7>
jmp    122d <main+0xad>
mov    -0x50(%rbp),%eax
sub    $0x74,%eax
je     13db <main+0x25b>
jmp    1515 <main+0x395>
lea    0xe0c(%rip),%rdi
call   1040 <puts@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0x4c(%rbp),%rdx
lea    0xe18(%rip),%rsi
call   1070 <sscanf@plt>
mov    -0x4c(%rbp),%esi
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4c(%rbp),%esi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x40(%rbp),%xmm0
movsd  0xd95(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12b0 <main+0x130>
jp     12b0 <main+0x130>
jmp    131f <main+0x19f>
mov    -0x4c(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    12ff <main+0x17f>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  0xd58(%rip),%xmm0
call   1090 <pow@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x4c(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4c(%rbp)
movsd  0xd30(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    128e <main+0x10e>
movsd  -0x38(%rbp),%xmm0
lea    0xd8b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    151c <main+0x39c>
lea    0xd98(%rip),%rdi
call   1040 <puts@plt>
mov    0x2cae(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xd23(%rip),%rsi
lea    -0x4c(%rbp),%rdx
call   1070 <sscanf@plt>
mov    -0x4c(%rbp),%esi
lea    0xd93(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x61(%rbp)
call   1050 <printf@plt>
mov    -0x61(%rbp),%al
mov    -0x4c(%rbp),%esi
lea    0xd99(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4c(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xc8d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xc79(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc65(%rip),%xmm1
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xd6d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    151c <main+0x39c>
lea    0xd7b(%rip),%rdi
call   1040 <puts@plt>
mov    0x2c0a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xc7f(%rip),%rsi
lea    -0x4c(%rbp),%rdx
call   1070 <sscanf@plt>
mov    -0x4c(%rbp),%esi
lea    0xcef(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x62(%rbp)
call   1050 <printf@plt>
mov    -0x62(%rbp),%al
mov    -0x4c(%rbp),%esi
lea    0xcf5(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4c(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xbc9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbc5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xd2c(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    151c <main+0x39c>
mov    0x2b6d(%rip),%rax
movsbl (%rax),%eax
cmp    $0x69,%eax
jne    14a5 <main+0x325>
mov    0x2b42(%rip),%rax
mov    (%rax),%edi
mov    0x2b51(%rip),%rax
movsbl (%rax),%edx
lea    0xd17(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1509 <main+0x389>
mov    0x2b34(%rip),%rax
movsbl (%rax),%edi
call   1080 <isprint@plt>
cmp    $0x0,%eax
je     14e3 <main+0x363>
mov    0x2b04(%rip),%rax
mov    (%rax),%edi
mov    0x2b13(%rip),%rax
movsbl (%rax),%edx
lea    0xcfb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1504 <main+0x384>
mov    0x2ade(%rip),%rax
mov    (%rax),%edi
mov    0x2aed(%rip),%rax
movsbl (%rax),%edx
lea    0xcec(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1509 <main+0x389>
movl   $0x1,-0x4(%rbp)
jmp    1568 <main+0x3e8>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11d8 <main+0x58>
mov    0x2ab0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1561 <main+0x3e1>
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    152d <main+0x3ad>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %edi,%r12d
lea    0xead(%rip),%r15
mov    0x2e56(%rip),%rbx
lea    0xed6(%rip),%r13
lea    0x4(%rsp),%rbp
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r12d,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   10a0 <getopt@plt>
cmp    $0x6f,%eax
jle    12e0 <main+0x160>
cmp    $0x70,%eax
je     1250 <main+0xd0>
cmp    $0x74,%eax
jne    1494 <main+0x314>
lea    0xf6f(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1080 <sscanf@plt>
mov    0x4(%rsp),%esi
lea    0xef6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xf01(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xdc7(%rip),%xmm0
addsd  0xdc7(%rip),%xmm0
lea    0xf44(%rip),%rdi
jmp    12c1 <main+0x141>
nopw   0x0(%rax,%rax,1)
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1080 <sscanf@plt>
mov    0x4(%rsp),%esi
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xd6e(%rip),%xmm0
mulsd  0xd6e(%rip),%xmm0
mulsd  0xd6e(%rip),%xmm0
addsd  0xd86(%rip),%xmm0
lea    0xe7b(%rip),%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1050 <printf@plt>
jmp    11c2 <main+0x42>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0xffffffff,%eax
je     13e1 <main+0x261>
cmp    $0x3f,%eax
je     1429 <main+0x2a9>
cmp    $0x6c,%eax
jne    1494 <main+0x314>
lea    0xd4f(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1080 <sscanf@plt>
mov    0x4(%rsp),%esi
lea    0xd62(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xd6a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0xce1(%rip),%xmm0
jne    134b <main+0x1cb>
jnp    13c0 <main+0x240>
mov    0x4(%rsp),%eax
jmp    137a <main+0x1fa>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shr    %eax
mov    %eax,0x4(%rsp)
addsd  0xcca(%rip),%xmm0
ucomisd 0xcb2(%rip),%xmm0
jne    137a <main+0x1fa>
jnp    13c0 <main+0x240>
test   $0x1,%al
je     1360 <main+0x1e0>
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <exp2@plt>
mulsd  0xc99(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    0x4(%rsp),%eax
jmp    1360 <main+0x1e0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xcef(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0xc4c(%rip),%xmm0
jmp    11bc <main+0x3c>
mov    0x2bf0(%rip),%rax
movslq (%rax),%rax
xor    %r15d,%r15d
cmp    %r12d,%eax
jge    1482 <main+0x302>
lea    (%r14,%rax,8),%rbx
sub    %eax,%r12d
xor    %r15d,%r15d
lea    0xe03(%rip),%r14
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %ebp,%r12d
jne    1410 <main+0x290>
jmp    1482 <main+0x302>
mov    0x2bb0(%rip),%rbx
mov    (%rbx),%al
cmp    $0x69,%al
jne    144d <main+0x2cd>
mov    0x2b8b(%rip),%rax
mov    (%rax),%edi
lea    0xd6a(%rip),%rsi
mov    $0x69,%edx
jmp    1475 <main+0x2f5>
movsbl %al,%edi
call   1090 <isprint@plt>
mov    0x2b6c(%rip),%rcx
mov    (%rcx),%edi
movsbl (%rbx),%edx
test   %eax,%eax
je     146e <main+0x2ee>
lea    0xd66(%rip),%rsi
jmp    1475 <main+0x2f5>
lea    0xd74(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"c:p:t:l:\00"
@.str.1 = [46 x i8] c"Converting temperature data from lmm73 sensor\00"
@optarg = global i8* null
@.str.2 = [3 x i8] c"%x\00"
@.str.3 = [26 x i8] c"Raw_Data_Hexadecimal: %x\0A\00"
@.str.4 = [26 x i8] c"Decimal : %d\0A\00"
@.str.5 = [32 x i8] c"Temperature in \C2\B0C : %.2f\C2\B0C\0A\00"
@.str.6 = [44 x i8] c"Converting pressure data from cioi2c sensor\00"
@.str.7 = [29 x i8] c"Raw_Data_Hexadecimal : %x\0A\00"
@.str.8 = [29 x i8] c"Decimal : %d\0A\00"
@.str.9 = [33 x i8] c"Pressure in bar : %.3f bar\0A\00"
@.str.10 = [47 x i8] c"Converting temperature data from cioi2c sensor\00"
@.str.11 = [36 x i8] c"Temperature in \C2\B0C : %.3f \C2\B0C\0A\00"
@optopt = global i8 0
@stderr = global i32 0
@.str.12 = [34 x i8] c"Option -%c requires an argument.\0A\00"
@.str.13 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.14 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@optind = global i32 0
@.str.15 = [24 x i8] c"Non-option argument %s\0A\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 double
%10 = alloca i8*
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca [1 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 14, i32* %6
store i32 0, i32* %7
store i32 100, i32* %8
store double 0.000000e+00, double* %9
store i8* null, i8** %10
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
store double 3.125000e-02, double* %9
br label %16
16: ; preds = %124, %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @getopt(i32 %17, i8** %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %19, i32* %14
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %125
21: ; preds = %16
%22 = load i32, i32* %14
switch i32 %22, label %122 [
i32 108, label %23
i32 112, label %59
i32 116, label %79
i32 63, label %97
]
23: ; preds = %21
%24 = call i32 @puts(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%25 = load i8*, i8** @optarg
store i8* %25, i8** %10
%26 = load i8*, i8** %10
%27 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%28 = call i32 @sscanf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %27)
%29 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %49, %23
%36 = load double, double* %12
%37 = fcmp une double %36, 1.500000e+01
br i1 %37, label %38, label %56
38: ; preds = %35
%39 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%40 = load i32, i32* %39
%41 = and i32 %40, 1
%42 = icmp eq i32 %41, 1
br i1 %42, label %43, label %49
43: ; preds = %38
%44 = load double, double* %11
%45 = load double, double* %9
%46 = load double, double* %12
%47 = call double @pow(double 2.000000e+00, double %46)
%48 = call double @llvm.fmuladd.f64(double %45, double %47, double %44)
store double %48, double* %11
br label %49
49: ; preds = %43, %38
%50 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%51 = load i32, i32* %50
%52 = lshr i32 %51, 1
%53 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
store i32 %52, i32* %53
%54 = load double, double* %12
%55 = fadd double %54, 1.000000e+00
store double %55, double* %12
br label %35
56: ; preds = %35
%57 = load double, double* %11
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double %57)
br label %124
59: ; preds = %21
%60 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%61 = load i8*, i8** @optarg
store i8* %61, i8** %10
%62 = load i8*, i8** %10
%63 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%64 = call i32 @sscanf(i8* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %63)
%65 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%66 = load i32, i32* %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %66)
%68 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%69 = load i32, i32* %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %69)
%71 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%72 = load i32, i32* %71
%73 = uitofp i32 %72 to double
%74 = fsub double %73, 4.096000e+03
%75 = fdiv double %74, 8.192000e+03
%76 = call double @llvm.fmuladd.f64(double %75, double 1.000000e+02, double 0.000000e+00)
store double %76, double* %11
%77 = load double, double* %11
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), double %77)
br label %124
79: ; preds = %21
%80 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%81 = load i8*, i8** @optarg
store i8* %81, i8** %10
%82 = load i8*, i8** %10
%83 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%84 = call i32 @sscanf(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %83)
%85 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%86 = load i32, i32* %85
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %86)
%88 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%89 = load i32, i32* %88
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %89)
%91 = getelementptr inbounds [1 x i32], [1 x i32]* %15, i64 0, i64 0
%92 = load i32, i32* %91
%93 = uitofp i32 %92 to double
%94 = call double @llvm.fmuladd.f64(double %93, double 1.000000e-01, double -5.000000e+01)
store double %94, double* %11
%95 = load double, double* %11
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0), double %95)
br label %124
97: ; preds = %21
%98 = load i8, i8* @optopt
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 105
br i1 %100, label %101, label %106
101: ; preds = %97
%102 = load i32, i32* @stderr
%103 = load i8, i8* @optopt
%104 = sext i8 %103 to i32
%105 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i32 %104)
br label %121
106: ; preds = %97
%107 = load i8, i8* @optopt
%108 = call i32 @isprint(i8 signext %107)
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %115
110: ; preds = %106
%111 = load i32, i32* @stderr
%112 = load i8, i8* @optopt
%113 = sext i8 %112 to i32
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %111, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i32 %113)
br label %120
115: ; preds = %106
%116 = load i32, i32* @stderr
%117 = load i8, i8* @optopt
%118 = sext i8 %117 to i32
%119 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 %118)
br label %120
120: ; preds = %115, %110
br label %121
121: ; preds = %120, %101
store i32 1, i32* %3
br label %142
122: ; preds = %21
%123 = call i32 (...) @abort()
unreachable
124: ; preds = %79, %59, %56
br label %16
125: ; preds = %16
%126 = load i32, i32* @optind
store i32 %126, i32* %13
br label %127
127: ; preds = %138, %125
%128 = load i32, i32* %13
%129 = load i32, i32* %4
%130 = icmp slt i32 %128, %129
br i1 %130, label %131, label %141
131: ; preds = %127
%132 = load i8**, i8*** %5
%133 = load i32, i32* %13
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8*, i8** %132, i64 %134
%136 = load i8*, i8** %135
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %136)
br label %138
138: ; preds = %131
%139 = load i32, i32* %13
%140 = add nsw i32 %139, 1
store i32 %140, i32* %13
br label %127
141: ; preds = %127
store i32 0, i32* %3
br label %142
142: ; preds = %141, %121
%143 = load i32, i32* %3
ret i32 %143
}

LLVM IR (-O2):
@.str = [9 x i8] c"c:p:t:l:\00"
@.str.1 = [46 x i8] c"Converting temperature data from lmm73 sensor\00"
@optarg = global i8* null
@.str.2 = [3 x i8] c"%x\00"
@.str.3 = [26 x i8] c"Raw_Data_Hexadecimal: %x\0A\00"
@.str.4 = [26 x i8] c"Decimal : %d\0A\00"
@.str.5 = [32 x i8] c"Temperature in \C2\B0C : %.2f\C2\B0C\0A\00"
@.str.6 = [44 x i8] c"Converting pressure data from cioi2c sensor\00"
@.str.7 = [29 x i8] c"Raw_Data_Hexadecimal : %x\0A\00"
@.str.8 = [29 x i8] c"Decimal : %d\0A\00"
@.str.9 = [33 x i8] c"Pressure in bar : %.3f bar\0A\00"
@.str.10 = [47 x i8] c"Converting temperature data from cioi2c sensor\00"
@.str.11 = [36 x i8] c"Temperature in \C2\B0C : %.3f \C2\B0C\0A\00"
@optopt = global i8 0
@stderr = global i32 0
@.str.12 = [34 x i8] c"Option -%c requires an argument.\0A\00"
@.str.13 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.14 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@optind = global i32 0
@.str.15 = [24 x i8] c"Non-option argument %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [1 x i32]
%4 = bitcast [1 x i32]* %3 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
br label %6
6: ; preds = %39, %2
%7 = phi double [ %40, %39 ], [ 0.000000e+00, %2 ]
%8 = phi double [ 1.500000e+01, %39 ], [ 0.000000e+00, %2 ]
br label %9
9: ; preds = %68, %6
%10 = phi double [ %7, %6 ], [ %69, %68 ]
%11 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
switch i32 %11, label %86 [
i32 -1, label %88
i32 108, label %12
i32 112, label %42
i32 116, label %56
i32 63, label %70
]
12: ; preds = %9
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%14 = load i8*, i8** @optarg
%15 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%16 = load i32, i32* %5
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %5
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = fcmp une double %8, 1.500000e+01
br i1 %20, label %21, label %39
21: ; preds = %12
%22 = load i32, i32* %5
br label %23
23: ; preds = %21, %33
%24 = phi i32 [ %36, %33 ], [ %22, %21 ]
%25 = phi double [ %37, %33 ], [ %8, %21 ]
%26 = phi double [ %35, %33 ], [ %10, %21 ]
%27 = and i32 %24, 1
%28 = icmp eq i32 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %23
%30 = call double @exp2(double %25)
%31 = call double @llvm.fmuladd.f64(double %30, double 3.125000e-02, double %26)
%32 = load i32, i32* %5
br label %33
33: ; preds = %29, %23
%34 = phi i32 [ %32, %29 ], [ %24, %23 ]
%35 = phi double [ %31, %29 ], [ %26, %23 ]
%36 = lshr i32 %34, 1
store i32 %36, i32* %5
%37 = fadd double %25, 1.000000e+00
%38 = fcmp une double %37, 1.500000e+01
br i1 %38, label %23, label %39
39: ; preds = %33, %12
%40 = phi double [ %10, %12 ], [ %35, %33 ]
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double %40)
br label %6
42: ; preds = %9
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%44 = load i8*, i8** @optarg
%45 = call i32 @sscanf(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%46 = load i32, i32* %5
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %5
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %5
%51 = uitofp i32 %50 to double
%52 = fadd double %51, -4.096000e+03
%53 = fmul double %52, 0x3F20000000000000
%54 = call double @llvm.fmuladd.f64(double %53, double 1.000000e+02, double 0.000000e+00)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), double %54)
br label %68
56: ; preds = %9
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%58 = load i8*, i8** @optarg
%59 = call i32 @sscanf(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%60 = load i32, i32* %5
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %60)
%62 = load i32, i32* %5
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %62)
%64 = load i32, i32* %5
%65 = uitofp i32 %64 to double
%66 = call double @llvm.fmuladd.f64(double %65, double 1.000000e-01, double -5.000000e+01)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0), double %66)
br label %68
68: ; preds = %56, %42
%69 = phi double [ %66, %56 ], [ %54, %42 ]
br label %9
70: ; preds = %9
%71 = load i8, i8* @optopt
%72 = icmp eq i8 %71, 105
br i1 %72, label %73, label %76
73: ; preds = %70
%74 = load i32, i32* @stderr
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0), i32 105)
br label %101
76: ; preds = %70
%77 = call i32 @isprint(i8 signext %71)
%78 = icmp eq i32 %77, 0
%79 = load i32, i32* @stderr
%80 = load i8, i8* @optopt
%81 = sext i8 %80 to i32
br i1 %78, label %84, label %82
82: ; preds = %76
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i32 %81)
br label %101
84: ; preds = %76
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 %81)
br label %101
86: ; preds = %9
%87 = call i32 (...) @abort()
unreachable
88: ; preds = %9
%89 = load i32, i32* @optind
%90 = icmp slt i32 %89, %0
br i1 %90, label %91, label %101
91: ; preds = %88
%92 = sext i32 %89 to i64
br label %93
93: ; preds = %91, %93
%94 = phi i64 [ %92, %91 ], [ %98, %93 ]
%95 = getelementptr inbounds i8*, i8** %1, i64 %94
%96 = load i8*, i8** %95
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %96)
%98 = add nsw i64 %94, 1
%99 = trunc i64 %98 to i32
%100 = icmp eq i32 %99, %0
br i1 %100, label %101, label %93
101: ; preds = %93, %88, %73, %84, %82
%102 = phi i32 [ 1, %82 ], [ 1, %84 ], [ 1, %73 ], [ 0, %88 ], [ 0, %93 ]
ret i32 %102
}