xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ stdlib_strided_dcusumkbn(int /*<<< orphan*/ const,
                                            double const, double const *,
                                            int /*<<< orphan*/ const, double *,
                                            int /*<<< orphan*/ const);
void stdlib_strided_dcusum(const int64_t N, const double sum, const double *X,
                           const int64_t strideX, double *Y,
                           const int64_t strideY) {
  stdlib_strided_dcusumkbn(N, sum, X, strideX, Y, strideY);
}


x86 assembly (clang, -O0):
<stdlib_strided_dcusum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
call   1030 <stdlib_strided_dcusumkbn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dcusum>:
jmp    1030 <stdlib_strided_dcusumkbn@plt>

LLVM IR (-O0):
define void @stdlib_strided_dcusum(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double*
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store double* %2, double** %9
store i32 %3, i32* %10
store double* %4, double** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load double, double* %8
%15 = load double*, double** %9
%16 = load i32, i32* %10
%17 = load double*, double** %11
%18 = load i32, i32* %12
%19 = call i32 @stdlib_strided_dcusumkbn(i32 %13, double %14, double* %15, i32 %16, double* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @stdlib_strided_dcusum(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = tail call i32 @stdlib_strided_dcusumkbn(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5)
ret void
}
void returns_c_string_in_argument(const char **arg) {
  *arg = "returned_c_string_in_argument";
}


x86 assembly (clang, -O0):
<returns_c_string_in_argument>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xeed(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<returns_c_string_in_argument>:
lea    0xef9(%rip),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@.str = [30 x i8] c"returned_c_string_in_argument\00"
define void @returns_c_string_in_argument(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %3
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"returned_c_string_in_argument\00"
define void @returns_c_string_in_argument(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %0
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int getppid() { return syscall(1, 0, 0); }


x86 assembly (clang, -O0):
<getppid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getppid>:
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getppid() {
%1 = call i32 @syscall(i32 1, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getppid() {
%1 = tail call i32 @syscall(i32 1, i32 0, i32 0)
ret i32 %1
}
/* Type definitions */
struct chip8asm_program {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct chip8asm_program *);
void chip8asm_program_destroy(struct chip8asm_program *prog) { free(prog); }


x86 assembly (clang, -O0):
<chip8asm_program_destroy>:
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):
<chip8asm_program_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.chip8asm_program = type { i32 }
define void @chip8asm_program_destroy(%struct.chip8asm_program* nocapture %0) {
%2 = tail call i32 @free(%struct.chip8asm_program* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_STRING_TABLE;

/* Variables and functions */
int table_cmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int table_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) {
  ASN1_STRING_TABLE const *a = a_;
  ASN1_STRING_TABLE const *b = b_;
  return table_cmp(a, b);
}


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

x86 assembly (clang, -O2):
<table_cmp_BSEARCH_CMP_FN>:
jmp    1030 <table_cmp@plt>

LLVM IR (-O0):
define i32 @table_cmp_BSEARCH_CMP_FN(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = call i32 @table_cmp(i32* %11, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @table_cmp_BSEARCH_CMP_FN(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = tail call i32 @table_cmp(i32* %3, i32* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ game_exit(char *);
void *malloc(size_t);
void *dt_malloc(size_t size) {
  void *temp_object;
  temp_object = malloc(size);
  if (temp_object == NULL) {
    game_exit("Insufficient memory to allocate object");
  }
  return (temp_object);
}


x86 assembly (clang, -O0):
<dt_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <dt_malloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <game_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <dt_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <game_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Insufficient memory to allocate object\00"
define i8* @dt_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @game_exit(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [39 x i8] c"Insufficient memory to allocate object\00"
define noalias i8* @dt_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @game_exit(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void c_pomp_barrier_enter_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_barrier_enter_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double MAP_SINE(double x_n, int iteration) { return (sin(M_PI * x_n)); }


x86 assembly (clang, -O0):
<MAP_SINE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    0x2ec1(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAP_SINE>:
mov    0x2ed1(%rip),%rax
mulsd  (%rax),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @MAP_SINE(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* @M_PI
%6 = load double, double* %3
%7 = fmul double %5, %6
%8 = call double @sin(double %7)
ret double %8
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @MAP_SINE(double %0, i32 %1) {
%3 = load double, double* @M_PI
%4 = fmul double %3, %0
%5 = tail call double @sin(double %4)
ret double %5
}
void rop3_183_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_183_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_183_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_183_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_183_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_append_string_space(void *m, size_t size, char **s) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_append_string_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_string_space(i8* %0, i64 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8**
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_string_space(i8* nocapture readnone %0, i64 %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
int XProtocolRevision() {}


x86 assembly (clang, -O0):
<XProtocolRevision>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @XProtocolRevision() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XProtocolRevision() {
ret i32 undef
}
void asm_b_c(unsigned long *f, unsigned long i) {
  asm("btcq  %1, %0 \n" : : "m"(*f), "r"(i));
}


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

x86 assembly (clang, -O2):
<asm_b_c>:
btc    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @asm_b_c(i64* %0, i64 %1) {
tail call void asm sideeffect "btcq $1, $0 \0A", "*m,r,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1)
ret void
}
/* Variables and functions */
scalar_t__ isbadchar(char);
int countbadchar(char *p) {
  int i = 0;
  for (; *p; ++p)
    i += isbadchar(*p);
  return i;
}


x86 assembly (clang, -O0):
<countbadchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <countbadchar+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isbadchar@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <countbadchar+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countbadchar>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1147 <countbadchar+0x37>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isbadchar@plt>
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <countbadchar+0x20>
jmp    1149 <countbadchar+0x39>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @countbadchar(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = tail call i64 @isbadchar(i8 signext %5)
%9 = trunc i64 %8 to i32
%10 = add i32 %6, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int test_imm_7Euint32_mem(unsigned int *val) {
  return ((*val) & (0x7E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Euint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x7e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_7Euint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 126
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dateformat(char *);
int /*<<< orphan*/ monformat(char *, ...);
void test_other_formats() {
  char *str = "";
  monformat("", 1);
  monformat(str);
  dateformat("");
  dateformat(str);
}


x86 assembly (clang, -O0):
<test_other_formats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <monformat@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <monformat@plt>
lea    0xea8(%rip),%rdi
call   1040 <dateformat@plt>
mov    -0x8(%rbp),%rdi
call   1040 <dateformat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_other_formats>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <monformat@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <monformat@plt>
mov    %rbx,%rdi
call   1040 <dateformat@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <dateformat@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @test_other_formats() {
%1 = alloca i8*
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 (i8*, ...) @monformat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = load i8*, i8** %1
%4 = call i32 (i8*, ...) @monformat(i8* %3)
%5 = call i32 @dateformat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @dateformat(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @test_other_formats() {
%1 = tail call i32 (i8*, ...) @monformat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, ...) @monformat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @dateformat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @dateformat(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
int ep93xx_ide_acquire_gpio(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @ep93xx_ide_acquire_gpio(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_socket(int socket_descriptor) {
  if ((socket_descriptor = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    perror(
        "erreur : impossible de creer la socket de connexion avec le client.");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<create_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1176 <create_socket+0x46>
lea    0xe99(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_socket>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
test   %eax,%eax
js     1150 <create_socket+0x20>
pop    %rcx
ret
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [68 x i8] c"erreur : impossible de creer la socket de connexion avec le client.\00"
define i32 @create_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @AF_INET
%5 = load i32, i32* @SOCK_STREAM
%6 = call i32 @socket(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [68 x i8] c"erreur : impossible de creer la socket de connexion avec le client.\00"
define i32 @create_socket(i32 %0) {
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = tail call i32 @socket(i32 %2, i32 %3, i32 0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i32 undef
}
void dummy_reset_vector(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_reset_vector() {
ret void
}
void __simulator_nop(void) {}


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

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

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

LLVM IR (-O2):
define void @__simulator_nop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dxl_write_word(unsigned char, int, unsigned short);
void setMaxTorque(unsigned char id, unsigned short max) {
  dxl_write_word(id, (14), max);
}


x86 assembly (clang, -O0):
<setMaxTorque>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    $0xe,%esi
movzbl %al,%edi
movzwl -0x4(%rbp),%edx
call   1030 <dxl_write_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setMaxTorque>:
mov    %esi,%edx
mov    $0xe,%esi
jmp    1030 <dxl_write_word@plt>

LLVM IR (-O0):
define void @setMaxTorque(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = call i32 @dxl_write_word(i8 zeroext %5, i32 14, i16 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @setMaxTorque(i8 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @dxl_write_word(i8 zeroext %0, i32 14, i16 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CmdLO_Parse(int, char **);
int /*<<< orphan*/ configureOptions();
int main(int argc, char **argv) {
  configureOptions();
  CmdLO_Parse(argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <configureOptions@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <CmdLO_Parse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <configureOptions@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <CmdLO_Parse@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @configureOptions()
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @CmdLO_Parse(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @configureOptions()
%4 = tail call i32 @CmdLO_Parse(i32 %0, i8** %1)
ret i32 0
}
void mmemcpy(void *target, void *source, int bytecount) {}


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

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

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

LLVM IR (-O2):
define void @mmemcpy(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
int select_col3_by_row(int row) {
  return 9 * 9 * 3 + (row / (9 * 9 * 3)) * 9 * 3 +
         (row % (9 * 9 * 3)) % (9 * 9) / (9 * 3) * 9 + row % 9;
}


x86 assembly (clang, -O0):
<select_col3_by_row>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf3,%ecx
cltd
idiv   %ecx
imul   $0x9,%eax,%eax
imul   $0x3,%eax,%eax
add    $0xf3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x51,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0x9,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
add    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_col3_by_row>:
movslq %edi,%rax
imul   $0xffffffff86d90545,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0x7,%edx
add    %ecx,%edx
lea    (%rdx,%rdx,8),%ecx
lea    (%rcx,%rcx,2),%ecx
imul   $0xf3,%edx,%edx
mov    %eax,%esi
sub    %edx,%esi
movswl %si,%edx
imul   $0x6523,%edx,%edx
mov    %edx,%edi
shr    $0x1f,%edi
shr    $0x15,%edx
add    %edi,%edx
lea    (%rdx,%rdx,8),%edx
lea    (%rdx,%rdx,8),%edx
sub    %edx,%esi
movsbl %sil,%edx
lea    (%rdx,%rdx,8),%esi
lea    (%rdx,%rsi,2),%edx
movzwl %dx,%edx
movswl %dx,%esi
shr    $0xf,%edx
shr    $0x9,%esi
add    %dl,%sil
movzbl %sil,%edx
lea    (%rdx,%rdx,8),%edx
movsbl %dl,%edx
imul   $0x38e38e39,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x21,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,8),%esi
sub    %esi,%eax
add    %ecx,%eax
add    %edx,%eax
add    $0xf3,%eax
ret

LLVM IR (-O0):
define i32 @select_col3_by_row(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 243
%5 = mul nsw i32 %4, 9
%6 = mul nsw i32 %5, 3
%7 = add nsw i32 243, %6
%8 = load i32, i32* %2
%9 = srem i32 %8, 243
%10 = srem i32 %9, 81
%11 = sdiv i32 %10, 27
%12 = mul nsw i32 %11, 9
%13 = add nsw i32 %7, %12
%14 = load i32, i32* %2
%15 = srem i32 %14, 9
%16 = add nsw i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @select_col3_by_row(i32 %0) {
%2 = sdiv i32 %0, 243
%3 = mul nsw i32 %2, 27
%4 = srem i32 %0, 243
%5 = trunc i32 %4 to i16
%6 = srem i16 %5, 81
%7 = trunc i16 %6 to i8
%8 = sdiv i8 %7, 27
%9 = mul nsw i8 %8, 9
%10 = sext i8 %9 to i32
%11 = srem i32 %0, 9
%12 = add nsw i32 %11, 243
%13 = add nsw i32 %12, %3
%14 = add nsw i32 %13, %10
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ print_debug_char(unsigned char);
void print_debug_nibble(unsigned nibble) {
  unsigned char digit;
  digit = nibble + '0';
  if (digit > '9') {
    digit += 39;
  }
  print_debug_char(digit);
}


x86 assembly (clang, -O0):
<print_debug_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    113b <print_debug_nibble+0x2b>
movzbl -0x5(%rbp),%eax
add    $0x27,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <print_debug_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_nibble>:
lea    0x30(%rdi),%eax
add    $0x57,%dil
cmp    $0x3a,%al
movzbl %dil,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
movzbl %al,%edi
jmp    1030 <print_debug_char@plt>

LLVM IR (-O0):
define void @print_debug_nibble(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 48
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %8, 57
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = add nsw i32 %12, 39
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %15
15: ; preds = %10, %1
%16 = load i8, i8* %3
%17 = call i32 @print_debug_char(i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @print_debug_nibble(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
%4 = icmp ugt i8 %3, 57
%5 = add i8 %2, 87
%6 = select i1 %4, i8 %5, i8 %3
%7 = tail call i32 @print_debug_char(i8 zeroext %6)
ret void
}
void setWindowSize(int pty, int width, int height) {
  if (width > 0 && height > 0) {
  }
}


x86 assembly (clang, -O0):
<setWindowSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1126 <setWindowSize+0x26>
cmpl   $0x0,-0xc(%rbp)
jle    1126 <setWindowSize+0x26>
jmp    1126 <setWindowSize+0x26>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @setWindowSize(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* %5
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %13
13: ; preds = %12, %9, %3
ret void
}

LLVM IR (-O2):
define void @setWindowSize(i32 %0, i32 %1, i32 %2) {
ret void
}
double ProjZ(double trs[3][3], double x, double y, double f) {
  return ((trs)[2][0] * (x) + (trs)[2][1] * (y) + (trs)[2][2] * (f));
}


x86 assembly (clang, -O0):
<ProjZ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProjZ>:
mulsd  0x38(%rdi),%xmm1
mulsd  0x30(%rdi),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x40(%rdi),%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ProjZ([3 x double]* %0, double %1, double %2, double %3) {
%5 = alloca [3 x double]*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store [3 x double]* %0, [3 x double]** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load [3 x double]*, [3 x double]** %5
%10 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 2
%11 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 0
%12 = load double, double* %11
%13 = load double, double* %6
%14 = load [3 x double]*, [3 x double]** %5
%15 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 2
%16 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 1
%17 = load double, double* %16
%18 = load double, double* %7
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %12, double %13, double %19)
%21 = load [3 x double]*, [3 x double]** %5
%22 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 2
%23 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 2
%24 = load double, double* %23
%25 = load double, double* %8
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double %20)
ret double %26
}

LLVM IR (-O2):
define double @ProjZ([3 x double]* nocapture %0, double %1, double %2, double %3) {
%5 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%6 = load double, double* %5
%7 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%8 = load double, double* %7
%9 = fmul double %8, %2
%10 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %9)
%11 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%12 = load double, double* %11
%13 = tail call double @llvm.fmuladd.f64(double %12, double %3, double %10)
ret double %13
}
/* Variables and functions */
float quadIn(int, float, float, float);
float quadOut(float fraction, float start, float delta, float slope) {
  return quadIn(1 - fraction, start + delta, -delta, slope);
}


x86 assembly (clang, -O0):
<quadOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  0xecc(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <quadIn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadOut>:
movss  0xee8(%rip),%xmm4
subss  %xmm0,%xmm4
cvttss2si %xmm4,%edi
movaps %xmm1,%xmm0
addss  %xmm2,%xmm0
xorps  0xee2(%rip),%xmm2
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <quadIn@plt>

LLVM IR (-O0):
define float @quadOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = fsub float 1.000000e+00, %9
%11 = fptosi float %10 to i32
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fadd float %12, %13
%15 = load float, float* %7
%16 = fneg float %15
%17 = load float, float* %8
%18 = call float @quadIn(i32 %11, float %14, float %16, float %17)
ret float %18
}

LLVM IR (-O2):
define float @quadOut(float %0, float %1, float %2, float %3) {
%5 = fsub float 1.000000e+00, %0
%6 = fptosi float %5 to i32
%7 = fadd float %1, %2
%8 = fneg float %2
%9 = tail call float @quadIn(i32 %6, float %7, float %8, float %3)
ret float %9
}
/* Variables and functions */
int inportb(int);
int /*<<< orphan*/ outportb(int, char);
void putDebugChar(int ch) {
  while (!(inportb(0x3f8 + 5) & 0x20))
    ;
  outportb(0x3f8, (char)ch);
}


x86 assembly (clang, -O0):
<putDebugChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3fd,%edi
call   1030 <inportb@plt>
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114d <putDebugChar+0x2d>
jmp    1152 <putDebugChar+0x32>
jmp    112b <putDebugChar+0xb>
mov    -0x4(%rbp),%eax
mov    $0x3f8,%edi
movsbl %al,%esi
call   1040 <outportb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putDebugChar>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x3fd,%edi
call   1030 <inportb@plt>
test   $0x20,%al
je     1130 <putDebugChar+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1040 <outportb@plt>

LLVM IR (-O0):
define void @putDebugChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = call i32 @inportb(i32 1021)
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = trunc i32 %10 to i8
%12 = call i32 @outportb(i32 1016, i8 signext %11)
ret void
}

LLVM IR (-O2):
define void @putDebugChar(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @inportb(i32 1021)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = trunc i32 %0 to i8
%8 = tail call i32 @outportb(i32 1016, i8 signext %7)
ret void
}
/* Variables and functions */
int strlen(char const *);
__attribute__((always_)) const char *strarray_get_next_c(const char *current) {
  return current + strlen(current) + 1;
}


x86 assembly (clang, -O0):
<strarray_get_next_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strarray_get_next_c>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strarray_get_next_c(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 1
ret i8* %8
}

LLVM IR (-O2):
define i8* @strarray_get_next_c(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x48() {
  Assert_real((ispunct(72) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              365, ("ispunct should be 0 for H"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x48>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x16d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x48>:
push   %rax
mov    $0x48,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x16d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for H\00"
define void @t_ispunct_0x48() {
%1 = call i64 @ispunct(i32 72)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for H\00"
define void @t_ispunct_0x48() {
%1 = tail call i64 @ispunct(i32 72)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ send(int /*<<< orphan*/, int *, int, int /*<<< orphan*/);
void test_send() {
  int n = 0;
  send(0, &n, sizeof(int), 0);
  assert(n == 0);
}


x86 assembly (clang, -O0):
<test_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %ecx,%ecx
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
mov    %ecx,%edi
call   1030 <send@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_send>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
xor    %edi,%edi
cmpl   $0x0,0x4(%rsp)
sete   %dil
call   1040 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_send() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @send(i32 0, i32* %1, i32 4, i32 0)
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @test_send() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @send(i32 0, i32* %1, i32 4, i32 0)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}
unsigned short inw(unsigned short _port) {
  unsigned short data;
  asm volatile("inw %1, %0" : "=a"(data) : "Nd"(_port));
  return data;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
int implver();
int /*<<< orphan*/ printf(char *, int);
void get_libname(void) { printf("ev%d\n", implver() + 4); }


x86 assembly (clang, -O0):
<get_libname>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <implver@plt>
mov    %eax,%esi
add    $0x4,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_libname>:
push   %rax
xor    %eax,%eax
call   1030 <implver@plt>
lea    0x4(%rax),%esi
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ev%d\0A\00"
define void @get_libname() {
%1 = call i32 (...) @implver()
%2 = add nsw i32 %1, 4
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ev%d\0A\00"
define void @get_libname() {
%1 = tail call i32 (...) @implver()
%2 = add nsw i32 %1, 4
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
char EOF;
int /*<<< orphan*/ dec_bin(char);
char getchar();
int main() {
  char z;
  z = getchar();
  while (z != EOF) {
    if (z != '\n')
      dec_bin(z);
    z = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    0x2ea4(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1174 <main+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1165 <main+0x45>
movsbl -0x5(%rbp),%edi
call   1030 <dec_bin@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    1147 <main+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
je     1159 <main+0x39>
cmp    $0xa,%al
je     1140 <main+0x20>
movsbl %al,%edi
call   1030 <dec_bin@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %9
%5 = phi i8 [ %10, %9 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 10
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @dec_bin(i8 signext %5)
br label %9
9: ; preds = %7, %4
%10 = tail call signext i8 (...) @getchar()
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %9, %0
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mk_ipvers_opentype(uint8_t ipvers, uint8_t open_type) {
  return (open_type << 4) | ipvers;
}


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

x86 assembly (clang, -O2):
<mk_ipvers_opentype>:
mov    %esi,%eax
shl    $0x4,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @mk_ipvers_opentype(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 = shl i32 %5, 4
%7 = load i32, i32* %3
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @mk_ipvers_opentype(i32 %0, i32 %1) {
%3 = shl i32 %1, 4
%4 = or i32 %3, %0
ret i32 %4
}
void i18n_init(void) {}


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

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

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

LLVM IR (-O2):
define void @i18n_init() {
ret void
}