xunge/DecIR huggingface dataset:
/* Variables and functions */
int assemble_cfgbit(unsigned int const, unsigned int const);
unsigned int const bitpos_invert(unsigned int const, unsigned int const);
unsigned bitpos_to_cfgbit(const unsigned bitpos, const unsigned width) {
  const unsigned xoff = bitpos / (8 * width);
  const unsigned yoff = bitpos % (8 * width);
  const unsigned nyoff = bitpos_invert(yoff >> 3, width) | (yoff & 7);
  return assemble_cfgbit(xoff, nyoff);
}


x86 assembly (clang, -O0):
<bitpos_to_cfgbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
shr    $0x3,%edi
mov    -0x8(%rbp),%esi
call   1040 <bitpos_invert@plt>
mov    -0x10(%rbp),%ecx
and    $0x7,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <assemble_cfgbit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitpos_to_cfgbit>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%eax
lea    0x0(,%rsi,8),%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ebx
mov    %edx,%ebp
mov    %edx,%edi
shr    $0x3,%edi
call   1040 <bitpos_invert@plt>
and    $0x7,%ebp
or     %eax,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <assemble_cfgbit@plt>

LLVM IR (-O0):
define i32 @bitpos_to_cfgbit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul i32 8, %9
%11 = udiv i32 %8, %10
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = mul i32 8, %13
%15 = urem i32 %12, %14
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = lshr i32 %16, 3
%18 = load i32, i32* %4
%19 = call i32 @bitpos_invert(i32 %17, i32 %18)
%20 = load i32, i32* %6
%21 = and i32 %20, 7
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = call i32 @assemble_cfgbit(i32 %23, i32 %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @bitpos_to_cfgbit(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = udiv i32 %0, %3
%5 = urem i32 %0, %3
%6 = lshr i32 %5, 3
%7 = tail call i32 @bitpos_invert(i32 %6, i32 %1)
%8 = and i32 %5, 7
%9 = or i32 %7, %8
%10 = tail call i32 @assemble_cfgbit(i32 %4, i32 %9)
ret i32 %10
}
void media_send_end(void) {}


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

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

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

LLVM IR (-O2):
define void @media_send_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
DumpPlcfhdd() {
  printf("\n\n\n*****************  HEADER TABLE  *****************\n");
  printf("****************  NOT IMPLEMENTED  ***************\n\n");
}


x86 assembly (clang, -O0):
<DumpPlcfhdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [55 x i8] c"\0A\0A\0A***************** HEADER TABLE *****************\0A\00"
@.str.1 = [53 x i8] c"**************** NOT IMPLEMENTED ***************\0A\0A\00"
define i32 @DumpPlcfhdd() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@str = [54 x i8] c"\0A\0A\0A***************** HEADER TABLE *****************\00"
@str.2 = [52 x i8] c"**************** NOT IMPLEMENTED ***************\0A\00"
define i32 @DumpPlcfhdd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.2, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
char makeUpperCase(char stephenCharacter) {
  stephenCharacter -= 32;
  printf("Upper Case version is: %c\n", stephenCharacter);
  return stephenCharacter;
}


x86 assembly (clang, -O0):
<makeUpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
lea    0xed1(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeUpperCase>:
push   %rbx
add    $0xe0,%dil
movsbl %dil,%ebx
lea    0xee0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Upper Case version is: %c\0A\00"
define signext i8 @makeUpperCase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load i8, i8* %2
ret i8 %9
}

LLVM IR (-O2):
@.str = [27 x i8] c"Upper Case version is: %c\0A\00"
define signext i8 @makeUpperCase(i8 signext %0) {
%2 = add i8 %0, -32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int c_process(int x) {
  printf(">>>>>> Processing in C\n");
  return x + 20;
}


x86 assembly (clang, -O0):
<c_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x14,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_process>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
add    $0x14,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c">>>>>> Processing in C\0A\00"
define i32 @c_process(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 20
ret i32 %5
}

LLVM IR (-O2):
@str = [23 x i8] c">>>>>> Processing in C\00"
define i32 @c_process(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = add nsw i32 %0, 20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ in_current_set(unsigned char);
int /*<<< orphan*/ set_up_table(unsigned char const *, int);
char *xstrpbrk(const char *src, const char *set) {
  const char *p;
  set_up_table((const unsigned char *)set, true);
  for (p = src; !in_current_set((unsigned char)*p); p++)
    ;
  return (char *)p;
}


x86 assembly (clang, -O0):
<xstrpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <set_up_table@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%edi
call   1040 <in_current_set@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1167 <xstrpbrk+0x47>
jmp    117d <xstrpbrk+0x5d>
jmp    116c <xstrpbrk+0x4c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <xstrpbrk+0x26>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrpbrk>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <set_up_table@plt>
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1040 <in_current_set@plt>
test   %eax,%eax
je     1140 <xstrpbrk+0x20>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xstrpbrk(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** %4
%7 = call i32 @set_up_table(i8* %6, i32 1)
%8 = load i8*, i8** %3
store i8* %8, i8** %5
br label %9
9: ; preds = %16, %2
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = call i32 @in_current_set(i8 zeroext %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %15, label %19
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %5
br label %9
19: ; preds = %9
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @xstrpbrk(i8* %0, i8* %1) {
%3 = tail call i32 @set_up_table(i8* %1, i32 1)
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %0, %2 ], [ %9, %4 ]
%6 = load i8, i8* %5
%7 = tail call i32 @in_current_set(i8 zeroext %6)
%8 = icmp eq i32 %7, 0
%9 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %8, label %4, label %10
10: ; preds = %4
ret i8* %5
}
/* Type definitions */
struct instrument {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inst_clr(struct instrument *, int);
int /*<<< orphan*/ inst_wrtf(struct instrument *, char *, ...);
int /*<<< orphan*/ usleep(int);
void _clear(struct instrument *gd) {
  inst_clr(gd, 1000);
  inst_wrtf(gd, "*RST\n");
  usleep(1000 * 100);
  inst_wrtf(gd, "*ESE %d\n", (0x4 | 0x8 | 0x10 | 0x20));
}


x86 assembly (clang, -O0):
<_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <inst_clr@plt>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1030 <inst_wrtf@plt>
mov    $0x186a0,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%rdi
lea    0xe95(%rip),%rsi
mov    $0x3c,%edx
mov    $0x0,%al
call   1030 <inst_wrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_clear>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3e8,%esi
call   1040 <inst_clr@plt>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <inst_wrtf@plt>
mov    $0x186a0,%edi
call   1050 <usleep@plt>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3c,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <inst_wrtf@plt>

LLVM IR (-O0):
%struct.instrument = type { i32 }
@.str = [6 x i8] c"*RST\0A\00"
@.str.1 = [9 x i8] c"*ESE %d\0A\00"
define void @_clear(%struct.instrument* %0) {
%2 = alloca %struct.instrument*
store %struct.instrument* %0, %struct.instrument** %2
%3 = load %struct.instrument*, %struct.instrument** %2
%4 = call i32 @inst_clr(%struct.instrument* %3, i32 1000)
%5 = load %struct.instrument*, %struct.instrument** %2
%6 = call i32 (%struct.instrument*, i8*, ...) @inst_wrtf(%struct.instrument* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @usleep(i32 100000)
%8 = load %struct.instrument*, %struct.instrument** %2
%9 = call i32 (%struct.instrument*, i8*, ...) @inst_wrtf(%struct.instrument* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 60)
ret void
}

LLVM IR (-O2):
%struct.instrument = type { i32 }
@.str = [6 x i8] c"*RST\0A\00"
@.str.1 = [9 x i8] c"*ESE %d\0A\00"
define void @_clear(%struct.instrument* %0) {
%2 = tail call i32 @inst_clr(%struct.instrument* %0, i32 1000)
%3 = tail call i32 (%struct.instrument*, i8*, ...) @inst_wrtf(%struct.instrument* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @usleep(i32 100000)
%5 = tail call i32 (%struct.instrument*, i8*, ...) @inst_wrtf(%struct.instrument* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 60)
ret void
}
int test_imm_79uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x79 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_79uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x79,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_79uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 121
%7 = icmp ne i64 %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_79uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7929856
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void caam_debugfs_qi_init(struct caam_drv_private *ctrlpriv) {}


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

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

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

LLVM IR (-O2):
%struct.caam_drv_private = type opaque
define void @caam_debugfs_qi_init(%struct.caam_drv_private* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void charrep(char c, int count) {
  int i;
  for (i = 0; i < count; i++)
    printf("%c", c);
}


x86 assembly (clang, -O0):
<charrep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1152 <charrep+0x42>
lea    0xec5(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <charrep+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charrep>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    113f <charrep+0x2f>
mov    %esi,%ebx
movsbl %dil,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <charrep+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @charrep(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int read(int, scalar_t__ *, int);
int usart_getc(int fd) {
  uint8_t x;
  if (read(fd, &x, 1) != 1)
    return -1;
  return ((int)x) & 0xFF;
}


x86 assembly (clang, -O0):
<usart_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
je     1141 <usart_getc+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <usart_getc+0x3d>
mov    -0x10(%rbp),%rax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart_getc>:
push   %rax
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
movzbl (%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @usart_getc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @read(i32 %5, i64* %4, i32 1)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
%12 = and i32 %11, 255
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @usart_getc(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @read(i32 %0, i64* %2, i32 1)
%5 = icmp eq i32 %4, 1
%6 = load i64, i64* %2
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 255
%9 = select i1 %5, i32 %8, i32 -1
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
scalar_t__ fwrite(int /*<<< orphan*/ const *, int, scalar_t__,
                  int /*<<< orphan*/ *);
void writeFile(const char *fileName, const uint8_t *data, uint32_t fileLen) {
  FILE *file = fopen(fileName, "w");
  assert(fwrite(data, 1, fileLen, file) == fileLen);
  fclose(file);
}


x86 assembly (clang, -O0):
<writeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fwrite@plt>
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFile>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
lea    0xeae(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %rax,%rcx
call   1060 <fwrite@plt>
xor    %edi,%edi
cmp    %r15,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @writeFile(i8* %0, i32* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i32*, i32** %5
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = call i64 @fwrite(i32* %10, i32 1, i64 %11, i32* %12)
%14 = load i64, i64* %6
%15 = icmp eq i64 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i32*, i32** %7
%19 = call i32 @fclose(i32* %18)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @writeFile(i8* nocapture %0, i32* nocapture %1, i64 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 @fwrite(i32* %1, i32 1, i64 %2, i32* %4)
%6 = icmp eq i64 %5, %2
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @fclose(i32* %4)
ret void
}
void CMP_export(char *name, void *dir, int nparms) {}


x86 assembly (clang, -O0):
<CMP_export>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @CMP_export(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @CMP_export(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
void _pthread_cleanup_push() {}


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

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

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

LLVM IR (-O2):
define void @_pthread_cleanup_push() {
ret void
}
void U_EMRABORTPATH_print(const char *contents) { (void)contents; }


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

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

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

LLVM IR (-O2):
define void @U_EMRABORTPATH_print(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ rand();
uint32_t get32rand() {
  return ((uint32_t)rand() ^ ((uint32_t)rand() << 15) ^
          ((uint32_t)rand() << 30));
}


x86 assembly (clang, -O0):
<get32rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
shl    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x4(%rbp),%eax
shl    $0x1e,%ecx
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32rand>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rbx
shl    $0xf,%ebx
xor    %r14d,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x1e,%eax
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @get32rand() {
%1 = call i64 (...) @rand()
%2 = trunc i64 %1 to i32
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 15
%6 = xor i32 %2, %5
%7 = call i64 (...) @rand()
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 30
%10 = xor i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get32rand() {
%1 = tail call i64 (...) @rand()
%2 = trunc i64 %1 to i32
%3 = tail call i64 (...) @rand()
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 15
%6 = xor i32 %5, %2
%7 = tail call i64 (...) @rand()
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 30
%10 = xor i32 %6, %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ sqrt(double);
float Sqrt(float arg) { return (float)sqrt((double)arg); }


x86 assembly (clang, -O0):
<Sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sqrt>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sqrt(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @Sqrt(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ document_close_body();
int /*<<< orphan*/ document_close_html();
void document_output_closing(void) {
  document_close_body();
  document_close_html();
}


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

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

LLVM IR (-O0):
define void @document_output_closing() {
%1 = call i32 (...) @document_close_body()
%2 = call i32 (...) @document_close_html()
ret void
}

LLVM IR (-O2):
define void @document_output_closing() {
%1 = tail call i32 (...) @document_close_body()
%2 = tail call i32 (...) @document_close_html()
ret void
}
/* Type definitions */
struct rw_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __up_write(struct rw_semaphore *);
__attribute__((always_)) void up_write(struct rw_semaphore *sem) {
  ;
  __up_write(sem);
  ;
}


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

x86 assembly (clang, -O2):
<up_write>:
jmp    1030 <__up_write@plt>

LLVM IR (-O0):
%struct.rw_semaphore = type { i32 }
define void @up_write(%struct.rw_semaphore* %0) {
%2 = alloca %struct.rw_semaphore*
store %struct.rw_semaphore* %0, %struct.rw_semaphore** %2
%3 = load %struct.rw_semaphore*, %struct.rw_semaphore** %2
%4 = call i32 @__up_write(%struct.rw_semaphore* %3)
ret void
}

LLVM IR (-O2):
%struct.rw_semaphore = type { i32 }
define void @up_write(%struct.rw_semaphore* %0) {
%2 = tail call i32 @__up_write(%struct.rw_semaphore* %0)
ret void
}
void do_float_math(float *x) {
  printf("%s: X before: %f\n", __func__, *x);
  *x += 5;
  printf("%s: X after: %f\n", __func__, *x);
}


x86 assembly (clang, -O0):
<do_float_math>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed5(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movss  0xeb7(%rip),%xmm0
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
lea    0xeab(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_float_math>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xede(%rip),%rdi
lea    0xee9(%rip),%r14
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
movss  (%rbx),%xmm0
addss  0xebd(%rip),%xmm0
movss  %xmm0,(%rbx)
cvtss2sd %xmm0,%xmm0
lea    0xed2(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s: X before: %f\0A\00"
@__func__.do_float_math = [14 x i8] c"do_float_math\00"
@.str.1 = [17 x i8] c"%s: X after: %f\0A\00"
define void @do_float_math(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.do_float_math, i64 0, i64 0), double %5)
%7 = load float*, float** %2
%8 = load float, float* %7
%9 = fadd float %8, 5.000000e+00
store float %9, float* %7
%10 = load float*, float** %2
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.do_float_math, i64 0, i64 0), double %12)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s: X before: %f\0A\00"
@__func__.do_float_math = [14 x i8] c"do_float_math\00"
@.str.1 = [17 x i8] c"%s: X after: %f\0A\00"
define void @do_float_math(float* nocapture %0) {
%2 = load float, float* %0
%3 = fpext float %2 to double
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.do_float_math, i64 0, i64 0), double %3)
%5 = load float, float* %0
%6 = fadd float %5, 5.000000e+00
store float %6, float* %0
%7 = fpext float %6 to double
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.do_float_math, i64 0, i64 0), double %7)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  int nb;
  int prec = -1;
  while ((c = getchar()) != EOF) {
    if (c == ' ' && prec == ' ')
      continue;
    else {
      putchar(c);
      prec = c;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     117b <main+0x5b>
cmpl   $0x20,-0x8(%rbp)
jne    1168 <main+0x48>
cmpl   $0x20,-0x10(%rbp)
jne    1168 <main+0x48>
jmp    1136 <main+0x16>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0xffffffff,%ebx
jmp    1163 <main+0x43>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     1137 <main+0x17>
mov    %ebx,%ecx
mov    %eax,%ebx
cmp    $0x20,%ecx
jne    1150 <main+0x30>
cmp    $0x20,%ebx
je     1157 <main+0x37>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %4
br label %5
5: ; preds = %20, %15, %0
%6 = call i32 (...) @getchar()
store i32 %6, i32* %2
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 32
br i1 %14, label %15, label %16
15: ; preds = %12
br label %5
16: ; preds = %12, %9
%17 = load i32, i32* %2
%18 = call i32 @putchar(i32 %17)
%19 = load i32, i32* %2
store i32 %19, i32* %4
br label %20
20: ; preds = %16
br label %5
21: ; preds = %5
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %16, label %4
4: ; preds = %0, %12
%5 = phi i32 [ %13, %12 ], [ %1, %0 ]
%6 = phi i32 [ %5, %12 ], [ -1, %0 ]
%7 = icmp eq i32 %5, 32
%8 = icmp eq i32 %6, 32
%9 = and i1 %8, %7
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @putchar(i32 %5)
br label %12
12: ; preds = %10, %4
%13 = tail call i32 (...) @getchar()
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %4
16: ; preds = %12, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Bytes(int);
int /*<<< orphan*/ DwFlush();
int /*<<< orphan*/ DwSend(int /*<<< orphan*/);
void DwDisable(void) {
  DwSend(Bytes(0x06));
  DwFlush();
}


x86 assembly (clang, -O0):
<DwDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1040 <Bytes@plt>
mov    %eax,%edi
call   1030 <DwSend@plt>
mov    $0x0,%al
call   1050 <DwFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DwDisable>:
push   %rax
mov    $0x6,%edi
call   1040 <Bytes@plt>
mov    %eax,%edi
call   1030 <DwSend@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <DwFlush@plt>

LLVM IR (-O0):
define void @DwDisable() {
%1 = call i32 @Bytes(i32 6)
%2 = call i32 @DwSend(i32 %1)
%3 = call i32 (...) @DwFlush()
ret void
}

LLVM IR (-O2):
define void @DwDisable() {
%1 = tail call i32 @Bytes(i32 6)
%2 = tail call i32 @DwSend(i32 %1)
%3 = tail call i32 (...) @DwFlush()
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
int ftp_get_return(const char *ftp_buffer) {
  char code[4];
  strncpy(code, ftp_buffer, 3);
  code[3] = '\0';
  return atoi(code);
}


x86 assembly (clang, -O0):
<ftp_get_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x9(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftp_get_return>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ftp_get_return(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 3)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 0, i8* %7
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = call i32 @atoi(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @ftp_get_return(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 3)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 0, i8* %5
%6 = call i32 @atoi(i8* %3)
ret i32 %6
}
int detect_cpu_smep(void) {
  unsigned int eax, ebx, ecx, edx;
  eax = 7;
  ecx = 0;
  asm volatile("cpuid"
               : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
               : "0"(eax), "2"(ecx));
  if (ebx & (1 << 7)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<detect_cpu_smep>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x7,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x18(%rbp),%ecx
cpuid
mov    %eax,-0x10(%rbp)
mov    %ebx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1144 <detect_cpu_smep+0x44>
movl   $0x1,-0xc(%rbp)
jmp    114b <detect_cpu_smep+0x4b>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<detect_cpu_smep>:
push   %rbx
mov    $0x7,%eax
xor    %ecx,%ecx
cpuid
mov    %ebx,%eax
shr    $0x7,%eax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @detect_cpu_smep() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 7, i32* %2
store i32 0, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %7)
%9 = extractvalue { i32, i32, i32, i32 } %8, 0
%10 = extractvalue { i32, i32, i32, i32 } %8, 1
%11 = extractvalue { i32, i32, i32, i32 } %8, 2
%12 = extractvalue { i32, i32, i32, i32 } %8, 3
store i32 %9, i32* %2
store i32 %10, i32* %3
store i32 %11, i32* %4
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = and i32 %13, 128
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %0
store i32 1, i32* %1
br label %18
17: ; preds = %0
store i32 0, i32* %1
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @detect_cpu_smep() {
%1 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},0,2,~{dirflag},~{fpsr},~{flags}"(i32 7, i32 0)
%2 = extractvalue { i32, i32, i32, i32 } %1, 1
%3 = lshr i32 %2, 7
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ CheckedCommand(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  char *, int, int);
void SetTextAlpha(FILE *p_cmd, FILE *p_res, int i_overlay, int i_alpha) {
  CheckedCommand(p_cmd, p_res, "SetTextAlpha %d %d\n", i_overlay, i_alpha);
}


x86 assembly (clang, -O0):
<SetTextAlpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xec4(%rip),%rdx
call   1030 <CheckedCommand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTextAlpha>:
mov    %ecx,%r8d
mov    %edx,%ecx
lea    0xee4(%rip),%rdx
jmp    1030 <CheckedCommand@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"SetTextAlpha %d %d\0A\00"
define void @SetTextAlpha(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @CheckedCommand(i32* %9, i32* %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"SetTextAlpha %d %d\0A\00"
define void @SetTextAlpha(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @CheckedCommand(i32* %0, i32* %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret void
}
void test45_Test5_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test45_Test5_targetInit__I() {
ret void
}
/* Variables and functions */
void srand(unsigned int);
void srandom(unsigned seed) { return srand(seed); }


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

x86 assembly (clang, -O2):
<srandom>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @srandom(i32 %0) {
tail call void @srand(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
void vuln() {
  char buffer[16];
  read(0, buffer, 100);
  puts(buffer);
}


x86 assembly (clang, -O0):
<vuln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rsi
xor    %edi,%edi
mov    $0x64,%edx
call   1040 <read@plt>
lea    -0x10(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuln>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1040 <read@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vuln() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 100)
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
define void @vuln() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 100)
%4 = call i32 @puts(i8* %2)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *re_malloc(size_t sz) { return malloc(sz); }


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

x86 assembly (clang, -O2):
<re_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @re_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @re_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void cafebabe_stream_close_buffer(struct cafebabe_stream *s) {}


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

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

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

LLVM IR (-O2):
%struct.cafebabe_stream = type opaque
define void @cafebabe_stream_close_buffer(%struct.cafebabe_stream* nocapture %0) {
ret void
}
void print_help() {}


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

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

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

LLVM IR (-O2):
define void @print_help() {
ret void
}
int test_imm_55uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x55,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_55uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 85
%7 = icmp ne i64 %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_55uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 365072220160
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ hex_to_str(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
ssize_t offset_store(int fd, off_t offset) {
  char buf[16];
  hex_to_str(offset, buf, sizeof(buf));
  return write(fd, buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<offset_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1030 <hex_to_str@plt>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1040 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset_store>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %esi,%edi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <hex_to_str@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x10,%edx
call   1040 <write@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @offset_store(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [16 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%8 = call i32 @hex_to_str(i32 %6, i8* %7, i32 16)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%11 = call i32 @write(i32 %9, i8* %10, i32 16)
ret i32 %11
}

LLVM IR (-O2):
define i32 @offset_store(i32 %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @hex_to_str(i32 %1, i8* %4, i32 16)
%6 = call i32 @write(i32 %0, i8* %4, i32 16)
ret i32 %6
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSCS(const char *the_title) { return any_decrqss(the_title, "*r"); }


x86 assembly (clang, -O0):
<rpt_DECSCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <any_decrqss@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpt_DECSCS>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"*r\00"
define i32 @rpt_DECSCS(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
unsigned long bootstage_mark(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @bootstage_mark(i8* nocapture readnone %0) {
ret i64 0
}
void *f1_ifunc() { return 0; }


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

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

LLVM IR (-O0):
define i8* @f1_ifunc() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @f1_ifunc() {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ cctools_debug(long long, char *);
int disk_alloc_create(char *loc, int64_t size) {
  cctools_debug((1LL << 2), "Platform not supported by this library.\n");
  return 1;
}


x86 assembly (clang, -O0):
<disk_alloc_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x4,%edi
lea    0xed5(%rip),%rsi
call   1030 <cctools_debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disk_alloc_create>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x4,%edi
call   1030 <cctools_debug@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Platform not supported by this library.\0A\00"
define i32 @disk_alloc_create(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @cctools_debug(i64 4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [41 x i8] c"Platform not supported by this library.\0A\00"
define i32 @disk_alloc_create(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @cctools_debug(i64 4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XUnmapEvent;

/* Variables and functions */
void *get_XUnmapEvent_display(void *_p) {
  return (void *)((XUnmapEvent *)_p)->display;
}


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

x86 assembly (clang, -O2):
<get_XUnmapEvent_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XUnmapEvent_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XUnmapEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}