#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 */
struct lconv {
  char *currency_symbol;
  char *int_curr_symbol;
};

/* Variables and functions */
int /*<<< orphan*/ LC_MONETARY;
struct lconv *localeconv();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  struct lconv *lc;
  setlocale(LC_MONETARY, "it_IT");
  lc = localeconv();
  printf("Local Currency Symbol: %s\n", lc->currency_symbol);
  printf("International Currency Symbol: %s\n", lc->int_curr_symbol);
  setlocale(LC_MONETARY, "en_US");
  lc = localeconv();
  printf("Local Currency Symbol: %s\n", lc->currency_symbol);
  printf("International Currency Symbol: %s\n", lc->int_curr_symbol);
  setlocale(LC_MONETARY, "en_GB");
  lc = localeconv();
  printf("Local Currency Symbol: %s\n", lc->currency_symbol);
  printf("International Currency Symbol: %s\n", lc->int_curr_symbol);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1050 <setlocale@plt>
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1050 <setlocale@plt>
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
lea    0xe6d(%rip),%rsi
call   1050 <setlocale@plt>
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe0b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2ea1(%rip),%r12
mov    (%r12),%edi
lea    0xeb6(%rip),%rsi
call   1050 <setlocale@plt>
xor    %eax,%eax
call   1030 <localeconv@plt>
mov    %rax,%rbx
mov    (%rax),%rsi
lea    0xea3(%rip),%r14
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xeab(%rip),%r15
mov    %r15,%rdi
call   1040 <printf@plt>
mov    (%r12),%edi
lea    0xebb(%rip),%rsi
call   1050 <setlocale@plt>
xor    %eax,%eax
call   1030 <localeconv@plt>
mov    %rax,%rbx
mov    (%rax),%rsi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
mov    %r15,%rdi
call   1040 <printf@plt>
mov    (%r12),%edi
lea    0xe90(%rip),%rsi
call   1050 <setlocale@plt>
xor    %eax,%eax
call   1030 <localeconv@plt>
mov    %rax,%rbx
mov    (%rax),%rsi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
mov    %r15,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.lconv = type { i8*, i8* }
@LC_MONETARY = global i32 0
@.str = [6 x i8] c"it_IT\00"
@.str.1 = [27 x i8] c"Local Currency Symbol: %s\0A\00"
@.str.2 = [35 x i8] c"International Currency Symbol: %s\0A\00"
@.str.3 = [6 x i8] c"en_US\00"
@.str.4 = [6 x i8] c"en_GB\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.lconv*
store i32 0, i32* %1
%3 = load i32, i32* @LC_MONETARY
%4 = call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call %struct.lconv* (...) @localeconv()
store %struct.lconv* %5, %struct.lconv** %2
%6 = load %struct.lconv*, %struct.lconv** %2
%7 = getelementptr inbounds %struct.lconv, %struct.lconv* %6, i32 0, i32 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load %struct.lconv*, %struct.lconv** %2
%11 = getelementptr inbounds %struct.lconv, %struct.lconv* %10, i32 0, i32 1
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @LC_MONETARY
%15 = call i32 @setlocale(i32 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%16 = call %struct.lconv* (...) @localeconv()
store %struct.lconv* %16, %struct.lconv** %2
%17 = load %struct.lconv*, %struct.lconv** %2
%18 = getelementptr inbounds %struct.lconv, %struct.lconv* %17, i32 0, i32 0
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = load %struct.lconv*, %struct.lconv** %2
%22 = getelementptr inbounds %struct.lconv, %struct.lconv* %21, i32 0, i32 1
%23 = load i8*, i8** %22
%24 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = load i32, i32* @LC_MONETARY
%26 = call i32 @setlocale(i32 %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%27 = call %struct.lconv* (...) @localeconv()
store %struct.lconv* %27, %struct.lconv** %2
%28 = load %struct.lconv*, %struct.lconv** %2
%29 = getelementptr inbounds %struct.lconv, %struct.lconv* %28, i32 0, i32 0
%30 = load i8*, i8** %29
%31 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = load %struct.lconv*, %struct.lconv** %2
%33 = getelementptr inbounds %struct.lconv, %struct.lconv* %32, i32 0, i32 1
%34 = load i8*, i8** %33
%35 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %34)
ret i32 0
}

LLVM IR (-O2):
%struct.lconv = type { i8*, i8* }
@LC_MONETARY = global i32 0
@.str = [6 x i8] c"it_IT\00"
@.str.1 = [27 x i8] c"Local Currency Symbol: %s\0A\00"
@.str.2 = [35 x i8] c"International Currency Symbol: %s\0A\00"
@.str.3 = [6 x i8] c"en_US\00"
@.str.4 = [6 x i8] c"en_GB\00"
define i32 @main() {
%1 = load i32, i32* @LC_MONETARY
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call %struct.lconv* (...) @localeconv()
%4 = getelementptr inbounds %struct.lconv, %struct.lconv* %3, i64 0, i32 0
%5 = load i8*, i8** %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds %struct.lconv, %struct.lconv* %3, i64 0, i32 1
%8 = load i8*, i8** %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @LC_MONETARY
%11 = tail call i32 @setlocale(i32 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call %struct.lconv* (...) @localeconv()
%13 = getelementptr inbounds %struct.lconv, %struct.lconv* %12, i64 0, i32 0
%14 = load i8*, i8** %13
%15 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds %struct.lconv, %struct.lconv* %12, i64 0, i32 1
%17 = load i8*, i8** %16
%18 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @LC_MONETARY
%20 = tail call i32 @setlocale(i32 %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%21 = tail call %struct.lconv* (...) @localeconv()
%22 = getelementptr inbounds %struct.lconv, %struct.lconv* %21, i64 0, i32 0
%23 = load i8*, i8** %22
%24 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds %struct.lconv, %struct.lconv* %21, i64 0, i32 1
%26 = load i8*, i8** %25
%27 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %26)
ret i32 0
}