xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu() {
  printf("\n*********************** Preguntas ***********************\n");
  printf(
      "1- Solicitar la hora del sistema\n1- Solicitar la fecha del sistema\n3- "
      "Solicitar el nombre del sistema\n4- Solicitar informacion sobre la "
      "cantidad de usuarios logueados\n0- Finalizar\n \n");
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"\0A*********************** Preguntas ***********************\0A\00"
@.str.1 = [183 x i8] c"1- Solicitar la hora del sistema\0A1- Solicitar la fecha del sistema\0A3- Solicitar el nombre del sistema\0A4- Solicitar informacion sobre la cantidad de usuarios logueados\0A0- Finalizar\0A \0A\00"
define void @menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [59 x i8] c"\0A*********************** Preguntas ***********************\00"
@str.2 = [182 x i8] c"1- Solicitar la hora del sistema\0A1- Solicitar la fecha del sistema\0A3- Solicitar el nombre del sistema\0A4- Solicitar informacion sobre la cantidad de usuarios logueados\0A0- Finalizar\0A \00"
define void @menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([182 x i8], [182 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t col_get_blue(int colour) { return colour & 0xFF; }


x86 assembly (clang, -O0):
<col_get_blue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<col_get_blue>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @col_get_blue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}

LLVM IR (-O2):
define i32 @col_get_blue(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
int ft_nbrmod(int n1, int n2) {
  int r;
  r = n1 % n2;
  return (r < 0 ? r + n2 : r);
}


x86 assembly (clang, -O0):
<ft_nbrmod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    112c <ft_nbrmod+0x2c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <ft_nbrmod+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrmod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ft_nbrmod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
br label %17
15: ; preds = %2
%16 = load i32, i32* %5
br label %17
17: ; preds = %15, %11
%18 = phi i32 [ %14, %11 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @ft_nbrmod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int gui_window_get_width();
int /*<<< orphan*/ snprintf(char *, int, char *, int);
const char *plugin_api_info_term_width_cb(void *data, const char *info_name,
                                          const char *arguments) {
  static char value[32];
  (void)data;
  (void)info_name;
  (void)arguments;
  snprintf(value, sizeof(value), "%d", gui_window_get_width());
  return value;
}


x86 assembly (clang, -O0):
<plugin_api_info_term_width_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <gui_window_get_width@plt>
mov    %eax,%ecx
lea    0x2efc(%rip),%rdi
mov    $0x20,%esi
lea    0xeb0(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ee4(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_api_info_term_width_cb>:
push   %rbx
xor    %eax,%eax
call   1040 <gui_window_get_width@plt>
lea    0x2f11(%rip),%rbx
lea    0xeca(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %eax,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@plugin_api_info_term_width_cb.value = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @plugin_api_info_term_width_cb(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 (...) @gui_window_get_width()
%11 = call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_term_width_cb.value, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_term_width_cb.value, i64 0, i64 0)
}

LLVM IR (-O2):
@plugin_api_info_term_width_cb.value = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @plugin_api_info_term_width_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @gui_window_get_width()
%5 = tail call i32 @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_term_width_cb.value, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @plugin_api_info_term_width_cb.value, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ rpi_close();
int /*<<< orphan*/ spi_stop();
void sighandler(int signum) {
  printf("\nsighandler invoked %d, exiting ...\n", signum);
  spi_stop();
  puts("closing rpi ...");
  rpi_close();
  exit(1);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <spi_stop@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <rpi_close@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
mov    %edi,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <spi_stop@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <rpi_close@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0Asighandler invoked %d, exiting ...\0A\00"
@.str.1 = [16 x i8] c"closing rpi ...\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @spi_stop()
%6 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @rpi_close()
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0Asighandler invoked %d, exiting ...\0A\00"
@.str.1 = [16 x i8] c"closing rpi ...\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @spi_stop()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @rpi_close()
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef char u_char;

/* Variables and functions */
scalar_t__ isalnum(char);
int isvalid(u_char c) {
  return (c == '/' || c == '@' || c == '_' || isalnum(c));
}


x86 assembly (clang, -O0):
<isvalid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     1167 <isvalid+0x57>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x40,%ecx
mov    %al,-0x2(%rbp)
je     1167 <isvalid+0x57>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     1167 <isvalid+0x57>
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvalid>:
lea    -0x2f(%rdi),%ecx
cmp    $0x30,%cl
ja     1131 <isvalid+0x21>
mov    $0x1,%eax
movzbl %cl,%ecx
movabs $0x1000000020001,%rdx
bt     %rcx,%rdx
jae    1131 <isvalid+0x21>
ret
push   %rax
movsbl %dil,%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isvalid(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 47
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 64
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 95
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = call i64 @isalnum(i8 signext %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isvalid(i8 signext %0) {
switch i8 %0, label %2 [
i8 95, label %6
i8 64, label %6
i8 47, label %6
]
2: ; preds = %1
%3 = tail call i64 @isalnum(i8 signext %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %1, %2
%7 = phi i32 [ 1, %1 ], [ %5, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
void HardFault_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HardFault_Handler+0x9>
jmp    1109 <HardFault_Handler+0x9>

x86 assembly (clang, -O2):
<HardFault_Handler>:
jmp    1100 <HardFault_Handler>

LLVM IR (-O0):
define void @HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
char *hashValue(char *sentence) { return "hash sample"; }


x86 assembly (clang, -O0):
<hashValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashValue>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hash sample\00"
define i8* @hashValue(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"hash sample\00"
define i8* @hashValue(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int int64_t;

/* Variables and functions */
uint32_t hash64_32shift(int64_t key) {
  key = (~key) + (key << 18);
  key = key ^ (key >> 31);
  key = key * 21;
  key = key ^ (key >> 11);
  key = key + (key << 6);
  key = key ^ (key >> 22);
  return (uint32_t)key;
}


x86 assembly (clang, -O0):
<hash64_32shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
shl    $0x12,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x15,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xb,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x16,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash64_32shift>:
mov    %edi,%eax
not    %eax
shl    $0x12,%edi
add    %eax,%edi
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%eax
mov    %eax,%ecx
sar    $0xb,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shl    $0x6,%edx
add    %ecx,%edx
mov    %edx,%eax
sar    $0x16,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash64_32shift(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = load i32, i32* %2
%6 = shl i32 %5, 18
%7 = add nsw i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 31
%11 = xor i32 %8, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 21
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 11
%17 = xor i32 %14, %16
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = shl i32 %19, 6
%21 = add nsw i32 %18, %20
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 22
%25 = xor i32 %22, %24
store i32 %25, i32* %2
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @hash64_32shift(i32 %0) {
%2 = xor i32 %0, -1
%3 = shl i32 %0, 18
%4 = add nsw i32 %3, %2
%5 = ashr i32 %4, 31
%6 = xor i32 %5, %4
%7 = mul nsw i32 %6, 21
%8 = ashr i32 %7, 11
%9 = xor i32 %8, %7
%10 = mul i32 %9, 65
%11 = ashr i32 %10, 22
%12 = xor i32 %11, %10
ret i32 %12
}
/* Variables and functions */
unsigned int bitset_add(unsigned int, int);
unsigned int bitset_empty();
unsigned int bitgraph_neighbors_get(unsigned int graph, unsigned int node) {
  if (graph)
    return bitset_add(bitset_add(bitset_add(bitset_empty(), 0), 1), 3);
  return 0;
}


x86 assembly (clang, -O0):
<bitgraph_neighbors_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1168 <bitgraph_neighbors_get+0x48>
mov    $0x0,%al
call   1030 <bitset_empty@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <bitset_add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <bitset_add@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <bitset_add@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <bitgraph_neighbors_get+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitgraph_neighbors_get>:
test   %edi,%edi
je     114e <bitgraph_neighbors_get+0x2e>
push   %rax
xor    %eax,%eax
call   1030 <bitset_empty@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <bitset_add@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <bitset_add@plt>
mov    %eax,%edi
mov    $0x3,%esi
pop    %rax
jmp    1040 <bitset_add@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @bitgraph_neighbors_get(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = call i32 (...) @bitset_empty()
%10 = call i32 @bitset_add(i32 %9, i32 0)
%11 = call i32 @bitset_add(i32 %10, i32 1)
%12 = call i32 @bitset_add(i32 %11, i32 3)
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @bitgraph_neighbors_get(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 (...) @bitset_empty()
%6 = tail call i32 @bitset_add(i32 %5, i32 0)
%7 = tail call i32 @bitset_add(i32 %6, i32 1)
%8 = tail call i32 @bitset_add(i32 %7, i32 3)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ glutBitmapHelvetica12;
unsigned glob_glutBitmapHelvetica12(void) {
  return (unsigned)&glutBitmapHelvetica12;
}


x86 assembly (clang, -O0):
<glob_glutBitmapHelvetica12>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glob_glutBitmapHelvetica12>:
mov    0x2eda(%rip),%eax
ret

LLVM IR (-O0):
@glutBitmapHelvetica12 = global i32 0
define i32 @glob_glutBitmapHelvetica12() {
ret i32 ptrtoint (i32* @glutBitmapHelvetica12 to i32)
}

LLVM IR (-O2):
@glutBitmapHelvetica12 = global i32 0
define i32 @glob_glutBitmapHelvetica12() {
ret i32 ptrtoint (i32* @glutBitmapHelvetica12 to i32)
}
/* Variables and functions */
int /*<<< orphan*/ appendString(char *);
void nl(void) { appendString("\n"); }


x86 assembly (clang, -O0):
<nl>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <appendString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl>:
lea    0xee9(%rip),%rdi
jmp    1030 <appendString@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @nl() {
%1 = call i32 @appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @nl() {
%1 = tail call i32 @appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void blinkOff(void) { printf("\x01B[0m"); }


x86 assembly (clang, -O0):
<blinkOff>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkOff>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
define void @blinkOff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @blinkOff() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ is_winner(char);
char find_winner(void) {
  char players[] = {'X', 'O'};
  uint8_t i;
  for (i = 0; i < 2; ++i)
    if (is_winner(players[i]))
      return players[i];
  return 0;
}


x86 assembly (clang, -O0):
<find_winner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x3(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116f <find_winner+0x5f>
movslq -0x8(%rbp),%rax
movsbl -0x3(%rbp,%rax,1),%edi
call   1030 <is_winner@plt>
cmp    $0x0,%rax
je     115c <find_winner+0x4c>
movslq -0x8(%rbp),%rax
mov    -0x3(%rbp,%rax,1),%al
mov    %al,-0x1(%rbp)
jmp    1173 <find_winner+0x63>
jmp    1161 <find_winner+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112a <find_winner+0x1a>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_winner>:
push   %rbx
mov    $0x58,%edi
call   1030 <is_winner@plt>
mov    %rax,%rcx
mov    $0x58,%al
test   %rcx,%rcx
je     1127 <find_winner+0x17>
pop    %rbx
ret
mov    $0x4f,%ebx
mov    $0x4f,%edi
call   1030 <is_winner@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.find_winner.players = [2 x i8] c"XO"
define signext i8 @find_winner() {
%1 = alloca i8
%2 = alloca [2 x i8]
%3 = alloca i32
%4 = bitcast [2 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = call i64 @is_winner(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %8
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
store i8 %19, i8* %1
br label %25
20: ; preds = %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
store i8 0, i8* %1
br label %25
25: ; preds = %24, %15
%26 = load i8, i8* %1
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @find_winner() {
%1 = tail call i64 @is_winner(i8 signext 88)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 @is_winner(i8 signext 79)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8 0, i8 79
br label %7
7: ; preds = %3, %0
%8 = phi i8 [ 88, %0 ], [ %6, %3 ]
ret i8 %8
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double bench_get_time() {
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return t.tv_sec + t.tv_nsec * 1e-9;
}


x86 assembly (clang, -O0):
<bench_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_get_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @bench_get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-09, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
@CLOCK_MONOTONIC = global i32 0
define double @bench_get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-09, double %6)
ret double %10
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ charge_generic(struct battle_char *, struct battle_char *,
                                  int);
void charge20(struct battle_char *origin, struct battle_char *target) {
  charge_generic(origin, target, 20);
}


x86 assembly (clang, -O0):
<charge20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x14,%edx
call   1030 <charge_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charge20>:
mov    $0x14,%edx
jmp    1030 <charge_generic@plt>

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @charge20(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = load %struct.battle_char*, %struct.battle_char** %3
%6 = load %struct.battle_char*, %struct.battle_char** %4
%7 = call i32 @charge_generic(%struct.battle_char* %5, %struct.battle_char* %6, i32 20)
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @charge20(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i32 @charge_generic(%struct.battle_char* %0, %struct.battle_char* %1, i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clearscreen(void) { printf("\033[2J"); }


x86 assembly (clang, -O0):
<clearscreen>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearscreen>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @clearscreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @clearscreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int FileSymEnc(char const *, char const *);
int /*<<< orphan*/ printf(char *);
void main() {
  int ret = 0;
  const char *file1 = "./source.txt";
  const char *file2 = "./destination.txt";
  ret = FileSymEnc(file1, file2);
  if (ret != 0) {
    printf("func FileSymEnc() err\n ");
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <FileSymEnc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1170 <main+0x50>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <main+0x55>
jmp    1175 <main+0x55>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rsi
call   1040 <FileSymEnc@plt>
test   %eax,%eax
je     1145 <main+0x25>
lea    0xee0(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"./source.txt\00"
@.str.1 = [18 x i8] c"./destination.txt\00"
@.str.2 = [24 x i8] c"func FileSymEnc() err\0A \00"
define void @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @FileSymEnc(i8* %4, i8* %5)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %12
11: ; preds = %0
br label %12
12: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"./source.txt\00"
@.str.1 = [18 x i8] c"./destination.txt\00"
@.str.2 = [24 x i8] c"func FileSymEnc() err\0A \00"
define void @main() {
%1 = tail call i32 @FileSymEnc(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
ret void
}
/* Variables and functions */
void b_loop(int *buf, size_t size) {
  size_t i;
  for (i = size; i > 0; --i)
    buf[i - 1] = 0;
}


x86 assembly (clang, -O0):
<b_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1143 <b_loop+0x43>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <b_loop+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_loop>:
test   %rsi,%rsi
je     1128 <b_loop+0x18>
push   %rax
mov    %rsi,%rdx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @b_loop(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
store i64 %6, i64* %5
br label %7
7: ; preds = %15, %2
%8 = load i64, i64* %5
%9 = icmp ugt i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i64, i64* %5
%17 = add i64 %16, -1
store i64 %17, i64* %5
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @b_loop(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = shl nuw i64 %1, 2
br label %7
7: ; preds = %4, %2
ret void
}
int ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) {
  zend_bailout();
  ZEND_VM_NEXT_OPCODE();
}


x86 assembly (clang, -O0):
<ZEND_EXIT_SPEC_CONST_HANDLER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <zend_bailout@plt>
mov    $0x0,%al
call   1040 <ZEND_VM_NEXT_OPCODE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZEND_EXIT_SPEC_CONST_HANDLER>:
push   %rax
xor    %eax,%eax
call   1030 <zend_bailout@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ZEND_VM_NEXT_OPCODE@plt>

LLVM IR (-O0):
define i32 @ZEND_EXIT_SPEC_CONST_HANDLER(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @zend_bailout()
%5 = call i32 (...) @ZEND_VM_NEXT_OPCODE()
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @ZEND_EXIT_SPEC_CONST_HANDLER(i32 %0) {
%2 = tail call i32 (...) @zend_bailout()
%3 = tail call i32 (...) @ZEND_VM_NEXT_OPCODE()
ret i32 undef
}
int max(int i, int j) { return (i > j ? i : j); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ run_test_list();
int main(int argc, char *argv[]) {
  run_test_list();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <run_test_list@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run_test_list@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @run_test_list()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run_test_list()
ret i32 0
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Tcutil_deep_copy_exp(int, struct Cyc_Absyn_Exp *);
struct Cyc_Absyn_Exp *Cyc_Tcutil_deep_copy_exp_opt(int preserve_types,
                                                   struct Cyc_Absyn_Exp *e) {
  if (e == 0)
    return 0;
  else {
    return ({ Cyc_Tcutil_deep_copy_exp(preserve_types, e); });
  }
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_deep_copy_exp_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <Cyc_Tcutil_deep_copy_exp_opt+0x27>
movq   $0x0,-0x8(%rbp)
jmp    114e <Cyc_Tcutil_deep_copy_exp_opt+0x3e>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <Cyc_Tcutil_deep_copy_exp@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_deep_copy_exp_opt>:
test   %rsi,%rsi
je     1122 <Cyc_Tcutil_deep_copy_exp_opt+0x12>
push   %rax
call   1030 <Cyc_Tcutil_deep_copy_exp@plt>
cltq
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Tcutil_deep_copy_exp_opt(i32 %0, %struct.Cyc_Absyn_Exp* %1) {
%3 = alloca %struct.Cyc_Absyn_Exp*
%4 = alloca i32
%5 = alloca %struct.Cyc_Absyn_Exp*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %5
%7 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
%8 = icmp eq %struct.Cyc_Absyn_Exp* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store %struct.Cyc_Absyn_Exp* null, %struct.Cyc_Absyn_Exp** %3
br label %17
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
%13 = call i32 @Cyc_Tcutil_deep_copy_exp(i32 %11, %struct.Cyc_Absyn_Exp* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to %struct.Cyc_Absyn_Exp*
store %struct.Cyc_Absyn_Exp* %16, %struct.Cyc_Absyn_Exp** %3
br label %17
17: ; preds = %10, %9
%18 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
ret %struct.Cyc_Absyn_Exp* %18
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Tcutil_deep_copy_exp_opt(i32 %0, %struct.Cyc_Absyn_Exp* %1) {
%3 = icmp eq %struct.Cyc_Absyn_Exp* %1, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @Cyc_Tcutil_deep_copy_exp(i32 %0, %struct.Cyc_Absyn_Exp* %1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.Cyc_Absyn_Exp*
br label %8
8: ; preds = %2, %4
%9 = phi %struct.Cyc_Absyn_Exp* [ %7, %4 ], [ null, %2 ]
ret %struct.Cyc_Absyn_Exp* %9
}
float m_sgn(float value) {
  if (value < 0)
    return -1;
  if (value > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<m_sgn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1128 <m_sgn+0x28>
movss  0xee6(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <m_sgn+0x53>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    114b <m_sgn+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <m_sgn+0x53>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_sgn>:
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm0,%xmm2
movss  0xeed(%rip),%xmm3
andps  %xmm2,%xmm3
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andnps %xmm3,%xmm1
movss  0xedb(%rip),%xmm2
andps  %xmm2,%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @m_sgn(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float -1.000000e+00, float* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp ogt float %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store float 1.000000e+00, float* %2
br label %12
11: ; preds = %7
store float 0.000000e+00, float* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @m_sgn(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 0.000000e+00
%4 = select i1 %3, float 1.000000e+00, float 0.000000e+00
%5 = select i1 %2, float -1.000000e+00, float %4
ret float %5
}
/* Variables and functions */
int putchar(char);
int main(void) {
  char *data = "Hello World!", *ptr;
  int offset = 4;
  int diff = -2;
  ptr = data + offset + diff - diff;
  return putchar(*ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x4,-0x1c(%rbp)
movl   $0xfffffffe,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x6f,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 4, i32* %4
store i32 -2, i32* %5
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = sub i64 0, %14
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = call i32 @putchar(i8 signext %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 111)
ret i32 %1
}
void cprop_test3(int *data) {
  int j = 12345;
  if (data[0])
    data[1] = 1 + j - 1234;
  else
    data[2] = 123 + j + 10;
}


x86 assembly (clang, -O0):
<cprop_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x3039,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1134 <cprop_test3+0x34>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
sub    $0x4d2,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
jmp    1144 <cprop_test3+0x44>
mov    -0xc(%rbp),%ecx
add    $0x7b,%ecx
add    $0xa,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_test3>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
mov    $0x30be,%ecx
mov    $0x2b68,%edx
cmove  %ecx,%edx
mov    %edx,0x4(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @cprop_test3(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 12345, i32* %3
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 1, %9
%11 = sub nsw i32 %10, 1234
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
br label %20
14: ; preds = %1
%15 = load i32, i32* %3
%16 = add nsw i32 123, %15
%17 = add nsw i32 %16, 10
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
br label %20
20: ; preds = %14, %8
ret void
}

LLVM IR (-O2):
define void @cprop_test3(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i64 2, i64 1
%5 = select i1 %3, i32 12478, i32 11112
%6 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %5, i32* %6
ret void
}
void Sys_PlatformPostInit(char *progname) {}


x86 assembly (clang, -O0):
<Sys_PlatformPostInit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_PlatformPostInit>:
ret

LLVM IR (-O0):
define void @Sys_PlatformPostInit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @Sys_PlatformPostInit(i8* nocapture %0) {
ret void
}
void f(int x, int *y) { x = *(y) += 2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0x2,%eax
mov    %eax,(%rcx)
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
addl   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @f(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 2
store i32 %7, i32* %5
store i32 %7, i32* %3
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 2
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int main(void) { _exit(1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int parse(int, int);
ejEval() {
  int state;
  state = parse(8, 0x1);
}


x86 assembly (clang, -O0):
<ejEval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
mov    $0x1,%esi
call   1030 <parse@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ejEval>:
mov    $0x8,%edi
mov    $0x1,%esi
jmp    1030 <parse@plt>

LLVM IR (-O0):
define i32 @ejEval() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @parse(i32 8, i32 1)
store i32 %3, i32* %2
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ejEval() {
%1 = tail call i32 @parse(i32 8, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Hello(void) { printf("Hello world.\n"); }


x86 assembly (clang, -O0):
<Hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hello>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world.\0A\00"
define void @Hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world.\00"
define void @Hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ AssignFind(char *);
scalar_t__ ScopeFind(char *);
scalar_t__ StructFind(char *);
int CheckStruct(char *name) {
  if (StructFind(name) || AssignFind(name) || ScopeFind(name))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<CheckStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <StructFind@plt>
cmp    $0x0,%rax
jne    1175 <CheckStruct+0x45>
mov    -0x10(%rbp),%rdi
call   1050 <AssignFind@plt>
cmp    $0x0,%rax
jne    1175 <CheckStruct+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <ScopeFind@plt>
cmp    $0x0,%rax
je     1181 <CheckStruct+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1188 <CheckStruct+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckStruct>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <StructFind@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1163 <CheckStruct+0x33>
mov    %rbx,%rdi
call   1050 <AssignFind@plt>
test   %rax,%rax
jne    1163 <CheckStruct+0x33>
mov    %rbx,%rdi
call   1030 <ScopeFind@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CheckStruct(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @StructFind(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @AssignFind(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = call i64 @ScopeFind(i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i32 1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @CheckStruct(i8* %0) {
%2 = tail call i64 @StructFind(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @AssignFind(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @ScopeFind(i8* %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %1, %4
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
void _farnspokeb(unsigned long offset, unsigned char value) {
  __asm__ __volatile__(".byte 0x64\n"
                       "	movb %b0,(%k1)"
                       :
                       : "qi"(value), "r"(offset));
}


x86 assembly (clang, -O0):
<_farnspokeb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rcx
mov    %al,%fs:(%ecx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_farnspokeb>:
mov    %sil,%fs:(%edi)
ret

LLVM IR (-O0):
define void @_farnspokeb(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i64, i64* %3
ret void
}

LLVM IR (-O2):
define void @_farnspokeb(i64 %0, i8 zeroext %1) {
tail call void asm sideeffect ".byte 0x64\0A\09movb ${0:b},(${1:k})", "qi,r,~{dirflag},~{fpsr},~{flags}"(i8 %1, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int c_stack_action(void (*action)(int, void *, void *)) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<c_stack_action>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_stack_action>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @c_stack_action(void (i32, i8*, i8*)* %0) {
%2 = alloca void (i32, i8*, i8*)*
store void (i32, i8*, i8*)* %0, void (i32, i8*, i8*)** %2
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @c_stack_action(void (i32, i8*, i8*)* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
store i32 %2, i32* @errno
ret i32 -1
}