#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*/ LC_ALL;
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sscanf(char *, char *, double *);
int main(int argc, char **argv) {
  double t;
  if (argc == 1)
    return 1;
  setlocale(LC_ALL, getenv("LC_ALL"));
  sscanf(argv[1], "%lf", &t);
  printf("%.2f\n", t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    116c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11be <main+0x7e>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
lea    0xe81(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1060 <setlocale@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6a(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     119a <main+0x5a>
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e89(%rip),%rax
mov    (%rax),%ebp
lea    0xea0(%rip),%rdi
call   1030 <getenv@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1060 <setlocale@plt>
mov    0x8(%rbx),%rdi
lea    0xe8e(%rip),%rsi
mov    %rsp,%rdx
call   1050 <sscanf@plt>
movsd  (%rsp),%xmm0
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [7 x i8] c"LC_ALL\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [6 x i8] c"%.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %20
10: ; preds = %2
%11 = load i32, i32* @LC_ALL
%12 = call i32 @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @setlocale(i32 %11, i32 %12)
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%18 = load double, double* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %18)
store i32 0, i32* %3
br label %20
20: ; preds = %10, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [7 x i8] c"LC_ALL\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [6 x i8] c"%.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = icmp eq i32 %0, 1
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = load i32, i32* @LC_ALL
%8 = tail call i32 @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @setlocale(i32 %7, i32 %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%13 = load double, double* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %13)
br label %15
15: ; preds = %2, %6
%16 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %16
}