xunge/DecIR huggingface dataset:
int *f(int s, int *c) {
  int a1, a2, a3, *x1, *x2, *x3;
  a1 = 2 * s;
  x1 = c - a1;
  a2 = 4 * s;
  x2 = c - a2;
  a3 = 6 * s;
  x3 = c - a3;
  return x1 ? x2 : x3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
imul   $0x6,-0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1184 <f+0x84>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    118c <f+0x8c>
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x0(,%rdi,4),%eax
cltq
shl    $0x2,%rax
mov    %rsi,%rcx
sub    %rax,%rcx
add    %edi,%edi
lea    (%rdi,%rdi,2),%eax
cltq
neg    %rax
shl    $0x2,%rax
test   %rsi,%rsi
cmovne %rcx,%rax
ret

LLVM IR (-O0):
define i32* @f(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%11 = load i32, i32* %3
%12 = mul nsw i32 2, %11
store i32 %12, i32* %5
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = sub i64 0, %15
%17 = getelementptr inbounds i32, i32* %13, i64 %16
store i32* %17, i32** %8
%18 = load i32, i32* %3
%19 = mul nsw i32 4, %18
store i32 %19, i32* %6
%20 = load i32*, i32** %4
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds i32, i32* %20, i64 %23
store i32* %24, i32** %9
%25 = load i32, i32* %3
%26 = mul nsw i32 6, %25
store i32 %26, i32* %7
%27 = load i32*, i32** %4
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = sub i64 0, %29
%31 = getelementptr inbounds i32, i32* %27, i64 %30
store i32* %31, i32** %10
%32 = load i32*, i32** %8
%33 = icmp ne i32* %32, null
br i1 %33, label %34, label %36
34: ; preds = %2
%35 = load i32*, i32** %9
br label %38
36: ; preds = %2
%37 = load i32*, i32** %10
br label %38
38: ; preds = %36, %34
%39 = phi i32* [ %35, %34 ], [ %37, %36 ]
ret i32* %39
}

LLVM IR (-O2):
define i32* @f(i32 %0, i32* readnone %1) {
%3 = shl nsw i32 %0, 2
%4 = sext i32 %3 to i64
%5 = sub nsw i64 0, %4
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = mul nsw i32 %0, 6
%8 = sext i32 %7 to i64
%9 = sub nsw i64 0, %8
%10 = getelementptr inbounds i32, i32* null, i64 %9
%11 = icmp eq i32* %1, null
%12 = select i1 %11, i32* %10, i32* %6
ret i32* %12
}
int _mul(int x, int y, void *garb) { return x * y; }


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

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

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

LLVM IR (-O2):
define i32 @_mul(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = mul nsw i32 %1, %0
ret i32 %4
}
/* Type definitions */
struct parsed_params {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void quit_handler(struct parsed_params *params) {
  printf("bye. \n");
  exit(0);
}


x86 assembly (clang, -O0):
<quit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.parsed_params = type { i32 }
@.str = [7 x i8] c"bye. \0A\00"
define void @quit_handler(%struct.parsed_params* %0) {
%2 = alloca %struct.parsed_params*
store %struct.parsed_params* %0, %struct.parsed_params** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.parsed_params = type { i32 }
@str = [6 x i8] c"bye. \00"
define void @quit_handler(%struct.parsed_params* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int isPowerOf2(long long n) { return n && (!(n & (n - 1))); }


x86 assembly (clang, -O0):
<isPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1133 <isPowerOf2+0x33>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOf2>:
test   %rdi,%rdi
je     1112 <isPowerOf2+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOf2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 1
%9 = and i64 %6, %8
%10 = icmp ne i64 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isPowerOf2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int restore_weight(char weight) {
  int result;
  if ((result = (int)weight << 3) > 0)
    result += (result + 64) >> 7;
  return result;
}


x86 assembly (clang, -O0):
<restore_weight>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    112c <restore_weight+0x2c>
mov    -0x8(%rbp),%eax
add    $0x40,%eax
sar    $0x7,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_weight>:
lea    0x40(,%rdi,8),%eax
sar    $0x7,%eax
xor    %ecx,%ecx
test   %dil,%dil
cmovg  %eax,%ecx
lea    (%rcx,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @restore_weight(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = shl i32 %5, 3
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 64
%11 = ashr i32 %10, 7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
br label %14
14: ; preds = %8, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @restore_weight(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = shl nsw i32 %2, 3
%4 = icmp sgt i8 %0, 0
%5 = add nsw i32 %3, 64
%6 = ashr i32 %5, 7
%7 = select i1 %4, i32 %6, i32 0
%8 = add nsw i32 %7, %3
ret i32 %8
}
/* Variables and functions */
double const xsqrt_u05(double);
__attribute__((visibility("default"))) const double xsqrt_u35(double d) {
  return xsqrt_u05(d);
}


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

x86 assembly (clang, -O2):
<xsqrt_u35>:
jmp    1030 <xsqrt_u05@plt>

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

LLVM IR (-O2):
define double @xsqrt_u35(double %0) {
%2 = tail call double @xsqrt_u05(double %0)
ret double %2
}
int color_offset_f3(int x, int y) {
  return ((y << 10) + (((x << 10) * 201) / 39) - (18718 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0xc9,%eax,%eax
mov    $0x27,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0x1247800,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f3>:
shl    $0xa,%esi
imul   $0x32400,%edi,%eax
cltq
imul   $0xffffffffd20d20d3,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
add    %esi,%eax
add    $0xfedb8800,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f3(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, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 201
%10 = sdiv i32 %9, 39
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 19167232
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f3(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 205824
%5 = sdiv i32 %4, 39
%6 = add nsw i32 %5, -19167232
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
void rop3_49_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_49_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %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
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%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_49_1_0>:
not    %dl
mov    (%rdi),%al
and    %al,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_49_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = or i8 %6, %1
%8 = xor i8 %7, -1
%9 = and i8 %5, %1
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
int xmlUCSIsMusicalSymbols(int code) {
  return (((code >= 0x1D100) && (code <= 0x1D1FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsMusicalSymbols>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1d100,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsMusicalSymbols+0x26>
cmpl   $0x1d1ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsMusicalSymbols>:
and    $0xffffff00,%edi
xor    %eax,%eax
cmp    $0x1d100,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsMusicalSymbols(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 119040
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 119295
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsMusicalSymbols(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp eq i32 %2, 119040
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d\n", a & b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
and    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = and i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int pattern(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int b;
  scanf("%d", &b);
  int a = pattern(b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <pattern@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @pattern(i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int __infer_nondet_int();
int wctomb(char *s, wchar_t wc) { return __infer_nondet_int(); }


x86 assembly (clang, -O0):
<wctomb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @wctomb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @__infer_nondet_int()
ret i32 %5
}

LLVM IR (-O2):
define i32 @wctomb(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage: dump_psb [options]\n");
  printf("Options:\n");
  printf("  -n, --numpst     Set number of PST tables to scan\n");
  printf("  -r, --relevant   Only display PSTs relevant to cpuid N\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: dump_psb [options]\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [53 x i8] c" -n, --numpst Set number of PST tables to scan\0A\00"
@.str.3 = [58 x i8] c" -r, --relevant Only display PSTs relevant to cpuid N\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Usage: dump_psb [options]\00"
@str.4 = [9 x i8] c"Options:\00"
@str.5 = [52 x i8] c" -n, --numpst Set number of PST tables to scan\00"
@str.6 = [57 x i8] c" -r, --relevant Only display PSTs relevant to cpuid N\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void EXTI3_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @EXTI3_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @EXTI3_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ret_c(void) { op_write1(0xd8); }


x86 assembly (clang, -O0):
<op_enc_ret_c>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd8,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_ret_c>:
mov    $0xd8,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ret_c() {
%1 = call i32 @op_write1(i32 216)
ret void
}

LLVM IR (-O2):
define void @op_enc_ret_c() {
%1 = tail call i32 @op_write1(i32 216)
ret void
}
void handle_41(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_41(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int wcsncasecmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *, size_t);
int wcsncasecmp_l(const wchar_t *l, const wchar_t *r, size_t n,
                  locale_t locale) {
  return wcsncasecmp(l, r, n);
}


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

x86 assembly (clang, -O2):
<wcsncasecmp_l>:
jmp    1030 <wcsncasecmp@plt>

LLVM IR (-O0):
define i32 @wcsncasecmp_l(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i64, i64* %7
%12 = call i32 @wcsncasecmp(i32* %9, i32* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @wcsncasecmp_l(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = tail call i32 @wcsncasecmp(i32* %0, i32* %1, i64 %2)
ret i32 %5
}
/* Variables and functions */
double log(double);
double f1(double x) { return log(x) - 1; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xed1(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
call   1030 <log@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @f1(double %0) {
%2 = tail call double @log(double %0)
%3 = fadd double %2, -1.000000e+00
ret double %3
}
void led_caps(short state) {
  if (state)
    (*(volatile unsigned char *)(0xffffb3)) &= ~(1 << 7);
  else
    (*(volatile unsigned char *)(0xffffb3)) |= (1 << 7);
}


x86 assembly (clang, -O0):
<led_caps>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     1133 <led_caps+0x33>
mov    $0xffffb3,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0xffffff7f,%eax
mov    %al,%cl
mov    $0xffffb3,%eax
mov    %cl,(%rax)
jmp    114b <led_caps+0x4b>
mov    $0xffffb3,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x80,%eax
mov    %al,%cl
mov    $0xffffb3,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_caps>:
test   %di,%di
sete   %al
mov    0xffffb3,%cl
and    $0x7f,%cl
shl    $0x7,%al
or     %cl,%al
mov    %al,0xffffb3
ret

LLVM IR (-O0):
define void @led_caps(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = icmp ne i16 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 16777139 to i8*)
%7 = zext i8 %6 to i32
%8 = and i32 %7, -129
%9 = trunc i32 %8 to i8
store volatile i8 %9, i8* inttoptr (i64 16777139 to i8*)
br label %15
10: ; preds = %1
%11 = load volatile i8, i8* inttoptr (i64 16777139 to i8*)
%12 = zext i8 %11 to i32
%13 = or i32 %12, 128
%14 = trunc i32 %13 to i8
store volatile i8 %14, i8* inttoptr (i64 16777139 to i8*)
br label %15
15: ; preds = %10, %5
ret void
}

LLVM IR (-O2):
define void @led_caps(i16 signext %0) {
%2 = icmp eq i16 %0, 0
%3 = load volatile i8, i8* inttoptr (i64 16777139 to i8*)
%4 = and i8 %3, 127
%5 = select i1 %2, i8 -128, i8 0
%6 = or i8 %4, %5
store volatile i8 %6, i8* inttoptr (i64 16777139 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x33() {
  Assert_real((iscntrl(51) == 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_iscntrl.c",
              260, ("iscntrl should be 0 for 3"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x33>:
push   %rax
mov    $0x33,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x104,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for 3\00"
define void @t_iscntrl_0x33() {
%1 = call i64 @iscntrl(i32 51)
%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 260, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for 3\00"
define void @t_iscntrl_0x33() {
%1 = tail call i64 @iscntrl(i32 51)
%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 260, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int checker_read_long_long(int, char const *, int, long long *);
int checker_read_out_long_long(const char *name, int eof_error_flag,
                               long long *p_val) {
  return checker_read_long_long(1, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_out_long_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <checker_read_long_long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_out_long_long>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <checker_read_long_long@plt>

LLVM IR (-O0):
define i32 @checker_read_out_long_long(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i64*, i64** %6
%10 = call i32 @checker_read_long_long(i32 1, i8* %7, i32 %8, i64* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @checker_read_out_long_long(i8* %0, i32 %1, i64* %2) {
%4 = tail call i32 @checker_read_long_long(i32 1, i8* %0, i32 %1, i64* %2)
ret i32 %4
}
void initAnalogPins(void) {}


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

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

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

LLVM IR (-O2):
define void @initAnalogPins() {
ret void
}
/* Variables and functions */
void *deref_ptr(void **ptr) { return (((ptr)) ? (*(ptr)) : (NULL)); }


x86 assembly (clang, -O0):
<deref_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <deref_ptr+0x23>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    112e <deref_ptr+0x2e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    112e <deref_ptr+0x2e>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deref_ptr>:
test   %rdi,%rdi
je     1109 <deref_ptr+0x9>
mov    (%rdi),%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @deref_ptr(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int mygetline(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char s[1000];
  int lim = 1000;
  int ret;
  ret = mygetline(s, lim);
  printf("%s\n", s);
  printf("%d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    -0x3f4(%rbp),%esi
call   1040 <mygetline@plt>
mov    %eax,-0x3f8(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3f8(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <mygetline@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xea6(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @mygetline(i8* %2, i32 1000)
%4 = call i32 @puts(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef void uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void *_append_str(uint8_t *ptr, const char *str) {
  uint16_t len = strlen(str);
  memcpy(ptr, str, len);
  ptr += len;
  ((char *)ptr)[0] = '\0';
  return ++ptr;
}


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

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

LLVM IR (-O0):
define i8* @_append_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* %5
%13 = load i8*, i8** %3
%14 = sext i32 %12 to i64
%15 = getelementptr i8, i8* %13, i64 %14
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 0, i8* %17
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @_append_str(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %3)
%5 = sext i32 %3 to i64
%6 = getelementptr i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = getelementptr inbounds i8, i8* %6, i64 1
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ cgpublic(int /*<<< orphan*/);
int /*<<< orphan*/ gsym(char *);
void genpublic(char *name) { cgpublic(gsym(name)); }


x86 assembly (clang, -O0):
<genpublic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <gsym@plt>
mov    %eax,%edi
call   1030 <cgpublic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genpublic>:
push   %rax
call   1040 <gsym@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <cgpublic@plt>

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

LLVM IR (-O2):
define void @genpublic(i8* %0) {
%2 = tail call i32 @gsym(i8* %0)
%3 = tail call i32 @cgpublic(i32 %2)
ret void
}
void ls_cost_nm9_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_cost_nm9_incref() {
ret void
}
void fc245(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  goto a;
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc245(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %1
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %11
20: ; No predecessors!
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc245(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int test_imm_87uint8_reg(unsigned char val) {
  return ((val) & (0x87 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_87uint8_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, 135
%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_87uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -121
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char *, int, int /*<<< orphan*/);
int catAnetTcpConnect(char *err, char *addr, int port) {
  return anetTcpGenericConnect(err, addr, port, 0);
}


x86 assembly (clang, -O0):
<catAnetTcpConnect>:
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
xor    %ecx,%ecx
call   1030 <anetTcpGenericConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catAnetTcpConnect>:
xor    %ecx,%ecx
jmp    1030 <anetTcpGenericConnect@plt>

LLVM IR (-O0):
define i32 @catAnetTcpConnect(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @anetTcpGenericConnect(i8* %7, i8* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @catAnetTcpConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
void TCC_TurnOnVIQE() {}


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

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

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

LLVM IR (-O2):
define void @TCC_TurnOnVIQE() {
ret void
}
int INT(char CH) {
  int I;
  I = CH;
  if (I < 0)
    return (256 + I);
  return (I);
}


x86 assembly (clang, -O0):
<INT>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    112b <INT+0x2b>
mov    -0xc(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <INT+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<INT>:
lea    0x100(%rdi),%eax
test   %dil,%dil
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @INT(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 0
%4 = add nsw i32 %2, 256
%5 = select i1 %3, i32 %4, i32 %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ non_existent(int);
void hiphip(void (*f)()) {
  non_existent(2);
  f();
}


x86 assembly (clang, -O0):
<hiphip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <non_existent@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiphip>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
call   1030 <non_existent@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
define void @hiphip(void (...)* nocapture %0) {
%2 = tail call i32 @non_existent(i32 2)
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int is_prime(int n) {
  if (n < 2)
    printf("-1");
  else if (n % 2 == 0)
    printf("0");
  else
    printf("1");
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1136 <is_prime+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <is_prime+0x5c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115b <is_prime+0x4b>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1167 <is_prime+0x57>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <is_prime+0x5c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rax
cmp    $0x1,%edi
jg     1134 <is_prime+0x14>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
pop    %rcx
ret
test   $0x1,%dil
jne    1141 <is_prime+0x21>
mov    $0x30,%edi
jmp    1146 <is_prime+0x26>
mov    $0x31,%edi
call   1030 <putchar@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-1\00"
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %12
5: ; preds = %1
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @putchar(i32 48)
br label %12
10: ; preds = %5
%11 = tail call i32 @putchar(i32 49)
br label %12
12: ; preds = %8, %10, %3
ret i32 undef
}
/* Type definitions */
struct alloc_state {
  int dummy;
};

/* Variables and functions */
struct alloc_state *alloc_state_cache_exact(char *);
int /*<<< orphan*/ path_dirname(char const *, char *);
struct alloc_state *alloc_state_cache(const char *path) {
  char dirname[1024];
  path_dirname(path, dirname);
  return alloc_state_cache_exact(dirname);
}


x86 assembly (clang, -O0):
<alloc_state_cache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1030 <path_dirname@plt>
lea    -0x410(%rbp),%rdi
call   1040 <alloc_state_cache_exact@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_state_cache>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <path_dirname@plt>
mov    %rbx,%rdi
call   1040 <alloc_state_cache_exact@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.alloc_state = type { i32 }
define %struct.alloc_state* @alloc_state_cache(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @path_dirname(i8* %4, i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call %struct.alloc_state* @alloc_state_cache_exact(i8* %7)
ret %struct.alloc_state* %8
}

LLVM IR (-O2):
%struct.alloc_state = type { i32 }
define %struct.alloc_state* @alloc_state_cache(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @path_dirname(i8* %0, i8* %3)
%5 = call %struct.alloc_state* @alloc_state_cache_exact(i8* %3)
ret %struct.alloc_state* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ NOTICEREF;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ NOTICEREF_it;
int i2d_NOTICEREF(NOTICEREF *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &NOTICEREF_it);
}


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

x86 assembly (clang, -O2):
<i2d_NOTICEREF>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@NOTICEREF_it = global i32 0
define i32 @i2d_NOTICEREF(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @NOTICEREF_it)
ret i32 %7
}

LLVM IR (-O2):
@NOTICEREF_it = global i32 0
define i32 @i2d_NOTICEREF(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @NOTICEREF_it)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char msg[] = "Hello World from C language!\n";
  write(1, msg, sizeof(msg));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x14(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x1,%edi
mov    $0x1e,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef3(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
mov    $0x1e,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.msg = [30 x i8] c"Hello World from C language!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = bitcast [30 x i8]* %2 to i8*
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 @write(i32 1, i8* %4, i32 30)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [30 x i8] c"Hello World from C language!\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 1, i8* %2, i32 30)
ret i32 0
}