xunge/DecIR huggingface dataset:
/* Variables and functions */
int rocker_tlv_size(int);
int rocker_tlv_total_size(int);
int rocker_tlv_padlen(int payload) {
  return rocker_tlv_total_size(payload) - rocker_tlv_size(payload);
}


x86 assembly (clang, -O0):
<rocker_tlv_padlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <rocker_tlv_total_size@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rocker_tlv_size@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rocker_tlv_padlen>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <rocker_tlv_total_size@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <rocker_tlv_size@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rocker_tlv_padlen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rocker_tlv_total_size(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @rocker_tlv_size(i32 %5)
%7 = sub nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rocker_tlv_padlen(i32 %0) {
%2 = tail call i32 @rocker_tlv_total_size(i32 %0)
%3 = tail call i32 @rocker_tlv_size(i32 %0)
%4 = sub nsw i32 %2, %3
ret i32 %4
}
int *writeFile(char *filename) { return (int *)filename; }


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

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

LLVM IR (-O0):
define i32* @writeFile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
ret i32* %4
}

LLVM IR (-O2):
define i32* @writeFile(i8* readnone %0) {
%2 = bitcast i8* %0 to i32*
ret i32* %2
}
int a_cas(volatile int *p, int t, int s) {
  __asm__("lock ; .byte 0x67\n\tcmpxchg %3, %1"
          : "=a"(t), "=m"(*p)
          : "a"(t), "r"(s)
          : "memory");
  return t;
}


x86 assembly (clang, -O0):
<a_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%ecx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas>:
mov    %esi,%eax
lock cmpxchg %edx,(%edi)
ret

