xunge/DecIR huggingface dataset:
/* Type definitions */
struct orbita_potential {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ orbita_err(char *);
struct orbita_potential *orbita_potential_homogeneous_sphere_var(double rho,
                                                                 double a) {
  orbita_err("orbita_potential_homogeneous_sphere_var: Not implemented.");
  return NULL;
}


x86 assembly (clang, -O0):
<orbita_potential_homogeneous_sphere_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <orbita_err@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.orbita_potential = type { i32 }
@.str = [58 x i8] c"orbita_potential_homogeneous_sphere_var: Not implemented.\00"
define %struct.orbita_potential* @orbita_potential_homogeneous_sphere_var(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @orbita_err(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret %struct.orbita_potential* null
}

LLVM IR (-O2):
%struct.orbita_potential = type { i32 }
@.str = [58 x i8] c"orbita_potential_homogeneous_sphere_var: Not implemented.\00"
define noalias %struct.orbita_potential* @orbita_potential_homogeneous_sphere_var(double %0, double %1) {
%3 = tail call i32 @orbita_err(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret %struct.orbita_potential* null
}
int getBit8(int *pInt32, int index) {
  return (*pInt32 >> (index * 8)) & (0xff >> sizeof(int));
}


x86 assembly (clang, -O0):
<getBit8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBit8>:
mov    (%rdi),%eax
lea    0x0(,%rsi,8),%ecx
sar    %cl,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @getBit8(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* %5
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8
%9 = ashr i32 %6, %8
%10 = and i32 %9, 15
ret i32 %10
}

LLVM IR (-O2):
define i32 @getBit8(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nsw i32 %1, 3
%5 = ashr i32 %3, %4
%6 = and i32 %5, 15
ret i32 %6
}
/* Variables and functions */
int KmpSearch(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("%d\n", KmpSearch("asdfas asdfadfd ", "asdfad"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [17 x i8] c"asdfas asdfadfd \00"
@.str.2 = [7 x i8] c"asdfad\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @KmpSearch(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [17 x i8] c"asdfas asdfadfd \00"
@.str.2 = [7 x i8] c"asdfad\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @KmpSearch(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XButtonReleasedEvent;

/* Variables and functions */
void set_XButtonReleasedEvent_send_event(void *_p, int _v) {
  ((XButtonReleasedEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonReleasedEvent_send_event>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XButtonReleasedEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
int bytes_available(int fd) {
  int count;
  ioctl(fd, FIONREAD, &count);
  return count;
}


x86 assembly (clang, -O0):
<bytes_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_available>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i32 @bytes_available(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONREAD
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @bytes_available(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @FIONREAD
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
void __attribute__((weak)) EXTI15_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI15_Callback() {
ret void
}
/* Variables and functions */
int mysql_library_init(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int db_mysql_init(void) { return mysql_library_init(0, NULL, NULL); }


x86 assembly (clang, -O0):
<db_mysql_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <mysql_library_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_mysql_init>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <mysql_library_init@plt>

LLVM IR (-O0):
define i32 @db_mysql_init() {
%1 = call i32 @mysql_library_init(i32 0, i32* null, i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @db_mysql_init() {
%1 = tail call i32 @mysql_library_init(i32 0, i32* null, i32* null)
ret i32 %1
}
unsigned short int isletter(char c) {
  int i = 0;
  if (c >= 'a' && c <= 'z') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isletter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <isletter+0x36>
movsbl -0x3(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <isletter+0x36>
movw   $0x1,-0x2(%rbp)
jmp    113c <isletter+0x3c>
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isletter>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define zeroext i16 @isletter(i8 signext %0) {
%2 = alloca i16
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 0, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br i1 %11, label %12, label %13
12: ; preds = %8
store i16 1, i16* %2
br label %14
13: ; preds = %8, %1
store i16 0, i16* %2
br label %14
14: ; preds = %13, %12
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @isletter(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts("sleep [--version|--help] TIME[s|m|h|d]\n"
       "\n"
       "--version - print version\n"
       "   --help - this help\n"
       "     TIME - an integer number; optional postfixes:\n"
       "            s - seconds (default)\n"
       "            m - minutes\n"
       "            h - hours\n"
       "            d - days\n");
}


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

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

LLVM IR (-O0):
@.str = [241 x i8] c"sleep [--version|--help] TIME[s|m|h|d]\0A\0A--version - print version\0A --help - this help\0A TIME - an integer number; optional postfixes:\0A s - seconds (default)\0A m - minutes\0A h - hours\0A d - days\0A\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([241 x i8], [241 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [241 x i8] c"sleep [--version|--help] TIME[s|m|h|d]\0A\0A--version - print version\0A --help - this help\0A TIME - an integer number; optional postfixes:\0A s - seconds (default)\0A m - minutes\0A h - hours\0A d - days\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([241 x i8], [241 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int Read_Status_Register();
void Wait_Busy_AAI() {
  while (Read_Status_Register() == 0x43)
    Read_Status_Register();
}


x86 assembly (clang, -O0):
<Wait_Busy_AAI>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <Wait_Busy_AAI+0x9>
mov    $0x0,%al
call   1030 <Read_Status_Register@plt>
cmp    $0x43,%eax
jne    1135 <Wait_Busy_AAI+0x25>
mov    $0x0,%al
call   1030 <Read_Status_Register@plt>
jmp    1119 <Wait_Busy_AAI+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wait_Busy_AAI>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Read_Status_Register@plt>
cmp    $0x43,%eax
jne    1135 <Wait_Busy_AAI+0x25>
xor    %eax,%eax
call   1030 <Read_Status_Register@plt>
jmp    1120 <Wait_Busy_AAI+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @Wait_Busy_AAI() {
br label %1
1: ; preds = %4, %0
%2 = call i32 (...) @Read_Status_Register()
%3 = icmp eq i32 %2, 67
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @Read_Status_Register()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @Wait_Busy_AAI() {
%1 = tail call i32 (...) @Read_Status_Register()
%2 = icmp eq i32 %1, 67
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @Read_Status_Register()
%5 = tail call i32 (...) @Read_Status_Register()
%6 = icmp eq i32 %5, 67
br i1 %6, label %3, label %7
7: ; preds = %3, %0
ret void
}
void *heap_min(struct max_heap *h) {}


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

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

LLVM IR (-O0):
%struct.max_heap = type opaque
define i8* @heap_min(%struct.max_heap* %0) {
%2 = alloca i8*
%3 = alloca %struct.max_heap*
store %struct.max_heap* %0, %struct.max_heap** %3
%4 = load i8*, i8** %2
ret i8* %4
}

LLVM IR (-O2):
%struct.max_heap = type opaque
define noalias i8* @heap_min(%struct.max_heap* nocapture readnone %0) {
ret i8* undef
}
int PackRCFPState(int j, int nu, int J) {
  return J + nu * 1024 + j * 1024 * 1024;
}


x86 assembly (clang, -O0):
<PackRCFPState>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0xa,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0xa,%ecx
shl    $0xa,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PackRCFPState>:
shl    $0xa,%esi
shl    $0x14,%edi
lea    (%rdi,%rdx,1),%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @PackRCFPState(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* %6
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 1024
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, 1024
%13 = mul nsw i32 %12, 1024
%14 = add nsw i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @PackRCFPState(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 10
%5 = shl nsw i32 %0, 20
%6 = add i32 %5, %2
%7 = add i32 %6, %4
ret i32 %7
}
int test_imm_A2int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xA2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A2int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 162
%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_A2int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 695784701952
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int hputs(char *str, int fh) { return write(fh, str, strlen(str)); }


x86 assembly (clang, -O0):
<hputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputs>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @hputs(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @hputs(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret i32 %4
}
unsigned int csum_add(unsigned int csum, unsigned int addend) {
  csum += addend;
  return csum + (csum < addend);
}


x86 assembly (clang, -O0):
<csum_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_add>:
mov    %edi,%eax
add    %esi,%eax
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @csum_add(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
%7 = add i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp ult i32 %9, %10
%12 = zext i1 %11 to i32
%13 = add i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @csum_add(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ult i32 %3, %1
%5 = zext i1 %4 to i32
%6 = add i32 %3, %5
ret i32 %6
}
int bar(void) {
  unsigned i;
  for (i = 0; i < 1000; i += 7)
    i += i & 1;
  return i;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jae    1132 <bar+0x32>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <bar+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
and    $0x1,%ecx
add    %ecx,%eax
add    $0x7,%eax
cmp    $0x3e8,%eax
jb     1110 <bar+0x10>
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp ult i32 %3, 1000
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = and i32 %6, 1
%8 = load i32, i32* %1
%9 = add i32 %8, %7
store i32 %9, i32* %1
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add i32 %11, 7
store i32 %12, i32* %1
br label %2
13: ; preds = %2
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @bar() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = and i32 %2, 1
%4 = add nuw nsw i32 %2, 7
%5 = add nuw nsw i32 %4, %3
%6 = icmp ult i32 %5, 1000
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_packet_ref() {
  printf("NOT IMPLEMENTED:"
         "pa_packet_ref"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_packet_ref\00"
define i32 @pa_packet_ref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void local(void) {
  auto int tern = 3;
  auto int stay_home = 3;
  printf("from local tern: %d\n", tern);
  printf("from local stay_home: %d\n", stay_home);
}


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

x86 assembly (clang, -O2):
<local>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x3,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"from local tern: %d\0A\00"
@.str.1 = [26 x i8] c"from local stay_home: %d\0A\00"
define void @local() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"from local tern: %d\0A\00"
@.str.1 = [26 x i8] c"from local stay_home: %d\0A\00"
define void @local() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret void
}
int test_imm_71int64_highword_reg(long long val) {
  return ((val >> 32) & (0x71 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_71int64_highword_reg>:
movabs $0x7100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_71int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 113
%6 = icmp ne i64 %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_71int64_highword_reg(i64 %0) {
%2 = and i64 %0, 485331304448
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void space(int s) {
  int i = 0;
  for (i; i < s; i++) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <space+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <space+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <space+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <space+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @space(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(long *);
main() {
  printf("%ld\n", time((long *)0));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i64* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int SIGQUIT;
int sigwait(const sigset_t *set, int *sig) {
  *sig = SIGQUIT;
  return 0;
}


x86 assembly (clang, -O0):
<sigwait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigwait>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@SIGQUIT = global i32 0
define i32 @sigwait(i32* nocapture readnone %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* @SIGQUIT
store i32 %3, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ liquid_autotest_passed();
void autotest_null() { liquid_autotest_passed(); }


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

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

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

LLVM IR (-O2):
define void @autotest_null() {
%1 = tail call i32 (...) @liquid_autotest_passed()
ret void
}
rects_(x1, y1, x2, y2) short *x1, *y1, *x2, *y2;
{ rect((float)*x1, (float)*y1, (float)*x2, (float)*y2); }


x86 assembly (clang, -O0):
<rects_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x20(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x28(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm3
cvtss2sd %xmm3,%xmm3
mov    $0x4,%al
call   1030 <rect@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rects_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
movswl (%rdx),%eax
cvtsi2sd %eax,%xmm2
movswl (%rcx),%eax
cvtsi2sd %eax,%xmm3
mov    $0x4,%al
jmp    1030 <rect@plt>

LLVM IR (-O0):
define i32 @rects_(i16* %0, i16* %1, i16* %2, i16* %3) {
%5 = alloca i32
%6 = alloca i16*
%7 = alloca i16*
%8 = alloca i16*
%9 = alloca i16*
store i16* %0, i16** %6
store i16* %1, i16** %7
store i16* %2, i16** %8
store i16* %3, i16** %9
%10 = load i16*, i16** %6
%11 = load i16, i16* %10
%12 = sitofp i16 %11 to float
%13 = fpext float %12 to double
%14 = load i16*, i16** %7
%15 = load i16, i16* %14
%16 = sitofp i16 %15 to float
%17 = fpext float %16 to double
%18 = load i16*, i16** %8
%19 = load i16, i16* %18
%20 = sitofp i16 %19 to float
%21 = fpext float %20 to double
%22 = load i16*, i16** %9
%23 = load i16, i16* %22
%24 = sitofp i16 %23 to float
%25 = fpext float %24 to double
%26 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @rect to i32 (double, double, double, double, ...)*)(double %13, double %17, double %21, double %25)
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @rects_(i16* nocapture %0, i16* nocapture %1, i16* nocapture %2, i16* nocapture %3) {
%5 = load i16, i16* %0
%6 = sitofp i16 %5 to double
%7 = load i16, i16* %1
%8 = sitofp i16 %7 to double
%9 = load i16, i16* %2
%10 = sitofp i16 %9 to double
%11 = load i16, i16* %3
%12 = sitofp i16 %11 to double
%13 = tail call i32 (double, double, double, double, ...) bitcast (i32 (...)* @rect to i32 (double, double, double, double, ...)*)(double %6, double %8, double %10, double %12)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ uart_write(char const);
void puth(unsigned n) {
  static const char hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
                               '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
  uart_write(hex[n & 15]);
}


x86 assembly (clang, -O0):
<puth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xed4(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puth>:
and    $0xf,%edi
lea    0xee6(%rip),%rax
movsbl (%rdi,%rax,1),%edi
jmp    1030 <uart_write@plt>

LLVM IR (-O0):
@puth.hex = internal constant [16 x i8] c"0123456789ABCDEF"
define void @puth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @puth.hex, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = call i32 @uart_write(i8 signext %7)
ret void
}

LLVM IR (-O2):
@puth.hex = internal unnamed_addr constant [16 x i8] c"0123456789ABCDEF"
define void @puth(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [16 x i8], [16 x i8]* @puth.hex, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @uart_write(i8 signext %5)
ret void
}
void spca506_stop0(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @spca506_stop0(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime_r(int /*<<< orphan*/ *, char *);
int test(void) {
  char *buffer_pointer;
  char buffer[80];
  time_t time;
  buffer_pointer = ctime_r(&time, buffer);
  return (buffer_pointer != NULL);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x60(%rbp),%rsi
lea    -0x64(%rbp),%rdi
call   1030 <ctime_r@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x68,%rsp
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <ctime_r@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i8*
%2 = alloca [80 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i8* @ctime_r(i32* %3, i8* %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i8* @ctime_r(i32* %2, i8* %3)
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ set_exec_time(int /*<<< orphan*/);
void start_exec_timer() { set_exec_time(0); }


x86 assembly (clang, -O0):
<start_exec_timer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <set_exec_time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_exec_timer>:
xor    %edi,%edi
jmp    1030 <set_exec_time@plt>

LLVM IR (-O0):
define void @start_exec_timer() {
%1 = call i32 @set_exec_time(i32 0)
ret void
}

LLVM IR (-O2):
define void @start_exec_timer() {
%1 = tail call i32 @set_exec_time(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void xLog(void *pCtx, int rc, const char *z) {
  (void)(rc);
  if (pCtx)
    fprintf(stderr, "%s: ", (char *)pCtx);
  fprintf(stderr, "%s\n", z);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<xLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <xLog+0x37>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xLog>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
test   %rdi,%rdi
je     1144 <xLog+0x24>
mov    %rdi,%rdx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb1(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    (%rbx),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%s: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @xLog(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %10, %3
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %6
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @stderr
%19 = call i32 @fflush(i32 %18)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%s: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @xLog(i8* %0, i32 %1, i8* %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %5, %3
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%11 = load i32, i32* @stderr
%12 = tail call i32 @fflush(i32 %11)
ret void
}
/* Variables and functions */
scalar_t__ isprint2(int);
int toprint2(int c) { return isprint2(c) ? c : '.'; }


x86 assembly (clang, -O0):
<toprint2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isprint2@plt>
cmp    $0x0,%rax
je     1138 <toprint2+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <toprint2+0x35>
mov    $0x2e,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <toprint2+0x35>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toprint2>:
push   %rbx
mov    %edi,%ebx
call   1030 <isprint2@plt>
test   %rax,%rax
mov    $0x2e,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toprint2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint2(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i32 [ %7, %6 ], [ 46, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @toprint2(i32 %0) {
%2 = tail call i64 @isprint2(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 46, i32 %0
ret i32 %4
}
long assemble12(i)
unsigned long i;
{ return (((i & 1) ? 0xfffff800 : 0) | ((i & 4) << 8) | ((i & 0x1ff8) >> 3)); }


x86 assembly (clang, -O0):
<assemble12>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x1,%rdx
xor    %eax,%eax
mov    $0xfffff800,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,%eax
mov    -0x8(%rbp),%rcx
and    $0x4,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0x1ff8,%rcx
shr    $0x3,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble12>:
mov    %edi,%ecx
and    $0x1,%ecx
neg    %ecx
and    $0xfffff800,%ecx
mov    %edi,%eax
and    $0x4,%eax
shl    $0x8,%rax
shr    $0x3,%edi
and    $0x3ff,%edi
or     %rdi,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @assemble12(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -2048, i32 0
%8 = zext i32 %7 to i64
%9 = load i64, i64* %2
%10 = and i64 %9, 4
%11 = shl i64 %10, 8
%12 = or i64 %8, %11
%13 = load i64, i64* %2
%14 = and i64 %13, 8184
%15 = lshr i64 %14, 3
%16 = or i64 %12, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @assemble12(i64 %0) {
%2 = and i64 %0, 1
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 0, i64 4294965248
%5 = shl i64 %0, 8
%6 = and i64 %5, 1024
%7 = lshr i64 %0, 3
%8 = and i64 %7, 1023
%9 = or i64 %8, %6
%10 = or i64 %9, %4
ret i64 %10
}
int plugin_init_mysql(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @plugin_init_mysql() {
ret i32 0
}
int rte_get_self_id(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rte_get_self_id() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
void color_split_rgb(int32_t c, uint8_t *r, uint8_t *g, uint8_t *b) {
  *r = (c >> 16) & 0xff;
  *g = (c >> 8) & 0xff;
  *b = c & 0xff;
}


x86 assembly (clang, -O0):
<color_split_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_split_rgb>:
push   %rbx
mov    %edi,%eax
movzbl %ah,%ebx
movzbl %al,%edi
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,(%rsi)
mov    %ebx,(%rdx)
mov    %edi,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
define void @color_split_rgb(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 = ashr i32 %9, 16
%11 = and i32 %10, 255
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = and i32 %17, 255
%19 = load i32*, i32** %8
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @color_split_rgb(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
store i32 %6, i32* %1
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
store i32 %8, i32* %2
%9 = and i32 %0, 255
store i32 %9, i32* %3
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, int /*<<< orphan*/, int);
int get_servo_pulsewidth(int pi, unsigned user_gpio) {
  return pigpio_command(pi, 84, user_gpio, 0, 1);
}


x86 assembly (clang, -O0):
<get_servo_pulsewidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x54,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_servo_pulsewidth>:
mov    %esi,%edx
mov    $0x54,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @get_servo_pulsewidth(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 = call i32 @pigpio_command(i32 %5, i32 84, i32 %6, i32 0, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_servo_pulsewidth(i32 %0, i32 %1) {
%3 = tail call i32 @pigpio_command(i32 %0, i32 84, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void factor_eval_free(char *result) { free(result); }


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

x86 assembly (clang, -O2):
<factor_eval_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @factor_eval_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t rdtscp_id(void) {
  uint64_t rax = 0, rcx = 0, rdx = 0;
  __asm__ __volatile__("rdtscp" : "=a"(rax), "=d"(rdx), "=c"(rcx) : : "memory");
  return rcx;
}


x86 assembly (clang, -O0):
<rdtscp_id>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
rdtscp
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtscp_id>:
rdtscp
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @rdtscp_id() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* null, i8** %1
store i8* null, i8** %2
store i8* null, i8** %3
%4 = call { i8*, i8*, i8* } asm sideeffect "rdtscp", "={ax},={dx},={cx},~{memory},~{dirflag},~{fpsr},~{flags}"()
%5 = extractvalue { i8*, i8*, i8* } %4, 0
%6 = extractvalue { i8*, i8*, i8* } %4, 1
%7 = extractvalue { i8*, i8*, i8* } %4, 2
store i8* %5, i8** %1
store i8* %6, i8** %3
store i8* %7, i8** %2
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define i8* @rdtscp_id() {
%1 = tail call { i8*, i8*, i8* } asm sideeffect "rdtscp", "={ax},={dx},={cx},~{memory},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i8*, i8*, i8* } %1, 2
ret i8* %2
}
int objInit(void *self) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @objInit(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/ *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_error(int, char *);
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int conditionWait(pthread_cond_t *cond, pthread_mutex_t *mutex) {
  ASSERT(cond);
  int retval;
  retval = pthread_cond_wait(cond, mutex);
  if (retval != 0) {
    log_error(retval, "Error pthread_cond_wait()");
    abort();
  }
  return retval;
}


x86 assembly (clang, -O0):
<conditionWait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ASSERT@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <pthread_cond_wait@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1189 <conditionWait+0x49>
mov    -0x14(%rbp),%edi
lea    0xe83(%rip),%rsi
call   1050 <log_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conditionWait>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <ASSERT@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <pthread_cond_wait@plt>
test   %eax,%eax
jne    1168 <conditionWait+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe91(%rip),%rsi
mov    %eax,%edi
call   1050 <log_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Error pthread_cond_wait()\00"
define i32 @conditionWait(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = call i32 @ASSERT(i32* %6)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @pthread_cond_wait(i32* %8, i32* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %5
%15 = call i32 @log_error(i32 %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %2
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
@.str = [26 x i8] c"Error pthread_cond_wait()\00"
define i32 @conditionWait(i32* %0, i32* %1) {
%3 = tail call i32 @ASSERT(i32* %0)
%4 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @log_error(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int /*<<< orphan*/ perror(char const *);
void end(const char *msg) {
  perror(msg);
  for (;;)
    pause();
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <pause@plt>
jmp    1135 <end+0x15>

x86 assembly (clang, -O2):
<end>:
push   %rax
call   1040 <perror@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <pause@plt>
jmp    1130 <end+0x10>

LLVM IR (-O0):
define void @end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
br label %5
5: ; preds = %5, %1
%6 = call i32 (...) @pause()
br label %5
}

LLVM IR (-O2):
define void @end(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
br label %3
3: ; preds = %3, %1
%4 = tail call i32 (...) @pause()
br label %3
}