xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t AONRTCFractionGet(void) {
  return ((*((volatile unsigned long *)(0x40092000 + 0x0000000C))));
}


x86 assembly (clang, -O0):
<AONRTCFractionGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4009200c,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONRTCFractionGet>:
mov    0x4009200c,%rax
40
ret

LLVM IR (-O0):
define i64 @AONRTCFractionGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074339852 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @AONRTCFractionGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074339852 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int getValue() {
  int x;
  scanf("%d", &x);
  return x;
}


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

x86 assembly (clang, -O2):
<getValue>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @getValue() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
void adis16080_unconfigure_ring(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16080_unconfigure_ring(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char ***);
int /*<<< orphan*/ stdin;
void nothing() {
  char *buf0[50];
  printf("%p\n", &buf0);
  fgets(*buf0, sizeof(*buf0), stdin);
}


x86 assembly (clang, -O0):
<nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
lea    -0x190(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x190(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1040 <fgets@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nothing>:
sub    $0x198,%rsp
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
mov    (%rsp),%rdi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1040 <fgets@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
@stdin = global i32 0
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = bitcast [50 x i8*]* %1 to i8***
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8*** %2)
%4 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 8, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@stdin = global i32 0
define void @nothing() {
%1 = alloca [50 x i8*]
%2 = bitcast [50 x i8*]* %1 to i8*
%3 = bitcast [50 x i8*]* %1 to i8***
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8*** %3)
%5 = getelementptr inbounds [50 x i8*], [50 x i8*]* %1, i64 0, i64 0
%6 = load i8*, i8** %5
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 8, i32 %7)
ret void
}
void glUniform3iv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform3iv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ my_hello();
int /*<<< orphan*/ other_hello();
int main() {
  my_hello();
  other_hello();
  assert(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <my_hello@plt>
mov    $0x0,%al
call   1030 <other_hello@plt>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <my_hello@plt>
xor    %eax,%eax
call   1030 <other_hello@plt>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @my_hello()
%2 = call i32 (...) @other_hello()
%3 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @my_hello()
%2 = tail call i32 (...) @other_hello()
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_print(float const *, int);
void vec3f_print(const float v[3]) { vecNf_print(v, 3); }


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

x86 assembly (clang, -O2):
<vec3f_print>:
mov    $0x3,%esi
jmp    1030 <vecNf_print@plt>

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

LLVM IR (-O2):
define void @vec3f_print(float* %0) {
%2 = tail call i32 @vecNf_print(float* %0, i32 3)
ret void
}
void csv_disp_perct(double perct) {}


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

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

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

LLVM IR (-O2):
define void @csv_disp_perct(double %0) {
ret void
}
void INI_MRIState_ffnc_ctx() { ; }


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

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

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

LLVM IR (-O2):
define void @INI_MRIState_ffnc_ctx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall_print(char *);
void uputc(char **s, char c) {
  (void)s;
  char buf[2];
  buf[0] = c;
  syscall_print(buf);
}


x86 assembly (clang, -O0):
<uputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <syscall_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uputc>:
push   %rax
mov    %sil,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <syscall_print@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @uputc(i8** nocapture readnone %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = call i32 @syscall_print(i8* %4)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
uint16_t libcperciva_be16dec(const void *pp) {
  const uint8_t *p = (uint8_t const *)pp;
  return ((uint16_t)(p[1]) + ((uint16_t)(p[0]) << 8));
}


x86 assembly (clang, -O0):
<libcperciva_be16dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcperciva_be16dec>:
mov    (%rdi),%eax
shl    $0x8,%eax
add    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @libcperciva_be16dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @libcperciva_be16dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = add nsw i32 %9, %6
ret i32 %10
}
int isRightWindow(int maxSeats, int seat) {
  return (seat <= maxSeats - 5 && !(seat % 4)) || (seat == maxSeats);
}


x86 assembly (clang, -O0):
<isRightWindow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x5,%ecx
cmp    %ecx,%eax
jg     1134 <isRightWindow+0x34>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x9(%rbp)
je     1140 <isRightWindow+0x40>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRightWindow>:
lea    -0x5(%rdi),%eax
cmp    %esi,%eax
setge  %al
test   $0x3,%sil
sete   %cl
and    %al,%cl
cmp    %edi,%esi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isRightWindow(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 = sub nsw i32 %6, 5
%8 = icmp sle i32 %5, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = srem i32 %10, 4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9, %2
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp eq i32 %14, %15
br label %17
17: ; preds = %13, %9
%18 = phi i1 [ true, %9 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @isRightWindow(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -5
%4 = icmp sge i32 %3, %1
%5 = and i32 %1, 3
%6 = icmp eq i32 %5, 0
%7 = and i1 %4, %6
%8 = icmp eq i32 %1, %0
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void endTest(void) {
  printf("---------------------------------------------------------------\n");
}


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

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

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

LLVM IR (-O2):
@str = [64 x i8] c"---------------------------------------------------------------\00"
define void @endTest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int strncmp(char *, char *, int /*<<< orphan*/);
int strcmp(char *a, char *b) { return strncmp(a, b, strlen(a)); }


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

x86 assembly (clang, -O2):
<strcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *name) { printf("usage: %s file_name\n", name); }


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"usage: %s file_name\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"usage: %s file_name\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int ENOSYS;
int pthread_cancel(pthread_t thread) { return -ENOSYS; }


x86 assembly (clang, -O0):
<pthread_cancel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_cancel>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @pthread_cancel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_cancel(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
void setup_uart(unsigned cpu_hz, unsigned uart_baud_hz) {
  unsigned uart_counter = cpu_hz / uart_baud_hz;
  (*(volatile unsigned int *)(0x8010u) = (uart_counter));
}


x86 assembly (clang, -O0):
<setup_uart>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x8010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_uart>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %eax,0x8010
ret

LLVM IR (-O0):
define void @setup_uart(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 = load i32, i32* %4
%8 = udiv i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
store volatile i32 %9, i32* inttoptr (i64 32784 to i32*)
ret void
}

LLVM IR (-O2):
define void @setup_uart(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
store volatile i32 %3, i32* inttoptr (i64 32784 to i32*)
ret void
}
void mdp4_dsi_cmd_vsync_ctrl(int cndx, int enable) {}


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

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

LLVM IR (-O0):
define void @mdp4_dsi_cmd_vsync_ctrl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @mdp4_dsi_cmd_vsync_ctrl(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
float erf_positive(float);
float erf_(float x) {
  if (x < 0.0f)
    return -erf_positive(-x);
  return erf_positive(x);
}


x86 assembly (clang, -O0):
<erf_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1158 <erf_+0x48>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <erf_positive@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1167 <erf_+0x57>
movss  -0x8(%rbp),%xmm0
call   1030 <erf_positive@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erf_>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    112e <erf_+0x1e>
push   %rax
xorps  0xee0(%rip),%xmm0
call   1030 <erf_positive@plt>
xorps  0xed4(%rip),%xmm0
pop    %rax
ret
jmp    1030 <erf_positive@plt>

LLVM IR (-O0):
define float @erf_(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %3
%8 = fneg float %7
%9 = call float @erf_positive(float %8)
%10 = fneg float %9
store float %10, float* %2
br label %14
11: ; preds = %1
%12 = load float, float* %3
%13 = call float @erf_positive(float %12)
store float %13, float* %2
br label %14
14: ; preds = %11, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @erf_(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg float %0
%5 = tail call float @erf_positive(float %4)
%6 = fneg float %5
br label %9
7: ; preds = %1
%8 = tail call float @erf_positive(float %0)
br label %9
9: ; preds = %7, %3
%10 = phi float [ %6, %3 ], [ %8, %7 ]
ret float %10
}
/* Variables and functions */
bool comparar(int *v1, int *v2) {
  if (*v1 > *v2) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<comparar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <comparar+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <comparar+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @comparar(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned char inb(unsigned short int port) {
  unsigned char _v;
  __asm__ __volatile__("inb %w1,%0" : "=a"(_v) : "Nd"(port));
  return _v;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int calculate(int);
int calculateRecursive(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", calculate(10));
  printf("%d\n", calculateRecursive(10));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <calculate@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <calculateRecursive@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @calculate(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @calculateRecursive(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void alm(int signo) { printf("SIGALRM Received\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"SIGALRM Received\0A\00"
define void @alm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"SIGALRM Received\00"
define void @alm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int test() {
  int x = -16;
  unsigned y = -16;
  if (x >> 4 != -1)
    return 1;
  if (y >> 4 != 0x0fffffff)
    return 2;
  x = 0x40000000, y = 0x40000000;
  if (x << 1 >= 0)
    return 3;
  if (y << 1 != 0x80000000)
    return 4;
  x = 1, y = 1;
  if (x << (y + 3) != 16) {
    return 5;
  }
  x <<= (y + 5);
  if (x != 64) {
    return 6;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0xfffffff0,-0x8(%rbp)
movl   $0xfffffff0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x4,%eax
cmp    $0xffffffff,%eax
je     112d <test+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    11e9 <test+0xe9>
mov    -0xc(%rbp),%eax
shr    $0x4,%eax
cmp    $0xfffffff,%eax
je     114a <test+0x4a>
movl   $0x2,-0x4(%rbp)
jmp    11e9 <test+0xe9>
movl   $0x40000000,-0x8(%rbp)
movl   $0x40000000,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cmp    $0x0,%eax
jl     1173 <test+0x73>
movl   $0x3,-0x4(%rbp)
jmp    11e9 <test+0xe9>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cmp    $0x80000000,%eax
je     1190 <test+0x90>
movl   $0x4,-0x4(%rbp)
jmp    11e9 <test+0xe9>
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
shl    %cl,%eax
cmp    $0x10,%eax
je     11be <test+0xbe>
movl   $0x5,-0x4(%rbp)
jmp    11e9 <test+0xe9>
mov    -0xc(%rbp),%ecx
add    $0x5,%ecx
mov    -0x8(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
je     11e2 <test+0xe2>
movl   $0x6,-0x4(%rbp)
jmp    11e9 <test+0xe9>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -16, i32* %2
store i32 -16, i32* %3
%4 = load i32, i32* %2
%5 = ashr i32 %4, 4
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %39
8: ; preds = %0
%9 = load i32, i32* %3
%10 = lshr i32 %9, 4
%11 = icmp ne i32 %10, 268435455
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %1
br label %39
13: ; preds = %8
store i32 1073741824, i32* %2
store i32 1073741824, i32* %3
%14 = load i32, i32* %2
%15 = shl i32 %14, 1
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 3, i32* %1
br label %39
18: ; preds = %13
%19 = load i32, i32* %3
%20 = shl i32 %19, 1
%21 = icmp ne i32 %20, -2147483648
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 4, i32* %1
br label %39
23: ; preds = %18
store i32 1, i32* %2
store i32 1, i32* %3
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = add i32 %25, 3
%27 = shl i32 %24, %26
%28 = icmp ne i32 %27, 16
br i1 %28, label %29, label %30
29: ; preds = %23
store i32 5, i32* %1
br label %39
30: ; preds = %23
%31 = load i32, i32* %3
%32 = add i32 %31, 5
%33 = load i32, i32* %2
%34 = shl i32 %33, %32
store i32 %34, i32* %2
%35 = load i32, i32* %2
%36 = icmp ne i32 %35, 64
br i1 %36, label %37, label %38
37: ; preds = %30
store i32 6, i32* %1
br label %39
38: ; preds = %30
store i32 0, i32* %1
br label %39
39: ; preds = %38, %37, %29, %22, %17, %12, %7
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
/* Variables and functions */
int snprintf(char *, int, char *, char const *);
int f6(int *p, char *s) {
  const char *t = "bar";
  return snprintf(s, 8, "%s", t);
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x8,%esi
lea    0xec5(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %rsi,%rdi
lea    0xeea(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    $0x8,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"bar\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @f6(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %6, i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"bar\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @f6(i32* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* %1, i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GP_updApp(short, char *);
scalar_t__ getParLong(long *);
char *getString();
int /*<<< orphan*/ isNString(int);
int /*<<< orphan*/ messErr(int);
void IF_gplot_commapp(void) {
  long t;
  char *a;
  if (getParLong(&t)) {
    if (!isNString(1)) {
      messErr(6);
      return;
    }
    a = getString();
    GP_updApp((short)t, a);
  }
}


x86 assembly (clang, -O0):
<IF_gplot_commapp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1070 <getParLong@plt>
cmp    $0x0,%rax
je     11a8 <IF_gplot_commapp+0x58>
mov    $0x1,%edi
call   1040 <isNString@plt>
cmp    $0x0,%eax
jne    118d <IF_gplot_commapp+0x3d>
mov    $0x6,%edi
call   1050 <messErr@plt>
jmp    11a8 <IF_gplot_commapp+0x58>
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
movswl %ax,%edi
call   1060 <GP_updApp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_gplot_commapp>:
push   %rax
mov    %rsp,%rdi
call   1070 <getParLong@plt>
test   %rax,%rax
je     117f <IF_gplot_commapp+0x2f>
mov    $0x1,%edi
call   1040 <isNString@plt>
test   %eax,%eax
je     1181 <IF_gplot_commapp+0x31>
xor    %eax,%eax
call   1030 <getString@plt>
movswl (%rsp),%edi
mov    %rax,%rsi
call   1060 <GP_updApp@plt>
pop    %rax
ret
mov    $0x6,%edi
call   1050 <messErr@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @IF_gplot_commapp() {
%1 = alloca i64
%2 = alloca i8*
%3 = call i64 @getParLong(i64* %1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %0
%6 = call i32 @isNString(i32 1)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @messErr(i32 6)
br label %16
10: ; preds = %5
%11 = call i8* (...) @getString()
store i8* %11, i8** %2
%12 = load i64, i64* %1
%13 = trunc i64 %12 to i16
%14 = load i8*, i8** %2
%15 = call i32 @GP_updApp(i16 signext %13, i8* %14)
br label %16
16: ; preds = %8, %10, %0
ret void
}

LLVM IR (-O2):
define void @IF_gplot_commapp() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i64 @getParLong(i64* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %0
%6 = call i32 @isNString(i32 1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @messErr(i32 6)
br label %15
10: ; preds = %5
%11 = call i8* (...) @getString()
%12 = load i64, i64* %1
%13 = trunc i64 %12 to i16
%14 = call i32 @GP_updApp(i16 signext %13, i8* %11)
br label %15
15: ; preds = %0, %10, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage(void) {
  fprintf(stderr, "Usage: 'tsfilter filename.ts +pid1 +pid2 ... +pidn "
                  "[buffer_size_in_packets]'\n");
  fprintf(stderr, "+pid keeps 'pid' packets\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf15(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf1f(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [78 x i8] c"Usage: 'tsfilter filename.ts +pid1 +pid2 ... +pidn [buffer_size_in_packets]'\0A\00"
@.str.1 = [26 x i8] c"+pid keeps 'pid' packets\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [78 x i8] c"Usage: 'tsfilter filename.ts +pid1 +pid2 ... +pidn [buffer_size_in_packets]'\0A\00"
@.str.1 = [26 x i8] c"+pid keeps 'pid' packets\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fatorial(int);
int comb(int a, int b) {
  return (fatorial(a) / (fatorial(b) * fatorial(a - b)));
}


x86 assembly (clang, -O0):
<comb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fatorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fatorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <fatorial@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comb>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <fatorial@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <fatorial@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <fatorial@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @comb(i32 %0, i32 %1) {
%3 = tail call i32 @fatorial(i32 %0)
%4 = tail call i32 @fatorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @fatorial(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRE5_get(void) { return U_WMRCORENONE_get("U_WMRE5"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE5\00"
define i32 @U_WMRE5_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE5\00"
define i32 @U_WMRE5_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
scalar_t__ write_com_4bit(int);
void disp_shift_R() {
  write_com_4bit(0x0010 | 0x0c);
  while (write_com_4bit(0x0100) != 0)
    ;
}


x86 assembly (clang, -O0):
<disp_shift_R>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <write_com_4bit@plt>
mov    $0x100,%edi
call   1030 <write_com_4bit@plt>
cmp    $0x0,%rax
je     1137 <disp_shift_R+0x27>
jmp    111e <disp_shift_R+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_shift_R>:
push   %rax
mov    $0x1c,%edi
call   1030 <write_com_4bit@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x100,%edi
call   1030 <write_com_4bit@plt>
test   %rax,%rax
jne    1120 <disp_shift_R+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @disp_shift_R() {
%1 = call i64 @write_com_4bit(i32 28)
br label %2
2: ; preds = %5, %0
%3 = call i64 @write_com_4bit(i32 256)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @disp_shift_R() {
%1 = tail call i64 @write_com_4bit(i32 28)
br label %2
2: ; preds = %2, %0
%3 = tail call i64 @write_com_4bit(i32 256)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ search(char *, char *, int);
int main() {
  char *txt = "123456";
  char *pad = "345";
  int q = 101;
  search(pad, txt, q);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec6(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x65,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <search@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedf(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x65,%edx
call   1030 <search@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"123456\00"
@.str.1 = [4 x i8] c"345\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i32 101, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = call i32 @search(i8* %5, i8* %6, i32 %7)
%9 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"123456\00"
@.str.1 = [4 x i8] c"345\00"
define i32 @main() {
%1 = tail call i32 @search(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 101)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ testManyArg(int, int, int);
int main(void) {
  puts("!!!Hello World!!!");
  testManyArg(123, 456, 455);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x7b,%edi
mov    $0x1c8,%esi
mov    $0x1c7,%edx
call   1040 <testManyArg@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x7b,%edi
mov    $0x1c8,%esi
mov    $0x1c7,%edx
call   1040 <testManyArg@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @testManyArg(i32 123, i32 456, i32 455)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @testManyArg(i32 123, i32 456, i32 455)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ root;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
unsigned long get_Screen_root(void *_p) {
  return (unsigned long)((Screen *)_p)->root;
}


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

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

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

LLVM IR (-O2):
define i64 @get_Screen_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void EPIIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000210))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<EPIIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x210(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x210(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntDisable>:
not    %rsi
and    %rsi,0x210(%rdi)
ret

LLVM IR (-O0):
define void @EPIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 528
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @EPIIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 528
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h264nal_init(uint8_t *p_h264nal) {
  p_h264nal[0] = 0x0;
  p_h264nal[1] = 0x0;
  p_h264nal[2] = 0x1;
  p_h264nal[3] = 0;
}


x86 assembly (clang, -O0):
<h264nal_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264nal_init>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @h264nal_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 1, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 0, i32* %10
ret void
}

LLVM IR (-O2):
define void @h264nal_init(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 0, i32 0, i32 1, i32 0>, <4 x i32>* %2
ret void
}
void *a_cas_p(volatile void *p, void *t, void *s) {
  __asm__("lock ; cmpxchg %3, %1"
          : "=a"(t), "=m"(*(void *volatile *)p)
          : "a"(t), "r"(s)
          : "memory");
  return t;
}


x86 assembly (clang, -O0):
<a_cas_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas_p>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* asm "lock ; cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %8, i8* %9, i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %0 to i8**
%5 = tail call i8* asm "lock ; cmpxchg $3, $1", "={ax},=*m,{ax},r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %4, i8* %1, i8* %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char buf[1001], *ptr;
  scanf("%s", buf);
  for (ptr = &buf[2]; *ptr; ptr++)
    *(ptr - 1) = '_';
  puts(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x3f0(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x3f8(%rbp)
mov    -0x3f8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1189 <main+0x69>
mov    -0x3f8(%rbp),%rax
movb   $0x5f,-0x1(%rax)
mov    -0x3f8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x3f8(%rbp)
jmp    1157 <main+0x37>
lea    -0x3f0(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x3f8,%rsp
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmpb   $0x0,0x2(%rsp)
je     115d <main+0x3d>
lea    0x3(%rsp),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5f,-0x2(%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1150 <main+0x30>
mov    %rsp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x3f8,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1001 x i8]
%2 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 2
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %0, %7
%8 = phi i8* [ %10, %7 ], [ %4, %0 ]
%9 = getelementptr inbounds i8, i8* %8, i64 -1
store i8 95, i8* %9
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %0
%14 = call i32 @puts(i8* %2)
ret i32 0
}
int test_imm_02int64_highword_reg(long long val) {
  return ((val >> 32) & (0x02 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_02int64_highword_reg>:
bt     $0x21,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_02int64_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, 2
%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_02int64_highword_reg(i64 %0) {
%2 = and i64 %0, 8589934592
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_58int32_reg(int val) { return ((val) & (0x58 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_58int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x58,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_58int32_reg(i32 %0) {
%2 = and i32 %0, 88
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t lfsr63(uint64_t x) {
  uint64_t bit = (x ^ (x >> 1)) & 1;
  return (x >> 1) | (bit << 62);
}


x86 assembly (clang, -O0):
<lfsr63>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x8(%rbp),%edx
mov    $0x3e,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lfsr63(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = xor i32 %4, %6
%8 = and i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = ashr i32 %9, 1
%11 = load i32, i32* %3
%12 = shl i32 %11, 62
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @lfsr63(i32 %0) {
ret i32 poison
}