#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 */
scalar_t__ strcmp(char const *, char *);
int convert_units_from_THz(double *value, const char *to_units) {
  if (0 == strcmp(to_units, "THz")) {
    return 0;
  } else if (0 == strcmp(to_units, "um")) {
    *value = 2.99792458e2 / *value;
  } else if (0 == strcmp(to_units, "nm")) {
    *value = 2.99792458e5 / *value;
  } else if (0 == strcmp(to_units, "m")) {
    *value = 2.99792458e-4 / *value;
  } else if (0 == strcmp(to_units, "cm")) {
    *value = 2.99792458e-2 / *value;
  } else if (0 == strcmp(to_units, "mm")) {
    *value = 2.99792458e-1 / *value;
  } else if (0 == strcmp(to_units, "eV")) {
    *value *= 0.004135665157613982;
  } else if (0 == strcmp(to_units, "J")) {
    *value *= 6.6260689599999995e-22;
  } else if (0 == strcmp(to_units, "GHz")) {
    *value *= 1e3;
  } else if (0 == strcmp(to_units, "Hz")) {
    *value *= 1e12;
  } else if (0 == strcmp(to_units, "rad/s")) {
    *value *= 6.283185307179586e12;
  } else {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<convert_units_from_THz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xf25(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    114a <convert_units_from_THz+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    13c9 <convert_units_from_THz+0x2b9>
mov    -0x18(%rbp),%rdi
lea    0xeff(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1185 <convert_units_from_THz+0x75>
mov    -0x10(%rbp),%rax
movsd  0xed4(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13bd <convert_units_from_THz+0x2ad>
mov    -0x18(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11c0 <convert_units_from_THz+0xb0>
mov    -0x10(%rbp),%rax
movsd  0xe91(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13b8 <convert_units_from_THz+0x2a8>
mov    -0x18(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11fb <convert_units_from_THz+0xeb>
mov    -0x10(%rbp),%rax
movsd  0xe4e(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13b3 <convert_units_from_THz+0x2a3>
mov    -0x18(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1236 <convert_units_from_THz+0x126>
mov    -0x10(%rbp),%rax
movsd  0xe0b(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13ae <convert_units_from_THz+0x29e>
mov    -0x18(%rbp),%rdi
lea    0xe1c(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1271 <convert_units_from_THz+0x161>
mov    -0x10(%rbp),%rax
movsd  0xdc8(%rip),%xmm0
divsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13a9 <convert_units_from_THz+0x299>
mov    -0x18(%rbp),%rdi
lea    0xde4(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    12a8 <convert_units_from_THz+0x198>
mov    -0x10(%rbp),%rax
movsd  0xd85(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    13a4 <convert_units_from_THz+0x294>
mov    -0x18(%rbp),%rdi
lea    0xdb0(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    12df <convert_units_from_THz+0x1cf>
mov    -0x10(%rbp),%rax
movsd  0xd46(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    139f <convert_units_from_THz+0x28f>
mov    -0x18(%rbp),%rdi
lea    0xd7b(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1316 <convert_units_from_THz+0x206>
mov    -0x10(%rbp),%rax
movsd  0xd07(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    139a <convert_units_from_THz+0x28a>
mov    -0x18(%rbp),%rdi
lea    0xd45(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    134d <convert_units_from_THz+0x23d>
mov    -0x10(%rbp),%rax
movsd  0xcc8(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1395 <convert_units_from_THz+0x285>
mov    -0x18(%rbp),%rdi
lea    0xd11(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1384 <convert_units_from_THz+0x274>
mov    -0x10(%rbp),%rax
movsd  0xc89(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    1390 <convert_units_from_THz+0x280>
movl   $0x2,-0x4(%rbp)
jmp    13c9 <convert_units_from_THz+0x2b9>
jmp    1395 <convert_units_from_THz+0x285>
jmp    139a <convert_units_from_THz+0x28a>
jmp    139f <convert_units_from_THz+0x28f>
jmp    13a4 <convert_units_from_THz+0x294>
jmp    13a9 <convert_units_from_THz+0x299>
jmp    13ae <convert_units_from_THz+0x29e>
jmp    13b3 <convert_units_from_THz+0x2a3>
jmp    13b8 <convert_units_from_THz+0x2a8>
jmp    13bd <convert_units_from_THz+0x2ad>
jmp    13c2 <convert_units_from_THz+0x2b2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_units_from_THz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xf2f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     12cd <convert_units_from_THz+0x1bd>
lea    0xf16(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1241 <convert_units_from_THz+0x131>
lea    0xf01(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1250 <convert_units_from_THz+0x140>
lea    0xeed(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     125f <convert_units_from_THz+0x14f>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     126e <convert_units_from_THz+0x15e>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     127d <convert_units_from_THz+0x16d>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     128c <convert_units_from_THz+0x17c>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     129b <convert_units_from_THz+0x18b>
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12aa <convert_units_from_THz+0x19a>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     12b9 <convert_units_from_THz+0x1a9>
lea    0xe53(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
jne    12cd <convert_units_from_THz+0x1bd>
movsd  (%r14),%xmm0
mulsd  0xdc4(%rip),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  0xdff(%rip),%xmm0
divsd  (%r14),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  0xde8(%rip),%xmm0
divsd  (%r14),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  0xdd1(%rip),%xmm0
divsd  (%r14),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  0xdba(%rip),%xmm0
divsd  (%r14),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  0xda3(%rip),%xmm0
divsd  (%r14),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  (%r14),%xmm0
mulsd  0xd87(%rip),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  (%r14),%xmm0
mulsd  0xd70(%rip),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  (%r14),%xmm0
mulsd  0xd59(%rip),%xmm0
jmp    12c6 <convert_units_from_THz+0x1b6>
movsd  (%r14),%xmm0
mulsd  0xd42(%rip),%xmm0
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"THz\00"
@.str.1 = [3 x i8] c"um\00"
@.str.2 = [3 x i8] c"nm\00"
@.str.3 = [2 x i8] c"m\00"
@.str.4 = [3 x i8] c"cm\00"
@.str.5 = [3 x i8] c"mm\00"
@.str.6 = [3 x i8] c"eV\00"
@.str.7 = [2 x i8] c"J\00"
@.str.8 = [4 x i8] c"GHz\00"
@.str.9 = [3 x i8] c"Hz\00"
@.str.10 = [6 x i8] c"rad/s\00"
define i32 @convert_units_from_THz(double* %0, i8* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i8*
store double* %0, double** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 0, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %107
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 0, %12
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load double*, double** %4
%16 = load double, double* %15
%17 = fdiv double 0x4072BCADE8709742, %16
%18 = load double*, double** %4
store double %17, double* %18
br label %105
19: ; preds = %10
%20 = load i8*, i8** %5
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 0, %21
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load double*, double** %4
%25 = load double, double* %24
%26 = fdiv double 0x41124C41D4FDF3B6, %25
%27 = load double*, double** %4
store double %26, double* %27
br label %104
28: ; preds = %19
%29 = load i8*, i8** %5
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 0, %30
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = load double*, double** %4
%34 = load double, double* %33
%35 = fdiv double 0x3F33A5AECD7D9490, %34
%36 = load double*, double** %4
store double %35, double* %36
br label %103
37: ; preds = %28
%38 = load i8*, i8** %5
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp eq i64 0, %39
br i1 %40, label %41, label %46
41: ; preds = %37
%42 = load double*, double** %4
%43 = load double, double* %42
%44 = fdiv double 0x3F9EB2E121143820, %43
%45 = load double*, double** %4
store double %44, double* %45
br label %102
46: ; preds = %37
%47 = load i8*, i8** %5
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%49 = icmp eq i64 0, %48
br i1 %49, label %50, label %55
50: ; preds = %46
%51 = load double*, double** %4
%52 = load double, double* %51
%53 = fdiv double 0x3FD32FCCB4ACA314, %52
%54 = load double*, double** %4
store double %53, double* %54
br label %101
55: ; preds = %46
%56 = load i8*, i8** %5
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%58 = icmp eq i64 0, %57
br i1 %58, label %59, label %63
59: ; preds = %55
%60 = load double*, double** %4
%61 = load double, double* %60
%62 = fmul double %61, 0x3F70F08F29962779
store double %62, double* %60
br label %100
63: ; preds = %55
%64 = load i8*, i8** %5
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%66 = icmp eq i64 0, %65
br i1 %66, label %67, label %71
67: ; preds = %63
%68 = load double*, double** %4
%69 = load double, double* %68
%70 = fmul double %69, 0x3B89085736B70281
store double %70, double* %68
br label %99
71: ; preds = %63
%72 = load i8*, i8** %5
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%74 = icmp eq i64 0, %73
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load double*, double** %4
%77 = load double, double* %76
%78 = fmul double %77, 1.000000e+03
store double %78, double* %76
br label %98
79: ; preds = %71
%80 = load i8*, i8** %5
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%82 = icmp eq i64 0, %81
br i1 %82, label %83, label %87
83: ; preds = %79
%84 = load double*, double** %4
%85 = load double, double* %84
%86 = fmul double %85, 1.000000e+12
store double %86, double* %84
br label %97
87: ; preds = %79
%88 = load i8*, i8** %5
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%90 = icmp eq i64 0, %89
br i1 %90, label %91, label %95
91: ; preds = %87
%92 = load double*, double** %4
%93 = load double, double* %92
%94 = fmul double %93, 0x4296DBAC1CF8AE58
store double %94, double* %92
br label %96
95: ; preds = %87
store i32 2, i32* %3
br label %107
96: ; preds = %91
br label %97
97: ; preds = %96, %83
br label %98
98: ; preds = %97, %75
br label %99
99: ; preds = %98, %67
br label %100
100: ; preds = %99, %59
br label %101
101: ; preds = %100, %50
br label %102
102: ; preds = %101, %41
br label %103
103: ; preds = %102, %32
br label %104
104: ; preds = %103, %23
br label %105
105: ; preds = %104, %14
br label %106
106: ; preds = %105
store i32 0, i32* %3
br label %107
107: ; preds = %106, %95, %9
%108 = load i32, i32* %3
ret i32 %108
}

LLVM IR (-O2):
@.str = [4 x i8] c"THz\00"
@.str.1 = [3 x i8] c"um\00"
@.str.2 = [3 x i8] c"nm\00"
@.str.3 = [2 x i8] c"m\00"
@.str.4 = [3 x i8] c"cm\00"
@.str.5 = [3 x i8] c"mm\00"
@.str.6 = [3 x i8] c"eV\00"
@.str.7 = [2 x i8] c"J\00"
@.str.8 = [4 x i8] c"GHz\00"
@.str.9 = [3 x i8] c"Hz\00"
@.str.10 = [6 x i8] c"rad/s\00"
define i32 @convert_units_from_THz(double* nocapture %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %67, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load double, double* %0
%10 = fdiv double 0x4072BCADE8709742, %9
br label %65
11: ; preds = %5
%12 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load double, double* %0
%16 = fdiv double 0x41124C41D4FDF3B6, %15
br label %65
17: ; preds = %11
%18 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load double, double* %0
%22 = fdiv double 0x3F33A5AECD7D9490, %21
br label %65
23: ; preds = %17
%24 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load double, double* %0
%28 = fdiv double 0x3F9EB2E121143820, %27
br label %65
29: ; preds = %23
%30 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load double, double* %0
%34 = fdiv double 0x3FD32FCCB4ACA314, %33
br label %65
35: ; preds = %29
%36 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load double, double* %0
%40 = fmul double %39, 0x3F70F08F29962779
br label %65
41: ; preds = %35
%42 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load double, double* %0
%46 = fmul double %45, 0x3B89085736B70281
br label %65
47: ; preds = %41
%48 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load double, double* %0
%52 = fmul double %51, 1.000000e+03
br label %65
53: ; preds = %47
%54 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load double, double* %0
%58 = fmul double %57, 1.000000e+12
br label %65
59: ; preds = %53
%60 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %67
62: ; preds = %59
%63 = load double, double* %0
%64 = fmul double %63, 0x4296DBAC1CF8AE58
br label %65
65: ; preds = %8, %20, %32, %44, %56, %62, %50, %38, %26, %14
%66 = phi double [ %16, %14 ], [ %28, %26 ], [ %40, %38 ], [ %52, %50 ], [ %64, %62 ], [ %58, %56 ], [ %46, %44 ], [ %34, %32 ], [ %22, %20 ], [ %10, %8 ]
store double %66, double* %0
br label %67
67: ; preds = %65, %59, %2
%68 = phi i32 [ 0, %2 ], [ 2, %59 ], [ 0, %65 ]
ret i32 %68
}