LLVM IR (-O0):
define i32 @a_cas(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 asm "lock ; .byte 0x67\0A\09cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %7, i32 %8, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @a_cas(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 asm "lock ; .byte 0x67\0A\09cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1, i32 %2)
ret i32 %4
}
void swap(int *cards, int i, int j) {
  int tmp;
  tmp = cards[i];
  cards[i] = cards[j];
  cards[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
void bigendian_to_s24(int32_t *dst, uint8_t *src) {
  *dst = (((int32_t)src[0]) << 16) | (((int32_t)src[1]) << 8) | (int32_t)src[2];
  if ((src[0] & 0x80) == 0x80) {
    *dst |= 0xFF000000;
  }
}


x86 assembly (clang, -O0):
<bigendian_to_s24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
or     0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    1152 <bigendian_to_s24+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0xff000000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigendian_to_s24>:
mov    (%rsi),%ecx
mov    0x4(%rsi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x8(%rsi),%eax
mov    %eax,(%rdi)
testb  $0x80,(%rsi)
je     111e <bigendian_to_s24+0x1e>
or     $0xff000000,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @bigendian_to_s24(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %8, %12
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = or i32 %13, %16
%18 = load i32*, i32** %3
store i32 %17, i32* %18
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = and i32 %21, 128
%23 = icmp eq i32 %22, 128
br i1 %23, label %24, label %28
24: ; preds = %2
%25 = load i32*, i32** %3
%26 = load i32, i32* %25
%27 = or i32 %26, -16777216
store i32 %27, i32* %25
br label %28
28: ; preds = %24, %2
ret void
}

LLVM IR (-O2):
define void @bigendian_to_s24(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 16
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %1, i64 2
%10 = load i32, i32* %9
%11 = or i32 %8, %10
store i32 %11, i32* %0
%12 = load i32, i32* %1
%13 = and i32 %12, 128
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = or i32 %11, -16777216
store i32 %16, i32* %0
br label %17
17: ; preds = %15, %2
ret void
}
void proc_stat_dtor(void) {}


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

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

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

LLVM IR (-O2):
define void @proc_stat_dtor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ buffer_init();
void buffer_reset() { buffer_init(); }


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

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

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

LLVM IR (-O2):
define void @buffer_reset() {
%1 = tail call i32 (...) @buffer_init()
ret void
}
/* Variables and functions */
void *memmem(void *, size_t, char *, size_t);
void *find_pattern_in_memory(void *address, size_t memsize, char *pattern,
                             size_t patternlen) {
  void *p = memmem(address, memsize, pattern, patternlen);
  return p;
}


x86 assembly (clang, -O0):
<find_pattern_in_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <memmem@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_pattern_in_memory>:
jmp    1030 <memmem@plt>

LLVM IR (-O0):
define i8* @find_pattern_in_memory(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i8* @memmem(i8* %10, i64 %11, i8* %12, i64 %13)
store i8* %14, i8** %9
%15 = load i8*, i8** %9
ret i8* %15
}

LLVM IR (-O2):
define i8* @find_pattern_in_memory(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i8* @memmem(i8* %0, i64 %1, i8* %2, i64 %3)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int terminal_read_str32(int, int, int /*<<< orphan*/ *, int);
int terminal_read_wstr(int x, int y, wchar_t *buffer, int max) {
  return terminal_read_str32(x, y, (int32_t *)buffer, max);
}


x86 assembly (clang, -O0):
<terminal_read_wstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <terminal_read_str32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_read_wstr>:
jmp    1030 <terminal_read_str32@plt>

LLVM IR (-O0):
define i32 @terminal_read_wstr(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 @terminal_read_str32(i32 %9, i32 %10, i32* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @terminal_read_wstr(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @terminal_read_str32(i32 %0, i32 %1, i32* %2, i32 %3)
ret i32 %5
}
void cli() { __asm__ volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("core_recovery [options]\n"
         "	-d|--data		Inject data error(DCU error) under "
         "user context\n"
         "	-i|--instruction	Inject instruction error(IFU error) "
         "under user context\n"
         "	-h|--help		Show this usage message\n");
}


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

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

LLVM IR (-O0):
@.str = [194 x i8] c"core_recovery [options]\0A\09-d|--data\09\09Inject data error(DCU error) under user context\0A\09-i|--instruction\09Inject instruction error(IFU error) under user context\0A\09-h|--help\09\09Show this usage message\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [193 x i8] c"core_recovery [options]\0A\09-d|--data\09\09Inject data error(DCU error) under user context\0A\09-i|--instruction\09Inject instruction error(IFU error) under user context\0A\09-h|--help\09\09Show this usage message\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([193 x i8], [193 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap16(uint16_t w) { return (w << 8) | (w >> 8); }


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @swap16(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
char *test(char *C) { return C - 1; }


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

x86 assembly (clang, -O2):
<test>:
lea    -0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
ret i8* %4
}

LLVM IR (-O2):
define i8* @test(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
ret i8* %2
}
int __crow_mul(int a, int b) { return a * b; }


x86 assembly (clang, -O0):
<__crow_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__crow_mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @__crow_mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
unsigned int VENUS_EXTRADATA_SIZE(int width, int height) {
  (void)height;
  (void)width;
  return 0;
}


x86 assembly (clang, -O0):
<VENUS_EXTRADATA_SIZE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @VENUS_EXTRADATA_SIZE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @VENUS_EXTRADATA_SIZE(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t buffer_resolverKeyboardToUSB(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @buffer_resolverKeyboardToUSB() {
ret i32 0
}

LLVM IR (-O2):
define i32 @buffer_resolverKeyboardToUSB() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putch(int /*<<< orphan*/);
void put(char *str) {
  while (*str) {
    putch(*str++);
  }
}


x86 assembly (clang, -O0):
<put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <put+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putch@plt>
jmp    111c <put+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <put+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <put+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @put(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @putch(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @put(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putch(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerP__0__VectorTimerX1__fired();
void Msp430TimerCommonP__VectorTimerA1__fired(void) {
  Msp430TimerP__0__VectorTimerX1__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCommonP__VectorTimerA1__fired() {
%1 = tail call i32 (...) @Msp430TimerP__0__VectorTimerX1__fired()
ret void
}
/* Variables and functions */
int sum(int, int);
int main(int argc, char *argv[]) {
  int a = 1;
  while (a != 3) {
    a = sum(a = 2, 1);
  }
  if (a != 3 && 1) {
    a;
  } else {
    a == 3;
  }
  int b = 0;
  b;
  float c[2] = {1.1, 2.2};
  (1 || 2 ? c[0] : c[1]);
  (1 || 2 ? c[0] : 0.5);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
je     1155 <main+0x45>
movl   $0x2,-0x14(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <sum@plt>
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x3,-0x14(%rbp)
je     1164 <main+0x54>
jmp    1164 <main+0x54>
movl   $0x0,-0x18(%rbp)
mov    0xe8e(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <sum@plt>
cmp    $0x3,%eax
jne    1120 <main+0x10>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.c = [2 x float] [float 0x3FF19999A0000000, float 0x40019999A0000000]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x float]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %9
9: ; preds = %12, %2
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %14
12: ; preds = %9
store i32 2, i32* %6
%13 = call i32 @sum(i32 2, i32 1)
store i32 %13, i32* %6
br label %9
14: ; preds = %9
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = load i32, i32* %6
br label %23
19: ; preds = %14
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 3
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %17
store i32 0, i32* %7
%24 = load i32, i32* %7
%25 = bitcast [2 x float]* %8 to i8*
%26 = getelementptr inbounds [2 x float], [2 x float]* %8, i64 0, i64 0
%27 = load float, float* %26
%28 = getelementptr inbounds [2 x float], [2 x float]* %8, i64 0, i64 0
%29 = load float, float* %28
%30 = fpext float %29 to double
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @sum(i32 2, i32 1)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %3
6: ; preds = %3
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int lire_int(int /*<<< orphan*/ *);
void lire_chaine_binaire(FILE *fichier, char *chaine) {
  int taille;
  taille = lire_int(fichier);
  fread(chaine, 1, taille, fichier);
  chaine[taille] = '\0';
}


x86 assembly (clang, -O0):
<lire_chaine_binaire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lire_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lire_chaine_binaire>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <lire_int@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movslq %ebp,%rax
movb   $0x0,(%r14,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @lire_chaine_binaire(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @lire_int(i32* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32*, i32** %3
%11 = call i32 @fread(i8* %8, i32 1, i32 %9, i32* %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @lire_chaine_binaire(i32* %0, i8* nocapture %1) {
%3 = tail call i32 @lire_int(i32* %0)
%4 = tail call i32 @fread(i8* %1, i32 1, i32 %3, i32* %0)
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutputDAchannel(int, int);
void SetAllDA(void) {
  int channel_no;
  for (channel_no = 1; channel_no <= 4; channel_no++)
    OutputDAchannel(channel_no, 255);
}


x86 assembly (clang, -O0):
<SetAllDA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jg     1144 <SetAllDA+0x34>
mov    -0x4(%rbp),%edi
mov    $0xff,%esi
call   1030 <OutputDAchannel@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <SetAllDA+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetAllDA>:
push   %rax
mov    $0x1,%edi
mov    $0xff,%esi
call   1030 <OutputDAchannel@plt>
mov    $0x2,%edi
mov    $0xff,%esi
call   1030 <OutputDAchannel@plt>
mov    $0x3,%edi
mov    $0xff,%esi
call   1030 <OutputDAchannel@plt>
mov    $0x4,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <OutputDAchannel@plt>

LLVM IR (-O0):
define void @SetAllDA() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 4
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @OutputDAchannel(i32 %6, i32 255)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @SetAllDA() {
%1 = tail call i32 @OutputDAchannel(i32 1, i32 255)
%2 = tail call i32 @OutputDAchannel(i32 2, i32 255)
%3 = tail call i32 @OutputDAchannel(i32 3, i32 255)
%4 = tail call i32 @OutputDAchannel(i32 4, i32 255)
ret void
}
void InitDebugSettings() {}


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

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

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

LLVM IR (-O2):
define void @InitDebugSettings() {
ret void
}
double func2(double x) { return -1 * x; }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @func2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @func2(double %0) {
%2 = fneg double %0
ret double %2
}
int test_imm_6Cuint8_reg(unsigned char val) {
  return ((val) & (-0x6C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Cuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff94,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Cuint8_reg>:
test   $0x94,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -108
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void do_final_duel(void) {}


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

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

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

LLVM IR (-O2):
define void @do_final_duel() {
ret void
}
long double _Complex sub_long_double_cr(long double _Complex a, long double b) {
  return a - b;
}


x86 assembly (clang, -O0):
<sub_long_double_cr>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
lea    0x10(%rbp),%rax
fstpt  -0x30(%rbp)
fldt   (%rax)
fldt   0x10(%rax)
fldt   -0x30(%rbp)
fsubrp %st,%st(2)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_long_double_cr>:
fldt   0x28(%rsp)
fldt   0x8(%rsp)
fsubp  %st,%st(1)
fldt   0x18(%rsp)
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @sub_long_double_cr({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0, x86_fp80 %1) {
%3 = alloca { x86_fp80, x86_fp80 }
%4 = alloca x86_fp80
store x86_fp80 %1, x86_fp80* %4
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%6 = load x86_fp80, x86_fp80* %5
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%8 = load x86_fp80, x86_fp80* %7
%9 = load x86_fp80, x86_fp80* %4
%10 = fsub x86_fp80 %6, %9
%11 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%12 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %10, x86_fp80* %11
store x86_fp80 %8, x86_fp80* %12
%13 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3
ret { x86_fp80, x86_fp80 } %13
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @sub_long_double_cr({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0, x86_fp80 %1) {
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = fsub x86_fp80 %4, %1
%8 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %7, 0
%9 = insertvalue { x86_fp80, x86_fp80 } %8, x86_fp80 %6, 1
ret { x86_fp80, x86_fp80 } %9
}
/* Variables and functions */
int random();
int slRandomLevel(void) {
  int level = 1;
  while ((random() & 0xffff) < (0.25 * 0xffff))
    level += 1;
  return (level < 32) ? level : 32;
}


x86 assembly (clang, -O0):
<slRandomLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114f <slRandomLevel+0x3f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <slRandomLevel+0xf>
cmpl   $0x20,-0x4(%rbp)
jge    1164 <slRandomLevel+0x54>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <slRandomLevel+0x61>
mov    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <slRandomLevel+0x61>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slRandomLevel>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <random@plt>
add    $0x1,%ebx
test   $0xc000,%eax
je     1120 <slRandomLevel+0x10>
cmp    $0x20,%ebx
mov    $0x20,%eax
cmovb  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @slRandomLevel() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %7, %0
%3 = call i32 (...) @random()
%4 = and i32 %3, 65535
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 0x40CFFFE000000000
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %1
br label %16
15: ; preds = %10
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 32, %15 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @slRandomLevel() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @random()
%4 = and i32 %3, 49152
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp ult i32 %2, 32
%9 = select i1 %8, i32 %2, i32 32
ret i32 %9
}
/* Variables and functions */
scalar_t__ is_prime(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  if (is_prime(n))
    printf("Prime\n");
  else
    printf("Not prime\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <main+0x5a>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <is_prime@plt>
test   %rax,%rax
lea    0xea3(%rip),%rax
lea    0xea6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"Prime\0A\00"
@.str.3 = [11 x i8] c"Not prime\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i64 @is_prime(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [10 x i8] c"Not prime\00"
@str.4 = [6 x i8] c"Prime\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @is_prime(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ arch_adjust_stack(int);
void emit_adjust_stack(int stack_size) { arch_adjust_stack(stack_size); }


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

x86 assembly (clang, -O2):
<emit_adjust_stack>:
jmp    1030 <arch_adjust_stack@plt>

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

LLVM IR (-O2):
define void @emit_adjust_stack(i32 %0) {
%2 = tail call i32 @arch_adjust_stack(i32 %0)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ srand(unsigned int);
void initrand() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  srand((unsigned int)tv.tv_usec);
}


x86 assembly (clang, -O0):
<initrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initrand>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
call   1040 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define void @initrand() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define void @initrand() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = call i32 @srand(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128InterruptPinP__6__Irq__enable();
void Atm128GpioInterruptC__0__Atm128Interrupt__enable(void) {
  HplAtm128InterruptPinP__6__Irq__enable();
}


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

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

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

LLVM IR (-O2):
define void @Atm128GpioInterruptC__0__Atm128Interrupt__enable() {
%1 = tail call i32 (...) @HplAtm128InterruptPinP__6__Irq__enable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int, int);
int main(void) {
  check_vect();
  main1(2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <main1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_vect()
%3 = call i32 @main1(i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 2, i32 3)
ret i32 0
}
update_null(str) char *str;
{ return (1); }


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

x86 assembly (clang, -O2):
<update_null>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @update_null(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
void *realloc(void *, size_t);
void *paranoia_realloc(void *memblock, size_t size) {
  return realloc(memblock, size);
}


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

x86 assembly (clang, -O2):
<paranoia_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @paranoia_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @paranoia_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perr_exit(char *);
void Close(int fd) {
  if (close(fd) == -1)
    perr_exit("close error");
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1148 <Close+0x28>
lea    0xebd(%rip),%rdi
call   1040 <perr_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     112d <Close+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perr_exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"close error\00"
define void @Close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perr_exit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"close error\00"
define void @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perr_exit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
double test_sqrt(double x) { return __builtin_sqrt(x); }


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

x86 assembly (clang, -O2):
<test_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <test_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @test_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sin(double);
int /*<<< orphan*/ track_stats(void *);
double ln_sin_xpx(double x, void *params) {
  track_stats(params);
  return log(sin(x) + x);
}


x86 assembly (clang, -O0):
<ln_sin_xpx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <track_stats@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%rdi
call   1050 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_sin_xpx>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <track_stats@plt>
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1050 <log@plt>

LLVM IR (-O0):
define double @ln_sin_xpx(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @track_stats(i8* %5)
%7 = load double, double* %3
%8 = call i64 @sin(double %7)
%9 = sitofp i64 %8 to double
%10 = load double, double* %3
%11 = fadd double %9, %10
%12 = fptosi double %11 to i64
%13 = call double @log(i64 %12)
ret double %13
}

LLVM IR (-O2):
define double @ln_sin_xpx(double %0, i8* %1) {
%3 = tail call i32 @track_stats(i8* %1)
%4 = tail call i64 @sin(double %0)
%5 = sitofp i64 %4 to double
%6 = fadd double %5, %0
%7 = fptosi double %6 to i64
%8 = tail call double @log(i64 %7)
ret double %8
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
extern int test_string_equal(const void *l, const void *r) {
  int result = 0;
  if (strcmp((char *)l, (char *)r) == 0) {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<test_string_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1145 <test_string_equal+0x35>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_string_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_string_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %5
br label %11
11: ; preds = %10, %2
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_string_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num;
  num = 1;
  while (num < 100) {
    if (num % 2 == 0) {
      printf("%d - ", num);
    }
    num++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1161 <main+0x51>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1153 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    1138 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1149 <main+0x39>
test   $0x1,%bl
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d - \00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 1, %0 ], [ %8, %7 ]
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %1
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
void ClearExtensionVars() {}


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

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

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

LLVM IR (-O2):
define void @ClearExtensionVars() {
ret void
}
/* Variables and functions */
unsigned char _utf8_shiftpos(unsigned int, int /*<<< orphan*/);
char _utf8_header_byte(unsigned long codepoint, unsigned w) {
  unsigned char pattern = ~0 << (8 - w);
  unsigned char valmask = ~0 >> (7 - w);
  return pattern | (char)(codepoint >> _utf8_shiftpos(w, 0) & valmask);
}


x86 assembly (clang, -O0):
<_utf8_header_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x8,%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %al,-0xd(%rbp)
mov    $0x7,%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
sar    %cl,%eax
mov    %al,-0xe(%rbp)
movzbl -0xd(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <_utf8_shiftpos@plt>
mov    -0x20(%rbp),%rdx
mov    %al,%cl
mov    -0x14(%rbp),%eax
movzbl %cl,%ecx
mov    %ecx,%ecx
shr    %cl,%rdx
mov    %rdx,%rcx
movzbl -0xe(%rbp),%edx
and    %rdx,%rcx
movsbl %cl,%ecx
or     %ecx,%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_utf8_header_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x8,%cl
sub    %sil,%cl
mov    $0xffffffff,%ebp
shl    %cl,%ebp
mov    %esi,%edi
xor    %esi,%esi
call   1030 <_utf8_shiftpos@plt>
mov    %eax,%ecx
shr    %cl,%rbx
or     %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @_utf8_header_byte(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i64 %0, i64* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub i32 8, %7
%9 = shl i32 -1, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i32, i32* %4
%12 = sub i32 7, %11
%13 = ashr i32 -1, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i64, i64* %3
%18 = load i32, i32* %4
%19 = call zeroext i8 @_utf8_shiftpos(i32 %18, i32 0)
%20 = zext i8 %19 to i32
%21 = zext i32 %20 to i64
%22 = lshr i64 %17, %21
%23 = load i8, i8* %6
%24 = zext i8 %23 to i64
%25 = and i64 %22, %24
%26 = trunc i64 %25 to i8
%27 = sext i8 %26 to i32
%28 = or i32 %16, %27
%29 = trunc i32 %28 to i8
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @_utf8_header_byte(i64 %0, i32 %1) {
%3 = sub i32 8, %1
%4 = shl nsw i32 -1, %3
%5 = tail call zeroext i8 @_utf8_shiftpos(i32 %1, i32 0)
%6 = zext i8 %5 to i64
%7 = lshr i64 %0, %6
%8 = trunc i64 %7 to i32
%9 = or i32 %4, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}