xunge/DecIR huggingface dataset:
int isspace(int c) {
  switch (c) {
  case ' ':
  case '\n':
  case '\t':
  case '\f':
  case '\v':
  case '\r':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     112f <isspace+0x2f>
jmp    111e <isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113b <isspace+0x3b>
jmp    112f <isspace+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isspace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 10, label %3
i32 9, label %3
i32 12, label %3
i32 11, label %3
i32 13, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int main(int argc, char *argv[]) {
  char str[33] = {" this has five spaces "};
  printf("input :%s\n", str);
  replacespace(str);
  printf("o-put :%s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x21,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <replacespace@plt>
lea    -0x40(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x20(%rsp)
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <replacespace@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [33 x i8] c" this has five spaces \00\00\00\00\00\00\00\00\00\00\00"
@.str = [11 x i8] c"input :%s\0A\00"
@.str.1 = [11 x i8] c"o-put :%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [33 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [33 x i8]* %5 to i8*
%7 = getelementptr inbounds [33 x i8], [33 x i8]* %5, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [33 x i8], [33 x i8]* %5, i64 0, i64 0
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @replacespace to i32 (i8*, ...)*)(i8* %9)
%11 = getelementptr inbounds [33 x i8], [33 x i8]* %5, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [33 x i8] c" this has five spaces \00\00\00\00\00\00\00\00\00\00\00"
@.str = [11 x i8] c"input :%s\0A\00"
@.str.1 = [11 x i8] c"o-put :%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [33 x i8]
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @replacespace to i32 (i8*, ...)*)(i8* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h264nal_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ h264nal_set_type(int /*<<< orphan*/ *, int);
void h264endstr_init(uint8_t *p_h264endstr) {
  h264nal_init(p_h264endstr);
  h264nal_set_type(p_h264endstr, 11);
}


x86 assembly (clang, -O0):
<h264endstr_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h264nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1030 <h264nal_set_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264endstr_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h264nal_init@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
pop    %rbx
jmp    1030 <h264nal_set_type@plt>

LLVM IR (-O0):
define void @h264endstr_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h264nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h264nal_set_type(i32* %5, i32 11)
ret void
}

LLVM IR (-O2):
define void @h264endstr_init(i32* %0) {
%2 = tail call i32 @h264nal_init(i32* %0)
%3 = tail call i32 @h264nal_set_type(i32* %0, i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bbm_write(void *, int, int);
scalar_t__ fc8080_channel_select(void *, unsigned char, unsigned char);
int fc8080_data_select(void *handle, unsigned char subch_id,
                       unsigned char buf_id) {
  if (fc8080_channel_select(handle, subch_id, buf_id) != 0)
    return 1;
  bbm_write(handle, 0x0910 + buf_id, 0x40 | subch_id);
  return 0;
}


x86 assembly (clang, -O0):
<fc8080_data_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
movzbl %al,%esi
movzbl -0x12(%rbp),%edx
call   1040 <fc8080_channel_select@plt>
cmp    $0x0,%rax
je     1160 <fc8080_data_select+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1181 <fc8080_data_select+0x61>
mov    -0x10(%rbp),%rdi
movzbl -0x12(%rbp),%esi
add    $0x910,%esi
movzbl -0x11(%rbp),%edx
or     $0x40,%edx
call   1030 <bbm_write@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8080_data_select>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
call   1040 <fc8080_channel_select@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1158 <fc8080_data_select+0x38>
movzbl %bl,%esi
add    $0x910,%esi
or     $0x40,%bpl
movzbl %bpl,%edx
mov    %r14,%rdi
call   1030 <bbm_write@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8080_data_select(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
%8 = load i8*, i8** %5
%9 = load i8, i8* %6
%10 = load i8, i8* %7
%11 = call i64 @fc8080_channel_select(i8* %8, i8 zeroext %9, i8 zeroext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 1, i32* %4
br label %23
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = add nsw i32 2320, %17
%19 = load i8, i8* %6
%20 = zext i8 %19 to i32
%21 = or i32 64, %20
%22 = call i32 @bbm_write(i8* %15, i32 %18, i32 %21)
store i32 0, i32* %4
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @fc8080_data_select(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i64 @fc8080_channel_select(i8* %0, i8 zeroext %1, i8 zeroext %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = zext i8 %2 to i32
%8 = add nuw nsw i32 %7, 2320
%9 = or i8 %1, 64
%10 = zext i8 %9 to i32
%11 = tail call i32 @bbm_write(i8* %0, i32 %8, i32 %10)
br label %12
12: ; preds = %3, %6
%13 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %13
}
int isspace(const int c) {
  switch (c) {
  case ' ':
  case '\f':
  case '\n':
  case '\r':
  case '\t':
  case '\v':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     112f <isspace+0x2f>
jmp    111e <isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113b <isspace+0x3b>
jmp    112f <isspace+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isspace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 12, label %3
i32 10, label %3
i32 13, label %3
i32 9, label %3
i32 11, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void remove_session_from_jumplist(const char *const sessionname) {}


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

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

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

LLVM IR (-O2):
define void @remove_session_from_jumplist(i8* nocapture %0) {
ret void
}
void _exit(int status) {
  volatile int i = 42;
  while (i)
    ;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     111f <_exit+0x1f>
jmp    110e <_exit+0xe>
jmp    1124 <_exit+0x24>
jmp    1124 <_exit+0x24>

x86 assembly (clang, -O2):
<_exit>:
movl   $0x2a,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,-0x4(%rsp)
jne    1110 <_exit+0x10>
nopw   0x0(%rax,%rax,1)
jmp    1120 <_exit+0x20>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 42, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load volatile i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
br label %4
8: ; preds = %4
br label %9
9: ; preds = %8, %9
br label %9
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 42, i32* %2
br label %4
4: ; preds = %4, %1
%5 = load volatile i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4, %7
br label %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int Bits_ffs64(uint64_t number) {
  if (!number) {
    return 0;
  }
  int out = 1;
  while (!(number & 1)) {
    number >>= 1;
    out++;
  }
  return out;
}


x86 assembly (clang, -O0):
<Bits_ffs64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <Bits_ffs64+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115c <Bits_ffs64+0x5c>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113f <Bits_ffs64+0x3f>
jmp    1156 <Bits_ffs64+0x56>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <Bits_ffs64+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bits_ffs64>:
test   %edi,%edi
je     112e <Bits_ffs64+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <Bits_ffs64+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <Bits_ffs64+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Bits_ffs64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %21
8: ; preds = %1
store i32 1, i32* %4
br label %9
9: ; preds = %14, %8
%10 = load i32, i32* %3
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i32, i32* %3
%16 = ashr i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %9
19: ; preds = %9
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @Bits_ffs64(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = ashr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
void check_null_char_string(char *b) {
  printf("\0this is bogus%d", 1);
  snprintf(b, 10, "%%%%%d\0%d", 1, 2);
  printf("%\0d", 1);
}


x86 assembly (clang, -O0):
<check_null_char_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
lea    0xec4(%rip),%rdx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1040 <snprintf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_null_char_string>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1040 <snprintf@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\00this is bogus%d\00"
@.str.1 = [10 x i8] c"%%%%%d\00%d\00"
@.str.2 = [4 x i8] c"%\00d\00"
define void @check_null_char_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = load i8*, i8** %2
%5 = call i32 @snprintf(i8* %4, i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\00this is bogus%d\00"
@.str.1 = [10 x i8] c"%%%%%d\00%d\00"
@.str.2 = [4 x i8] c"%\00d\00"
define void @check_null_char_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @snprintf(i8* %0, i32 10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}
int any_MSB_one(unsigned x) {
  int msb_mask = 0xFF << (sizeof(int) - 1 << 3);
  return !!(x & msb_mask);
}


x86 assembly (clang, -O0):
<any_MSB_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xff000000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_MSB_one>:
xor    %eax,%eax
cmp    $0x1000000,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @any_MSB_one(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -16777216, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @any_MSB_one(i32 %0) {
%2 = icmp ugt i32 %0, 16777215
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
float atanf(float);
float r_atan(float *x) { return (atanf(*x)); }


x86 assembly (clang, -O0):
<r_atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <atanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_atan>:
movss  (%rdi),%xmm0
jmp    1030 <atanf@plt>

LLVM IR (-O0):
define float @r_atan(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @atanf(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_atan(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @atanf(float %2)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
double _mm_cvtsd_f64(int /*<<< orphan*/);
double test_mm_cvtsd_f64(__m128d A) { return _mm_cvtsd_f64(A); }


x86 assembly (clang, -O0):
<test_mm_cvtsd_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_mm_cvtsd_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cvtsd_f64>:
jmp    1030 <_mm_cvtsd_f64@plt>

LLVM IR (-O0):
define double @test_mm_cvtsd_f64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call double @_mm_cvtsd_f64(i32 %3)
ret double %4
}

LLVM IR (-O2):
define double @test_mm_cvtsd_f64(i32 %0) {
%2 = tail call double @_mm_cvtsd_f64(i32 %0)
ret double %2
}
/* Variables and functions */
int min(int, int);
int rand_interval(int, int);
int gira_roleta(int bias) {
  int resultado = rand_interval(1, 10);
  resultado = min(resultado + bias, 10);
  return resultado;
}


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

x86 assembly (clang, -O2):
<gira_roleta>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0xa,%esi
call   1040 <rand_interval@plt>
add    %eax,%ebx
mov    %ebx,%edi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @gira_roleta(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @rand_interval(i32 1, i32 10)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
%8 = call i32 @min(i32 %7, i32 10)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @gira_roleta(i32 %0) {
%2 = tail call i32 @rand_interval(i32 1, i32 10)
%3 = add nsw i32 %2, %0
%4 = tail call i32 @min(i32 %3, i32 10)
ret i32 %4
}
int sign(double value) { return (value >= 0) ? 1 : -1; }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmovae %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 -1
ret i32 %6
}

LLVM IR (-O2):
define i32 @sign(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fib(int n) {
  int x, y;
  if (n <= 1) {
    printf("fib recursive completed\n");
    return 1;
  } else {
    x = fib(n - 1);
    y = fib(n - 2);
    return x + y;
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     114d <fib+0x2d>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1172 <fib+0x52>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1040 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1155 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1040 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
jae    1140 <fib+0x20>
add    $0x1,%ebp
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"fib recursive completed\0A\00"
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %20
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i32 @fib(i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 2
%16 = call i32 @fib(i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = add nsw i32 %17, %18
store i32 %19, i32* %2
br label %20
20: ; preds = %10, %8
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@str = [24 x i8] c"fib recursive completed\00"
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %5, label %8
3: ; preds = %8
%4 = add i32 %14, 1
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ 1, %1 ], [ %4, %3 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 %6
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i32 [ %14, %8 ], [ 0, %1 ]
%11 = add nsw i32 %9, -1
%12 = tail call i32 @fib(i32 %11)
%13 = add nsw i32 %9, -2
%14 = add nsw i32 %12, %10
%15 = icmp ult i32 %9, 4
br i1 %15, label %3, label %8
}
void trampoline_set_device_tree(void *p, unsigned long addr) {
  unsigned long *v;
  v = (p + 0x208);
  *v = addr;
}


x86 assembly (clang, -O0):
<trampoline_set_device_tree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x208,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_set_device_tree>:
mov    %rsi,0x208(%rdi)
ret

LLVM IR (-O0):
define void @trampoline_set_device_tree(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 520
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i64, i64* %4
%10 = load i64*, i64** %5
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @trampoline_set_device_tree(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 520
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
void print_buffer(short *buf, long buffer_size) {
  long i;
  for (i = 0; i < buffer_size; i += 2) {
    printf("%hd\n", buf[i]);
  }
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    115f <print_buffer+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
lea    0xebb(%rip),%rdi
movswl (%rax,%rcx,2),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_buffer+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
jle    1146 <print_buffer+0x36>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
movswl (%r14,%rbx,2),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x2,%rbx
cmp    %r12,%rbx
jl     1130 <print_buffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%hd\0A\00"
define void @print_buffer(i16* %0, i64 %1) {
%3 = alloca i16*
%4 = alloca i64
%5 = alloca i64
store i16* %0, i16** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i16*, i16** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i16, i16* %11, i64 %12
%14 = load i16, i16* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 signext %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add nsw i64 %17, 2
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%hd\0A\00"
define void @print_buffer(i16* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i16, i16* %0, i64 %5
%7 = load i16, i16* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 signext %7)
%9 = add nuw nsw i64 %5, 2
%10 = icmp slt i64 %9, %1
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
char *strcpy(char *to, const char *from) {
  char *save = to;
  for (; (*to = *from); ++from, ++to)
    ;
  return save;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     114a <strcpy+0x4a>
jmp    112d <strcpy+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     111f <strcpy+0x1f>
mov    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i8* %0
}
float foo23(double a, double b, double c) { return (float)(a * b - c); }


x86 assembly (clang, -O0):
<foo23>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo23>:
mulsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @foo23(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %7, double %8, double %10)
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @foo23(double %0, double %1, double %2) {
%4 = fneg double %2
%5 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %4)
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ sgb_render_screen();
void sgb_sound_transfer() { sgb_render_screen(); }


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

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

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

LLVM IR (-O2):
define void @sgb_sound_transfer() {
%1 = tail call i32 (...) @sgb_render_screen()
ret void
}
__attribute__((always_)) int rcu_batch_after(long a, long b) {
  return (a - b) > 0;
}


x86 assembly (clang, -O0):
<rcu_batch_after>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcu_batch_after>:
xor    %eax,%eax
cmp    %rsi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i32 @rcu_batch_after(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @rcu_batch_after(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LCD_command_2D(int, int);
void LCD_set_cursor_pointer(int pointer) { LCD_command_2D(0x21, pointer); }


x86 assembly (clang, -O0):
<LCD_set_cursor_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x21,%edi
call   1030 <LCD_command_2D@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_set_cursor_pointer>:
mov    %edi,%esi
mov    $0x21,%edi
jmp    1030 <LCD_command_2D@plt>

LLVM IR (-O0):
define void @LCD_set_cursor_pointer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @LCD_command_2D(i32 33, i32 %3)
ret void
}

LLVM IR (-O2):
define void @LCD_set_cursor_pointer(i32 %0) {
%2 = tail call i32 @LCD_command_2D(i32 33, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XCirculateRequestEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XCirculateRequestEvent(void) {
  XCirculateRequestEvent *_p =
      (XCirculateRequestEvent *)malloc(sizeof(XCirculateRequestEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XCirculateRequestEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XCirculateRequestEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XCirculateRequestEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XCirculateRequestEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XCirculateRequestEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XCirculateRequestEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void enable_irq_sff() {
  unsigned char r_val;
  r_val = *((unsigned char *)(0xfffc0000)) | 0x1E;
  *((unsigned char *)(0xfffc0000)) = r_val;
  printf("control_register 0x%X \n\n", *((unsigned char *)(0xfffc0000)));
}


x86 assembly (clang, -O0):
<enable_irq_sff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xfffc0000,%eax
movzbl (%rax),%eax
or     $0x1e,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0xfffc0000,%eax
mov    %cl,(%rax)
lea    0xec9(%rip),%rdi
mov    $0xfffc0000,%eax
movzbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_irq_sff>:
mov    $0xfffc0000,%eax
movzbl (%rax),%esi
or     $0x1e,%esi
mov    %sil,(%rax)
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"control_register 0x%X \0A\0A\00"
define void @enable_irq_sff() {
%1 = alloca i8
%2 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%3 = zext i8 %2 to i32
%4 = or i32 %3, 30
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = load i8, i8* %1
store i8 %6, i8* inttoptr (i64 4294705152 to i8*)
%7 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"control_register 0x%X \0A\0A\00"
define void @enable_irq_sff() {
%1 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%2 = or i8 %1, 30
store i8 %2, i8* inttoptr (i64 4294705152 to i8*)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, char *);
void printHelpMessage() {
  printf("Usage: natnf -c <collector-address> [-phsltef]\n"
         "\t-c\tcollector IPv4/IPv6 address or DNS name\n "
         "\t-p\tcollector port (default value: %s)\n"
         "\t-h\thelp\n"
         "\t-s\tenable syslog logging\n"
         "\t-l\tsyslog level\n"
         "\t-t\ttemplate timeout [seconds] (default value: %d)\n"
         "\t-e\texport timeout [seconds] (default value: %d)\n"
         "\t-d\tlog path (default value: %s)\n"
         "\t-f\tdaemonize\n",
         "4739", 60, 10, "/var/log/natnf");
}


x86 assembly (clang, -O0):
<printHelpMessage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0x1029(%rip),%rsi
mov    $0x3c,%edx
mov    $0xa,%ecx
lea    0x101d(%rip),%r8
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelpMessage>:
lea    0xee9(%rip),%rdi
lea    0x102d(%rip),%rsi
lea    0x102b(%rip),%r8
mov    $0x3c,%edx
mov    $0xa,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [331 x i8] c"Usage: natnf -c <collector-address> [-phsltef]\0A\09-c\09collector IPv4/IPv6 address or DNS name\0A \09-p\09collector port (default value: %s)\0A\09-h\09help\0A\09-s\09enable syslog logging\0A\09-l\09syslog level\0A\09-t\09template timeout [seconds] (default value: %d)\0A\09-e\09export timeout [seconds] (default value: %d)\0A\09-d\09log path (default value: %s)\0A\09-f\09daemonize\0A\00"
@.str.1 = [5 x i8] c"4739\00"
@.str.2 = [15 x i8] c"/var/log/natnf\00"
define void @printHelpMessage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 60, i32 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [331 x i8] c"Usage: natnf -c <collector-address> [-phsltef]\0A\09-c\09collector IPv4/IPv6 address or DNS name\0A \09-p\09collector port (default value: %s)\0A\09-h\09help\0A\09-s\09enable syslog logging\0A\09-l\09syslog level\0A\09-t\09template timeout [seconds] (default value: %d)\0A\09-e\09export timeout [seconds] (default value: %d)\0A\09-d\09log path (default value: %s)\0A\09-f\09daemonize\0A\00"
@.str.1 = [5 x i8] c"4739\00"
@.str.2 = [15 x i8] c"/var/log/natnf\00"
define void @printHelpMessage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 60, i32 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
double test(double x, int sel1, int sel2) {
  double input = sel1 ? -x : __builtin_fabs(x);
  if (sel2)
    return __builtin_cos(input);
  else
    return __builtin_sin(input);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1163 <test+0x43>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1178 <test+0x58>
movsd  -0x10(%rbp),%xmm0
movaps 0xe91(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11a0 <test+0x80>
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11af <test+0x8f>
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %edi,%edi
je     1134 <test+0x14>
xorps  0xed5(%rip),%xmm0
test   %esi,%esi
je     113f <test+0x1f>
jmp    1040 <cos@plt>
andps  0xed5(%rip),%xmm0
test   %esi,%esi
jne    112f <test+0xf>
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @test(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double %0, double* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load double, double* %5
%13 = fneg double %12
br label %17
14: ; preds = %3
%15 = load double, double* %5
%16 = call double @llvm.fabs.f64(double %15)
br label %17
17: ; preds = %14, %11
%18 = phi double [ %13, %11 ], [ %16, %14 ]
store double %18, double* %8
%19 = load i32, i32* %7
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load double, double* %8
%23 = call double @cos(double %22)
store double %23, double* %4
br label %27
24: ; preds = %17
%25 = load double, double* %8
%26 = call double @sin(double %25)
store double %26, double* %4
br label %27
27: ; preds = %24, %21
%28 = load double, double* %4
ret double %28
}

LLVM IR (-O2):
define double @test(double %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = fneg double %0
%6 = tail call double @llvm.fabs.f64(double %0)
%7 = select i1 %4, double %6, double %5
%8 = icmp eq i32 %2, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call double @cos(double %7)
br label %13
11: ; preds = %3
%12 = tail call double @sin(double %7)
br label %13
13: ; preds = %11, %9
%14 = phi double [ %10, %9 ], [ %12, %11 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void RestoreCursor() { WRITETEST("\0338"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"\1B8\00"
define void @RestoreCursor() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
void YM2151Postload(void *chip) {}


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

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

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

LLVM IR (-O2):
define void @YM2151Postload(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
int main(void) {
  char *c;
  char *d;
  c = "Hello Dude";
  d = "AdeTqE PWNyx WuJG8fYcn6w4 fTyvK W62FJSDyc o7U q10cRn4 kT9XVgMKr6 "
      "gyHwxjF1o xFD5NURzKscbZGfh uMcQOKjZSYyTwfvVx VadRhw5sW13MA yej "
      "GgrkfCRYm3Uy SdITMjxatkLZ94Ail";
  ft_putstr(c);
  ft_putstr(d);
  return (0);
}


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)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_putstr@plt>
mov    -0x18(%rbp),%rdi
call   1030 <ft_putstr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Hello Dude\00"
@.str.1 = [159 x i8] c"AdeTqE PWNyx WuJG8fYcn6w4 fTyvK W62FJSDyc o7U q10cRn4 kT9XVgMKr6 gyHwxjF1o xFD5NURzKscbZGfh uMcQOKjZSYyTwfvVx VadRhw5sW13MA yej GgrkfCRYm3Uy SdITMjxatkLZ94Ail\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = call i32 @ft_putstr(i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 @ft_putstr(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hello Dude\00"
@.str.1 = [159 x i8] c"AdeTqE PWNyx WuJG8fYcn6w4 fTyvK W62FJSDyc o7U q10cRn4 kT9XVgMKr6 gyHwxjF1o xFD5NURzKscbZGfh uMcQOKjZSYyTwfvVx VadRhw5sW13MA yej GgrkfCRYm3Uy SdITMjxatkLZ94Ail\00"
define i32 @main() {
%1 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void show_help(void) {
  printf("Usage: %s PATH\n     or: %s [OPTION] [PATH]\n\n     -s, "
         "--suffix=SUFFIX\tremove trailing suffix\n     -h, "
         "--help\t\t\tdisplay this help\n     -V, --version\t\tdisplay version "
         "information\n\n     Examples:\n     \tbasename /usr/bin/sort         "
         "Output: 'sort'.\n     \tbasename -s .h include/stdio.h Output: "
         "'stdio'. \n\n     Report bugs to <bulliver@gmail.com>\n",
         "basename", "basename");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0x1039(%rip),%rdx
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [343 x i8] c"Usage: %s PATH\0A or: %s [OPTION] [PATH]\0A\0A -s, --suffix=SUFFIX\09remove trailing suffix\0A -h, --help\09\09\09display this help\0A -V, --version\09\09display version information\0A\0A Examples:\0A \09basename /usr/bin/sort Output: 'sort'.\0A \09basename -s .h include/stdio.h Output: 'stdio'. \0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [9 x i8] c"basename\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([343 x i8], [343 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [343 x i8] c"Usage: %s PATH\0A or: %s [OPTION] [PATH]\0A\0A -s, --suffix=SUFFIX\09remove trailing suffix\0A -h, --help\09\09\09display this help\0A -V, --version\09\09display version information\0A\0A Examples:\0A \09basename /usr/bin/sort Output: 'sort'.\0A \09basename -s .h include/stdio.h Output: 'stdio'. \0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [9 x i8] c"basename\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([343 x i8], [343 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void decode_Cyrix_TLB(int x) {
  switch (x & 0xff) {
  case 0:
    break;
  case 0x70:
    printf("TLB: 32 entries 4-way associative 4KB pages\n");
    break;
  case 0x80:
    printf("L1 Cache: 16KB 4-way associative 16 bytes/line\n");
    break;
  }
}


x86 assembly (clang, -O0):
<decode_Cyrix_TLB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movzbl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1153 <decode_Cyrix_TLB+0x43>
jmp    112f <decode_Cyrix_TLB+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x70,%eax
je     1158 <decode_Cyrix_TLB+0x48>
jmp    1140 <decode_Cyrix_TLB+0x30>
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
je     1169 <decode_Cyrix_TLB+0x59>
jmp    1175 <decode_Cyrix_TLB+0x65>
jmp    1175 <decode_Cyrix_TLB+0x65>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <decode_Cyrix_TLB+0x65>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_Cyrix_TLB>:
cmp    $0x70,%dil
je     1128 <decode_Cyrix_TLB+0x18>
cmp    $0x80,%dil
jne    1134 <decode_Cyrix_TLB+0x24>
lea    0xf09(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xed1(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [45 x i8] c"TLB: 32 entries 4-way associative 4KB pages\0A\00"
@.str.1 = [48 x i8] c"L1 Cache: 16KB 4-way associative 16 bytes/line\0A\00"
define void @decode_Cyrix_TLB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
switch i32 %4, label %10 [
i32 0, label %5
i32 112, label %6
i32 128, label %8
]
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %1, %8, %6, %5
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"TLB: 32 entries 4-way associative 4KB pages\00"
@str.2 = [47 x i8] c"L1 Cache: 16KB 4-way associative 16 bytes/line\00"
define void @decode_Cyrix_TLB(i32 %0) {
%2 = trunc i32 %0 to i8
switch i8 %2, label %7 [
i8 -128, label %3
i8 112, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i8* [ getelementptr inbounds ([47 x i8], [47 x i8]* @str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0), %1 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
br label %7
7: ; preds = %4, %1
ret void
}