xunge/DecIR huggingface dataset:
/* Variables and functions */
int print(int, char *);
int bold(int tty) { return print(tty, "\033[1m"); }


x86 assembly (clang, -O0):
<bold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[1m\00"
define i32 @bold(i32 %0) {
%2 = tail call i32 @print(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Milliseconds();
int /*<<< orphan*/ Push(int /*<<< orphan*/);
void pMSECS() { Push(Milliseconds()); }


x86 assembly (clang, -O0):
<pMSECS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Milliseconds@plt>
mov    %eax,%edi
call   1030 <Push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pMSECS>:
push   %rax
xor    %eax,%eax
call   1040 <Milliseconds@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <Push@plt>

LLVM IR (-O0):
define void @pMSECS() {
%1 = call i32 (...) @Milliseconds()
%2 = call i32 @Push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @pMSECS() {
%1 = tail call i32 (...) @Milliseconds()
%2 = tail call i32 @Push(i32 %1)
ret void
}
/* Variables and functions */
float gammaln(float);
float betalog(float x, float y) {
  return gammaln(x) + gammaln(y) - gammaln(x + y);
}


x86 assembly (clang, -O0):
<betalog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <gammaln@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <gammaln@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
call   1030 <gammaln@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<betalog>:
sub    $0x18,%rsp
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0x14(%rsp)
call   1030 <gammaln@plt>
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <gammaln@plt>
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
call   1030 <gammaln@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @betalog(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call float @gammaln(float %5)
%7 = load float, float* %4
%8 = call float @gammaln(float %7)
%9 = fadd float %6, %8
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fadd float %10, %11
%13 = call float @gammaln(float %12)
%14 = fsub float %9, %13
ret float %14
}

LLVM IR (-O2):
define float @betalog(float %0, float %1) {
%3 = tail call float @gammaln(float %0)
%4 = tail call float @gammaln(float %1)
%5 = fadd float %3, %4
%6 = fadd float %0, %1
%7 = tail call float @gammaln(float %6)
%8 = fsub float %5, %7
ret float %8
}
/* Variables and functions */
double d_dim(double *, double *);
double intr_wrap_167(double p1, double p2) { return d_dim(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_167>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <d_dim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_167>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <d_dim@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @intr_wrap_167(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double @d_dim(double* %3, double* %4)
ret double %5
}

LLVM IR (-O2):
define double @intr_wrap_167(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double @d_dim(double* %3, double* %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void iface1_func3(void) { printf("A - version 0 func3\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"A - version 0 func3\00"
define void @iface1_func3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int *);
unsigned get_time_slice() {
  time_t t;
  time(&t);
  return t / 30;
}


x86 assembly (clang, -O0):
<get_time_slice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <time@plt>
mov    -0x4(%rbp),%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_slice>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <time@plt>
movslq 0x4(%rsp),%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_time_slice() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = load i32, i32* %1
%4 = sdiv i32 %3, 30
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_time_slice() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 30
ret i32 %5
}
char getch(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @getch() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @getch() {
ret i8 0
}
void op_code_normal_case0x49(void) {}


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

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

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

LLVM IR (-O2):
define void @op_code_normal_case0x49() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *appendtostring(char *str, int len) {
  char *res;
  if ((res = (char *)malloc(len + 1))) {
    strncpy(res, str, len);
    res[len] = '\0';
  }
  return res;
}


x86 assembly (clang, -O0):
<appendtostring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1164 <appendtostring+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appendtostring>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x1(%r14),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <appendtostring+0x31>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <strncpy@plt>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @appendtostring(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i32 @strncpy(i8* %5, i8* %0, i32 %1)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7, %2
ret i8* %5
}
void CheckInMainThread() {}


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

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

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

LLVM IR (-O2):
define void @CheckInMainThread() {
ret void
}
/* Variables and functions */
int sqrt(int);
int mySqrt(int x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<mySqrt>:
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define i32 @mySqrt(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t EPIWriteFIFOCountGet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x400D0000);
  return ((*((volatile uint32_t *)(ui32Base + 0x00000204))));
}


x86 assembly (clang, -O0):
<EPIWriteFIFOCountGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x204,%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIWriteFIFOCountGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x400d0000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x204(%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @EPIWriteFIFOCountGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074593792
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 516
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @EPIWriteFIFOCountGet(i32 %0) {
%2 = icmp eq i32 %0, 1074593792
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 516
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_quaddobl_estimated_distance(double *eta) {
  int fail;
  int precision = 2;
  int *b;
  fail = _ada_use_c2phc4c(887, &precision, b, eta, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_quaddobl_estimated_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x377,%edi
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_quaddobl_estimated_distance>:
push   %rax
mov    %rdi,%rcx
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x377,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_get_quaddobl_estimated_distance(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store double* %0, double** %2
store i32 2, i32* %4
%6 = load i32*, i32** %5
%7 = load double*, double** %2
%8 = call i32 @_ada_use_c2phc4c(i32 887, i32* %4, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @padcon_get_quaddobl_estimated_distance(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 887, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
/* Variables and functions */
void *calloc(unsigned int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int, char *);
int /*<<< orphan*/ stderr;
void *my_malloc(unsigned int size, char *rs) {
  void *buf = calloc(size, 1);
  if (size && !buf) {
    fprintf(stderr, "Error: Memory exceeded (%d for %s)!\n", size, rs);
    exit(2);
  }
  return buf;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     118b <my_malloc+0x5b>
cmpq   $0x0,-0x18(%rbp)
jne    118b <my_malloc+0x5b>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%esi
call   1030 <calloc@plt>
test   %ebp,%ebp
je     114b <my_malloc+0x1b>
test   %rax,%rax
je     1152 <my_malloc+0x22>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Error: Memory exceeded (%d for %s)!\0A\00"
define noalias i8* @my_malloc(i32 %0, i8* %1) {
%3 = tail call i8* @calloc(i32 %0, i32 1)
%4 = icmp eq i32 %0, 0
%5 = icmp ne i8* %3, null
%6 = or i1 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%10 = tail call i32 @exit(i32 2)
unreachable
11: ; preds = %2
ret i8* %3
}
int getLcm(int a, int b, int gcm) { return gcm * (a / gcm) * (b / gcm); }


x86 assembly (clang, -O0):
<getLcm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLcm>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
sub    %edx,%edi
mov    %esi,%eax
cltd
idiv   %ecx
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @getLcm(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = sdiv i32 %8, %9
%11 = mul nsw i32 %7, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sdiv i32 %12, %13
%15 = mul nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @getLcm(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %0, %2
%5 = sub i32 %0, %4
%6 = sdiv i32 %1, %2
%7 = mul nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x8c() {
  Assert_real((islower(140) == 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_islower.c",
              705, ("islower should be 0 for 0x8c"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x8c>:
push   %rax
mov    $0x8c,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2c1,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x8c\00"
define void @t_islower_0x8c() {
%1 = call i64 @islower(i32 140)
%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 705, i8* getelementptr inbounds ([29 x i8], [29 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x8c\00"
define void @t_islower_0x8c() {
%1 = tail call i64 @islower(i32 140)
%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 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_shuffle(struct genlist *);
void fc_sockaddr_list_shuffle(struct fc_sockaddr_list *tthis) {
  genlist_shuffle((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_shuffle>:
jmp    1030 <genlist_shuffle@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_shuffle(%struct.fc_sockaddr_list* %0) {
%2 = alloca %struct.fc_sockaddr_list*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %2
%3 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %2
%4 = bitcast %struct.fc_sockaddr_list* %3 to %struct.genlist*
%5 = call i32 @genlist_shuffle(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_shuffle(%struct.fc_sockaddr_list* %0) {
%2 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_shuffle(%struct.genlist* %2)
ret void
}
/* Variables and functions */
char toupper(char);
void motMaj(char mot[], const int taillemot) {
  int i = 0;
  for (i = 0; i < taillemot; i++) {
    mot[i] = toupper(mot[i]);
  }
}


x86 assembly (clang, -O0):
<motMaj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1165 <motMaj+0x55>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <motMaj+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motMaj>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <motMaj+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <motMaj+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @motMaj(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int strlength(char *str1) {
  int len = 0;
  while (str1[len] != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlength+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
struct ebpt_node {
  int dummy;
};
struct eb_root {
  int dummy;
};

/* Variables and functions */
struct ebpt_node *__ebim_lookup(struct eb_root *, void const *, unsigned int);
struct ebpt_node *ebim_lookup(struct eb_root *root, const void *x,
                              unsigned int len) {
  return __ebim_lookup(root, x, len);
}


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

x86 assembly (clang, -O2):
<ebim_lookup>:
jmp    1030 <__ebim_lookup@plt>

LLVM IR (-O0):
%struct.ebpt_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.ebpt_node* @ebim_lookup(%struct.eb_root* %0, i8* %1, i32 %2) {
%4 = alloca %struct.eb_root*
%5 = alloca i8*
%6 = alloca i32
store %struct.eb_root* %0, %struct.eb_root** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.eb_root*, %struct.eb_root** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call %struct.ebpt_node* @__ebim_lookup(%struct.eb_root* %7, i8* %8, i32 %9)
ret %struct.ebpt_node* %10
}

LLVM IR (-O2):
%struct.ebpt_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.ebpt_node* @ebim_lookup(%struct.eb_root* %0, i8* %1, i32 %2) {
%4 = tail call %struct.ebpt_node* @__ebim_lookup(%struct.eb_root* %0, i8* %1, i32 %2)
ret %struct.ebpt_node* %4
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int STDERR_FILENO;
int STDOUT_FILENO;
int /*<<< orphan*/ errno;
int _lseek(int file, int offset, int whence) {
  if ((STDOUT_FILENO == file) || (STDERR_FILENO == file)) {
    return 0;
  } else {
    errno = EBADF;
    return (long)-1;
  }
}


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2edc(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
je     1131 <_lseek+0x31>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    113d <_lseek+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1156 <_lseek+0x56>
mov    0x2e84(%rip),%rax
mov    (%rax),%ecx
mov    0x2e8b(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lseek>:
mov    0x2ee9(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
je     112f <_lseek+0x2f>
mov    0x2ebc(%rip),%rcx
cmp    %edi,(%rcx)
je     112f <_lseek+0x2f>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    0x2eb0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* @STDOUT_FILENO
%9 = load i32, i32* %5
%10 = icmp eq i32 %8, %9
br i1 %10, label %15, label %11
11: ; preds = %3
%12 = load i32, i32* @STDERR_FILENO
%13 = load i32, i32* %5
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11, %3
store i32 0, i32* %4
br label %18
16: ; preds = %11
%17 = load i32, i32* @EBADF
store i32 %17, i32* @errno
store i32 -1, i32* %4
br label %18
18: ; preds = %16, %15
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
@EBADF = global i32 0
@errno = global i32 0
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @STDOUT_FILENO
%5 = icmp eq i32 %4, %0
%6 = load i32, i32* @STDERR_FILENO
%7 = icmp eq i32 %6, %0
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = load i32, i32* @EBADF
store i32 %10, i32* @errno
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ -1, %9 ], [ 0, %3 ]
ret i32 %12
}
int test_imm_34int64_highword_reg(long long val) {
  return ((val >> 32) & (0x34 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_34int64_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, 52
%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_34int64_highword_reg(i64 %0) {
%2 = and i64 %0, 223338299392
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_2Fuint8_reg(unsigned char val) {
  return ((val) & (-0x2F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Fuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -47
%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_2Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -47
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ _str_malloc_mem(int);
char *_str_malloc(int size) {
  char *ptr = (char *)_str_malloc_mem(size);
  return ptr;
}


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

x86 assembly (clang, -O2):
<_str_malloc>:
jmp    1030 <_str_malloc_mem@plt>

LLVM IR (-O0):
define i8* @_str_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @_str_malloc_mem(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @_str_malloc(i32 %0) {
%2 = tail call i64 @_str_malloc_mem(i32 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
scalar_t__ clamp_u8(int /*<<< orphan*/);
uint32_t GetUYVY(int16_t y1, int16_t y2, int16_t u, int16_t v) {
  return (uint32_t)clamp_u8(u) << 24 | (uint32_t)clamp_u8(y1) << 16 |
         (uint32_t)clamp_u8(v) << 8 | (uint32_t)clamp_u8(y2);
}


x86 assembly (clang, -O0):
<GetUYVY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <clamp_u8@plt>
shl    $0x18,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <clamp_u8@plt>
mov    %rax,%rcx
mov    -0x1c(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <clamp_u8@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <clamp_u8@plt>
mov    %rax,%rcx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetUYVY>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <clamp_u8@plt>
mov    %rax,%rbx
shl    $0x18,%ebx
mov    %ebp,%edi
call   1030 <clamp_u8@plt>
mov    %rax,%rbp
shl    $0x10,%ebp
or     %ebx,%ebp
mov    %r15d,%edi
call   1030 <clamp_u8@plt>
mov    %rax,%rbx
shl    $0x8,%ebx
mov    %r14d,%edi
call   1030 <clamp_u8@plt>
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @GetUYVY(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = call i64 @clamp_u8(i32 %9)
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 24
%13 = load i32, i32* %5
%14 = call i64 @clamp_u8(i32 %13)
%15 = trunc i64 %14 to i32
%16 = shl i32 %15, 16
%17 = or i32 %12, %16
%18 = load i32, i32* %8
%19 = call i64 @clamp_u8(i32 %18)
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 8
%22 = or i32 %17, %21
%23 = load i32, i32* %6
%24 = call i64 @clamp_u8(i32 %23)
%25 = trunc i64 %24 to i32
%26 = or i32 %22, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @GetUYVY(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @clamp_u8(i32 %2)
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 24
%8 = tail call i64 @clamp_u8(i32 %0)
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 16
%11 = or i32 %10, %7
%12 = tail call i64 @clamp_u8(i32 %3)
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = tail call i64 @clamp_u8(i32 %1)
%17 = trunc i64 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
void gdk_x11_visual_get_xvisual() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_visual_get_xvisual() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello from the other proceeeeeeeessss\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Hello from the other proceeeeeeeessss\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"Hello from the other proceeeeeeeessss\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int int_least16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_int_least16_t(int_least16_t *const dest,
                                          int_least16_t const src) {
  return (((*dest) = src), true);
}


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

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

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_COPY_int_least16_t(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
store i32 %5, i32* %6
ret i32 1
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_int_least16_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
void __module_get(struct module *module) {
  { return; }
}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @__module_get(%struct.module* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
scalar_t__ setupterm(int /*<<< orphan*/ *, int /*<<< orphan*/, int *);
int /*<<< orphan*/ stdout;
int tigetnum(char *);
int termcolors(void) {
  int e;
  if (setupterm(NULL, fileno(stdout), &e)) {
    return 0;
  }
  return tigetnum("colors");
}


x86 assembly (clang, -O0):
<termcolors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edi
lea    -0x8(%rbp),%rdx
call   1030 <setupterm@plt>
cmp    $0x0,%rax
je     116b <termcolors+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    117a <termcolors+0x4a>
lea    0xe8e(%rip),%rdi
call   1050 <tigetnum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termcolors>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
xor    %ebx,%ebx
lea    0xc(%rsp),%rdx
xor    %edi,%edi
mov    %eax,%esi
call   1030 <setupterm@plt>
test   %rax,%rax
jne    1166 <termcolors+0x36>
lea    0xea1(%rip),%rdi
call   1050 <tigetnum@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"colors\00"
define i32 @termcolors() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @stdout
%4 = call i32 @fileno(i32 %3)
%5 = call i64 @setupterm(i32* null, i32 %4, i32* %2)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %10
8: ; preds = %0
%9 = call i32 @tigetnum(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"colors\00"
define i32 @termcolors() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @stdout
%4 = tail call i32 @fileno(i32 %3)
%5 = call i64 @setupterm(i32* null, i32 %4, i32* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @tigetnum(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %0, %7
%10 = phi i32 [ %8, %7 ], [ 0, %0 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setregid(int, int /*<<< orphan*/);
int setegid(gid_t gid) { return setregid(-1, gid); }


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

x86 assembly (clang, -O2):
<setegid>:
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <setregid@plt>

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

LLVM IR (-O2):
define i32 @setegid(i32 %0) {
%2 = tail call i32 @setregid(i32 -1, i32 %0)
ret i32 %2
}
int main(void) {
  int a;
  a = a;
  ++a;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void exit(int status) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <exit+0x7>

x86 assembly (clang, -O2):
<exit>:
jmp    1100 <exit>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Type definitions */
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_mqtt_prepend_header(struct mg_connection *, int,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void mg_mqtt_pong(struct mg_connection *nc) {
  mg_mqtt_prepend_header(nc, 13, 0, 0);
}


x86 assembly (clang, -O0):
<mg_mqtt_pong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <mg_mqtt_prepend_header@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_mqtt_pong>:
mov    $0xd,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <mg_mqtt_prepend_header@plt>

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

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_pong(%struct.mg_connection* %0) {
%2 = tail call i32 @mg_mqtt_prepend_header(%struct.mg_connection* %0, i32 13, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int x = 100;
  printf("dec = %d; octal = %o; hex = %x\n", x, x, x);
  printf("dec = %d; octal = %#o; hex = %#X\n", x, x, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"dec = %d; octal = %o; hex = %x\0A\00"
@.str.1 = [34 x i8] c"dec = %d; octal = %#o; hex = %#X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"dec = %d; octal = %o; hex = %x\0A\00"
@.str.1 = [34 x i8] c"dec = %d; octal = %#o; hex = %#X\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 100, i32 100, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 100, i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA_lc898122(int, unsigned char *);
void AccWit_lc898122(unsigned char UcTrgDat) {
  unsigned char UcFlgVal;
  UcFlgVal = 1;
  while (UcFlgVal) {
    RegReadA_lc898122(0x0282, &UcFlgVal);
    UcFlgVal &= UcTrgDat;
  };
}


x86 assembly (clang, -O0):
<AccWit_lc898122>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     114c <AccWit_lc898122+0x3c>
mov    $0x282,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA_lc898122@plt>
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x2(%rbp)
jmp    1122 <AccWit_lc898122+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccWit_lc898122>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movb   $0x1,0x7(%rsp)
lea    0x7(%rsp),%r14
mov    $0x282,%edi
mov    %r14,%rsi
call   1030 <RegReadA_lc898122@plt>
and    %bl,0x7(%rsp)
jne    1120 <AccWit_lc898122+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @AccWit_lc898122(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 1, i8* %3
br label %4
4: ; preds = %7, %1
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = call i32 @RegReadA_lc898122(i32 642, i8* %3)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = and i32 %12, %10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @AccWit_lc898122(i8 zeroext %0) {
%2 = alloca i8
store i8 1, i8* %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @RegReadA_lc898122(i32 642, i8* %2)
%5 = load i8, i8* %2
%6 = and i8 %5, %0
store i8 %6, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
unsigned int ___ia64_readl(void *addr) {
  return *(volatile unsigned int *)addr;
}


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

x86 assembly (clang, -O2):
<___ia64_readl>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @___ia64_readl(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
int main() {
  int x = 0;
  int y = 1;
  if (x ? 1 : 0)
    return 1;
  if (y ? 0 : 1)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1132 <main+0x32>
mov    $0x1,%al
test   $0x1,%al
jne    1141 <main+0x41>
jmp    114d <main+0x4d>
xor    %eax,%eax
test   $0x1,%al
jne    1141 <main+0x41>
jmp    114d <main+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1188 <main+0x88>
cmpl   $0x0,-0xc(%rbp)
je     1166 <main+0x66>
xor    %eax,%eax
test   $0x1,%al
jne    1175 <main+0x75>
jmp    1181 <main+0x81>
mov    $0x1,%al
test   $0x1,%al
jne    1175 <main+0x75>
jmp    1181 <main+0x81>
movl   $0x2,-0x4(%rbp)
jmp    1188 <main+0x88>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}