xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ check_write(int, unsigned int, char *);
void outl_p(unsigned int value, unsigned short int port) {
  check_write((int)port, value, "outl_p");
}


x86 assembly (clang, -O0):
<outl_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdx
call   1030 <check_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl_p>:
mov    %edi,%eax
lea    0xee7(%rip),%rdx
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <check_write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"outl_p\00"
define void @outl_p(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = load i32, i32* %3
%8 = call i32 @check_write(i32 %6, i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"outl_p\00"
define void @outl_p(i32 %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = tail call i32 @check_write(i32 %3, i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int size = sizeof(void *);
  printf("%d", size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 8, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
void g_hash_table_remove_all() {}


x86 assembly (clang, -O0):
<g_hash_table_remove_all>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @g_hash_table_remove_all() {
ret void
}

LLVM IR (-O2):
define void @g_hash_table_remove_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
void skipLeadingSpacesWithPos(char *s, int *posPtr) {
  for (;;) {
    char c = s[*posPtr];
    if (!isspace(c))
      return;
    (*posPtr)++;
  }
}


x86 assembly (clang, -O0):
<skipLeadingSpacesWithPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1149 <skipLeadingSpacesWithPos+0x39>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1120 <skipLeadingSpacesWithPos+0x10>

x86 assembly (clang, -O2):
<skipLeadingSpacesWithPos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movslq (%rsi),%rax
movsbl (%rdi,%rax,1),%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %eax,%eax
je     114a <skipLeadingSpacesWithPos+0x3a>
movslq (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %ecx,(%rbx)
movsbl 0x1(%r14,%rax,1),%edi
jmp    1130 <skipLeadingSpacesWithPos+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @skipLeadingSpacesWithPos(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @isspace(i8 signext %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %2, %9
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = tail call i32 @isspace(i8 signext %14)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %2
ret void
}
/* Variables and functions */
int GET32(int);
int /*<<< orphan*/ PUT32(int, unsigned int);
void uart_putc(unsigned int c) {
  while (1) {
    if ((GET32((0x20201000 + 0x18)) & 0x20) == 0)
      break;
  }
  PUT32((0x20201000 + 0x00), c);
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20201018,%edi
call   1040 <GET32@plt>
and    $0x20,%eax
cmp    $0x0,%eax
jne    1146 <uart_putc+0x26>
jmp    114b <uart_putc+0x2b>
jmp    112b <uart_putc+0xb>
mov    -0x4(%rbp),%esi
mov    $0x20201000,%edi
call   1030 <PUT32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20201018,%edi
call   1040 <GET32@plt>
test   $0x20,%al
jne    1130 <uart_putc+0x10>
mov    $0x20201000,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @uart_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %8
%4 = call i32 @GET32(i32 538972184)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load i32, i32* %2
%11 = call i32 @PUT32(i32 538972160, i32 %10)
ret void
}

LLVM IR (-O2):
define void @uart_putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @GET32(i32 538972184)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @PUT32(i32 538972160, i32 %0)
ret void
}
float lt_float(float a, float b) { return a < b; }


x86 assembly (clang, -O0):
<lt_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_float>:
cmpltss %xmm1,%xmm0
movss  0xef3(%rip),%xmm1
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lt_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @lt_float(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = uitofp i1 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XKillClient() {
  printf("XKillClient called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<XKillClient>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [19 x i8] c"XKillClient called\00"
define i32 @XKillClient() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void intro(void) {
  printf("*****************************************\n");
  printf("*    SST--Simple Steganography Tool     *\n");
  printf("* Copyright(C) Panagiotis Michalopoulos *\n");
  printf("*****************************************\n\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"*****************************************\0A\00"
@.str.1 = [43 x i8] c"* SST--Simple Steganography Tool *\0A\00"
@.str.2 = [43 x i8] c"* Copyright(C) Panagiotis Michalopoulos *\0A\00"
@.str.3 = [44 x i8] c"*****************************************\0A\0A\00"
define void @intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"*****************************************\00"
@str.4 = [42 x i8] c"* SST--Simple Steganography Tool *\00"
@str.5 = [42 x i8] c"* Copyright(C) Panagiotis Michalopoulos *\00"
@str.6 = [43 x i8] c"*****************************************\0A\00"
define void @intro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LED_BLINK_EN_SaveConfig();
void LED_BLINK_EN_Sleep(void) { LED_BLINK_EN_SaveConfig(); }


x86 assembly (clang, -O0):
<LED_BLINK_EN_Sleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LED_BLINK_EN_SaveConfig@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LED_BLINK_EN_Sleep>:
xor    %eax,%eax
jmp    1030 <LED_BLINK_EN_SaveConfig@plt>

LLVM IR (-O0):
define void @LED_BLINK_EN_Sleep() {
%1 = call i32 (...) @LED_BLINK_EN_SaveConfig()
ret void
}

LLVM IR (-O2):
define void @LED_BLINK_EN_Sleep() {
%1 = tail call i32 (...) @LED_BLINK_EN_SaveConfig()
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  void *p_block = malloc(100);
  printf("block address : %p\n", p_block);
  printf("sizeof int: %lu\n", sizeof(int));
  printf("sizeof block : %d\n", *((int *)(p_block - 8)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    -0x8(%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    -0x8(%rbx),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"block address : %p\0A\00"
@.str.1 = [17 x i8] c"sizeof int: %lu\0A\00"
@.str.2 = [19 x i8] c"sizeof block : %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i8* @malloc(i32 100)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = ptrtoint i8* %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4)
%11 = load i8*, i8** %5
%12 = getelementptr i8, i8* %11, i64 -8
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"block address : %p\0A\00"
@.str.1 = [17 x i8] c"sizeof int: %lu\0A\00"
@.str.2 = [19 x i8] c"sizeof block : %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4)
%8 = getelementptr i8, i8* %3, i64 -8
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}
int test_imm_30uint16_mem(unsigned short *val) {
  return ((*val) & (0x30 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_30uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x30,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_30uint16_mem>:
testb  $0x30,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_30uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 48
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_30uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 48
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int data_getresource(int, int);
int *gethand(int player, int array[5]) {
  int i;
  for (i = 0; i < 5; i++)
    *(array + i) = data_getresource(player, i);
  return array;
}


x86 assembly (clang, -O0):
<gethand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1156 <gethand+0x46>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <data_getresource@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <gethand+0x16>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethand>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %esi,%esi
call   1030 <data_getresource@plt>
mov    %eax,(%rbx)
mov    %ebp,%edi
mov    $0x1,%esi
call   1030 <data_getresource@plt>
mov    %eax,0x4(%rbx)
mov    %ebp,%edi
mov    $0x2,%esi
call   1030 <data_getresource@plt>
mov    %eax,0x8(%rbx)
mov    %ebp,%edi
mov    $0x3,%esi
call   1030 <data_getresource@plt>
mov    %eax,0xc(%rbx)
mov    %ebp,%edi
mov    $0x4,%esi
call   1030 <data_getresource@plt>
mov    %eax,0x10(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @gethand(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = call i32 @data_getresource(i32 %10, i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
br label %17
17: ; preds = %9
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i32*, i32** %4
ret i32* %21
}

LLVM IR (-O2):
define i32* @gethand(i32 %0, i32* returned writeonly %1) {
%3 = tail call i32 @data_getresource(i32 %0, i32 0)
store i32 %3, i32* %1
%4 = tail call i32 @data_getresource(i32 %0, i32 1)
%5 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %4, i32* %5
%6 = tail call i32 @data_getresource(i32 %0, i32 2)
%7 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %6, i32* %7
%8 = tail call i32 @data_getresource(i32 %0, i32 3)
%9 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %8, i32* %9
%10 = tail call i32 @data_getresource(i32 %0, i32 4)
%11 = getelementptr inbounds i32, i32* %1, i64 4
store i32 %10, i32* %11
ret i32* %1
}
float roundf(float x) {
  return (float)((x - ((long)x) >= 0.5f) ? (((long)x) + 1) : ((long)x));
}


x86 assembly (clang, -O0):
<roundf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si -0x4(%rbp),%rax
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
movss  0xedb(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1141 <roundf+0x41>
cvttss2si -0x4(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114b <roundf+0x4b>
cvttss2si -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundf>:
cvttss2si %xmm0,%rax
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
ucomiss 0xeeb(%rip),%xmm0
sbb    $0xffffffffffffffff,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
ret

LLVM IR (-O0):
define float @roundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i64
%6 = sitofp i64 %5 to float
%7 = fsub float %3, %6
%8 = fcmp oge float %7, 5.000000e-01
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load float, float* %2
%11 = fptosi float %10 to i64
%12 = add nsw i64 %11, 1
br label %16
13: ; preds = %1
%14 = load float, float* %2
%15 = fptosi float %14 to i64
br label %16
16: ; preds = %13, %9
%17 = phi i64 [ %12, %9 ], [ %15, %13 ]
%18 = sitofp i64 %17 to float
ret float %18
}

LLVM IR (-O2):
define float @roundf(float %0) {
%2 = fptosi float %0 to i64
%3 = sitofp i64 %2 to float
%4 = fsub float %0, %3
%5 = fcmp oge float %4, 5.000000e-01
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
%8 = sitofp i64 %7 to float
ret float %8
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Guten %d\n", fork());
  printf("Tag %d\n", fork());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <fork@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Guten %d\0A\00"
@.str.1 = [8 x i8] c"Tag %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @fork()
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Guten %d\0A\00"
@.str.1 = [8 x i8] c"Tag %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
double sum(int l_inf, int l_sup, double (*function)(double)) {
  double res = 0.0;
  for (int i = l_inf; i < l_sup; i++) {
    res += (function)(i);
  }
  return res;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114f <sum+0x4f>
mov    -0x10(%rbp),%rax
cvtsi2sdl -0x1c(%rbp),%xmm0
call   *%rax
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <sum+0x20>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
cmp    %esi,%edi
jge    114d <sum+0x4d>
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
xorps  %xmm0,%xmm0
nopl   0x0(%rax)
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
call   *%r14
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1120 <sum+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @sum(i32 %0, i32 %1, double (double)* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double (double)*
%7 = alloca double
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store double (double)* %2, double (double)** %6
store double 0.000000e+00, double* %7
%9 = load i32, i32* %4
store i32 %9, i32* %8
br label %10
10: ; preds = %21, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load double (double)*, double (double)** %6
%16 = load i32, i32* %8
%17 = sitofp i32 %16 to double
%18 = call double %15(double %17)
%19 = load double, double* %7
%20 = fadd double %19, %18
store double %20, double* %7
br label %21
21: ; preds = %14
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
br label %10
24: ; preds = %10
%25 = load double, double* %7
ret double %25
}

LLVM IR (-O2):
define double @sum(i32 %0, i32 %1, double (double)* nocapture %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %7, label %5
5: ; preds = %7, %3
%6 = phi double [ 0.000000e+00, %3 ], [ %12, %7 ]
ret double %6
7: ; preds = %3, %7
%8 = phi i32 [ %13, %7 ], [ %0, %3 ]
%9 = phi double [ %12, %7 ], [ 0.000000e+00, %3 ]
%10 = sitofp i32 %8 to double
%11 = tail call double %2(double %10)
%12 = fadd double %9, %11
%13 = add i32 %8, 1
%14 = icmp eq i32 %13, %1
br i1 %14, label %5, label %7
}
/* Variables and functions */
int /*<<< orphan*/ video_printcolor(char const *, int, int);
void __debug(const char *str) { video_printcolor(str, 0x00, 0x0C); }


x86 assembly (clang, -O0):
<__debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <video_printcolor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__debug>:
xor    %esi,%esi
mov    $0xc,%edx
jmp    1030 <video_printcolor@plt>

LLVM IR (-O0):
define void @__debug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @video_printcolor(i8* %3, i32 0, i32 12)
ret void
}

LLVM IR (-O2):
define void @__debug(i8* %0) {
%2 = tail call i32 @video_printcolor(i8* %0, i32 0, i32 12)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t htob_16(int16_t hostval) {
  union {
    int16_t s;
    uint8_t b[2];
  } u1, u2;
  u1.s = hostval;
  u2.b[0] = u1.b[1];
  u2.b[1] = u1.b[0];
  return u2.s;
}


x86 assembly (clang, -O0):
<htob_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [2 x i32] }
define i32 @htob_16(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca %union.anon
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to [2 x i32]*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%9 = load i32, i32* %8
%10 = bitcast %union.anon* %4 to [2 x i32]*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %9, i32* %11
%12 = bitcast %union.anon* %3 to [2 x i32]*
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%14 = load i32, i32* %13
%15 = bitcast %union.anon* %4 to [2 x i32]*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
store i32 %14, i32* %16
%17 = bitcast %union.anon* %4 to i32*
%18 = load i32, i32* %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @htob_16(i32 %0) {
ret i32 undef
}
extern void save_atomic_float(float v, float *loc) {
  int val;
  void *pp1 = (void *)&val;
  float *pp2 = (float *)pp1;
  *pp2 = v;
  __atomic_store_n((int *)loc, val, 0);
}


x86 assembly (clang, -O0):
<save_atomic_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,-0x2c(%rbp)
mov    -0x2c(%rbp),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_atomic_float>:
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @save_atomic_float(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca float*
%8 = alloca i32
store float %0, float* %3
store float* %1, float** %4
%9 = bitcast i32* %5 to i8*
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to float*
store float* %11, float** %7
%12 = load float, float* %3
%13 = load float*, float** %7
store float %12, float* %13
%14 = load float*, float** %4
%15 = bitcast float* %14 to i32*
%16 = load i32, i32* %5
store i32 %16, i32* %8
%17 = load i32, i32* %8
store atomic i32 %17, i32* %15 monotonic
ret void
}

LLVM IR (-O2):
define void @save_atomic_float(float %0, float* nocapture writeonly %1) {
%3 = bitcast float %0 to i32
%4 = bitcast float* %1 to i32*
store atomic i32 %3, i32* %4 monotonic
ret void
}
int FastIntAbs(int x) { return (x > 0) ? x : -x; }


x86 assembly (clang, -O0):
<FastIntAbs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <FastIntAbs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <FastIntAbs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastIntAbs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @FastIntAbs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int test_search_vunit_function(void) {}


x86 assembly (clang, -O0):
<test_search_vunit_function>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_search_vunit_function() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_search_vunit_function() {
ret i32 undef
}
int soma_diagonal_s(int mat[3][3]) {
  int i, j, soma = 0;
  for (i = 0; i < 3; i++) {
    soma += mat[i][(3 - 1) - i];
  }
  return soma;
}


x86 assembly (clang, -O0):
<soma_diagonal_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1151 <soma_diagonal_s+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    $0x2,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <soma_diagonal_s+0x16>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma_diagonal_s>:
mov    0x10(%rdi),%eax
add    0x8(%rdi),%eax
add    0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @soma_diagonal_s([3 x i32]* %0) {
%2 = alloca [3 x i32]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store [3 x i32]* %0, [3 x i32]** %2
store i32 0, i32* %5
store i32 0, i32* %3
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load [3 x i32]*, [3 x i32]** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 %12
%14 = load i32, i32* %3
%15 = sub nsw i32 2, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = add nsw i32 %19, %18
store i32 %20, i32* %5
br label %21
21: ; preds = %9
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %6
24: ; preds = %6
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @soma_diagonal_s([3 x i32]* nocapture %0) {
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 2
%3 = load i32, i32* %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float metroSeg;
  scanf("%f", &metroSeg);
  printf("%f", (metroSeg * 3.6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeb5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double %5, 3.600000e+00
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = fmul double %5, 3.600000e+00
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
char readCharRet(char headerMessage[]) {
  char value;
  printf("%s", headerMessage);
  value = fgetc(stdin);
  __fpurge(stdin);
  return value;
}


x86 assembly (clang, -O0):
<readCharRet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
mov    %al,-0x9(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readCharRet>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e9e(%rip),%r14
mov    (%r14),%edi
call   1050 <fgetc@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1030 <__fpurge@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define signext i8 @readCharRet(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdin
%7 = call signext i8 @fgetc(i32 %6)
store i8 %7, i8* %3
%8 = load i32, i32* @stdin
%9 = call i32 @__fpurge(i32 %8)
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define signext i8 @readCharRet(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdin
%4 = tail call signext i8 @fgetc(i32 %3)
%5 = load i32, i32* @stdin
%6 = tail call i32 @__fpurge(i32 %5)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
float remainingAngle(float angleA, float angleB) {
  float remains = 180 - (angleA + angleB);
  if (remains <= 0) {
    printf("Remains can not be 0 \n");
    exit(EXIT_FAILURE);
  } else {
    return remains;
  }
}


x86 assembly (clang, -O0):
<remainingAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
movss  0xebc(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1174 <remainingAngle+0x54>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainingAngle>:
push   %rax
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
movss  0xed0(%rip),%xmm0
subss  %xmm2,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    113e <remainingAngle+0x1e>
pop    %rax
ret
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Remains can not be 0 \0A\00"
@EXIT_FAILURE = global i32 0
define float @remainingAngle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fadd float %6, %7
%9 = fsub float 1.800000e+02, %8
store float %9, float* %5
%10 = load float, float* %5
%11 = fcmp ole float %10, 0.000000e+00
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load float, float* %5
ret float %17
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [22 x i8] c"Remains can not be 0 \00"
define float @remainingAngle(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fsub float 1.800000e+02, %3
%5 = fcmp ugt float %4, 0.000000e+00
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret float %4
}
/* Variables and functions */
volatile bool buttonUp(volatile unsigned int *p) {
  static bool b = false;
  if (((*p) & 0x00000010) == 0x00000010) {
    if (b == false) {
      b = true;
      return true;
    } else
      return false;
  }
  b = false;
  return false;
}


x86 assembly (clang, -O0):
<buttonUp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x10,%eax
jne    1149 <buttonUp+0x49>
cmpl   $0x0,0x2f03(%rip)
jne    113d <buttonUp+0x3d>
movl   $0x1,0x2ef3(%rip)
movl   $0x1,-0x4(%rbp)
jmp    115a <buttonUp+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    115a <buttonUp+0x5a>
movl   $0x0,0x2ed1(%rip)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buttonUp>:
mov    (%rdi),%ecx
xor    %edx,%edx
test   $0x10,%cl
je     1119 <buttonUp+0x19>
mov    $0x1,%edx
xor    %eax,%eax
cmpb   $0x0,0x2f0d(%rip)
jne    1127 <buttonUp+0x27>
shr    $0x4,%cl
and    $0x1,%cl
mov    %cl,0x2eff(%rip)
mov    %edx,%eax
ret

LLVM IR (-O0):
@buttonUp.b = internal global i32 0
define i32 @buttonUp(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 16
%7 = icmp eq i32 %6, 16
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @buttonUp.b
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* @buttonUp.b
store i32 1, i32* %2
br label %14
12: ; preds = %8
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* @buttonUp.b
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@buttonUp.b = internal unnamed_addr global i1 false
define i32 @buttonUp(i32* %0) {
%2 = load volatile i32, i32* %0
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i1, i1* @buttonUp.b
br i1 %6, label %10, label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
%9 = xor i1 %4, true
store i1 %9, i1* @buttonUp.b
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 0, %5 ], [ %8, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ display_status();
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
void *watch_user_input_worker(void *arg) {
  char input[(1024)];
  (void)arg;
  while (1) {
    memset(input, 0, (1024));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
    read(STDIN_FILENO, input, (1024) - 1);
#pragma GCC diagnostic pop
    display_status();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<watch_user_input_worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rsi
mov    $0x3ff,%edx
call   1050 <read@plt>
mov    $0x0,%al
call   1030 <display_status@plt>
jmp    113f <watch_user_input_worker+0xf>

x86 assembly (clang, -O2):
<watch_user_input_worker>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rbx
mov    0x2e9c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x3ff,%edx
call   1050 <read@plt>
xor    %eax,%eax
call   1030 <display_status@plt>
jmp    1150 <watch_user_input_worker+0x20>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i8* @watch_user_input_worker(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
br label %5
5: ; preds = %1, %5
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 1024)
%8 = load i32, i32* @STDIN_FILENO
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = call i32 @read(i32 %8, i8* %9, i32 1023)
%11 = call i32 (...) @display_status()
br label %5
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define noalias i8* @watch_user_input_worker(i8* nocapture readnone %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i32 @memset(i8* %3, i32 0, i32 1024)
%6 = load i32, i32* @STDIN_FILENO
%7 = call i32 @read(i32 %6, i8* %3, i32 1023)
%8 = call i32 (...) @display_status()
br label %4
}
/* Variables and functions */
unsigned int sad_mx_n_simd(unsigned char const *, int, unsigned char const *,
                           int, unsigned int, int, int);
unsigned int vp8_sad16x16_simd(const unsigned char *src_ptr, int src_stride,
                               const unsigned char *ref_ptr, int ref_stride,
                               unsigned int max_sad) {
  return sad_mx_n_simd(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16,
                       16);
}


x86 assembly (clang, -O0):
<vp8_sad16x16_simd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x10,%r9d
movl   $0x10,(%rsp)
call   1030 <sad_mx_n_simd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad16x16_simd>:
push   %rax
movl   $0x10,(%rsp)
mov    $0x10,%r9d
call   1030 <sad_mx_n_simd@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vp8_sad16x16_simd(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @sad_mx_n_simd(i8* %11, i32 %12, i8* %13, i32 %14, i32 %15, i32 16, i32 16)
ret i32 %16
}

LLVM IR (-O2):
define i32 @vp8_sad16x16_simd(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_simd(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 16, i32 16)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ xserver_resolution(int *, int *);
void help_print_resolution() {
  int width, height;
  xserver_resolution(&width, &height);
  if (width >= 0 && height >= 0) {
    printf("%ix%i\n", width, height);
  } else {
    printf("n.a.\n");
  }
}


x86 assembly (clang, -O0):
<help_print_resolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <xserver_resolution@plt>
cmpl   $0x0,-0x4(%rbp)
jl     1162 <help_print_resolution+0x42>
cmpl   $0x0,-0x8(%rbp)
jl     1162 <help_print_resolution+0x42>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1170 <help_print_resolution+0x50>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_print_resolution>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <xserver_resolution@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
js     115d <help_print_resolution+0x2d>
mov    (%rsp),%edx
test   %edx,%edx
js     115d <help_print_resolution+0x2d>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%ix%i\0A\00"
@.str.1 = [6 x i8] c"n.a.\0A\00"
define void @help_print_resolution() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @xserver_resolution(i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
br label %15
13: ; preds = %6, %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%ix%i\0A\00"
@str = [5 x i8] c"n.a.\00"
define void @help_print_resolution() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @xserver_resolution(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, -1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, -1
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
br label %15
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void vec2Print(double v[2]) { printf("%f\n%f\n", v[0], v[1]); }


x86 assembly (clang, -O0):
<vec2Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2Print>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%f\0A%f\0A\00"
define void @vec2Print(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %5, double %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f\0A%f\0A\00"
define void @vec2Print(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %2, double %4)
ret void
}
int switch_get_state(struct switch_dev *sdev) { return 0; }


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

x86 assembly (clang, -O2):
<switch_get_state>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.switch_dev = type opaque
define i32 @switch_get_state(%struct.switch_dev* %0) {
%2 = alloca %struct.switch_dev*
store %struct.switch_dev* %0, %struct.switch_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.switch_dev = type opaque
define i32 @switch_get_state(%struct.switch_dev* nocapture readnone %0) {
ret i32 0
}