xunge/DecIR huggingface dataset:
float egRSqrt(float x) {
  long i;
  float y, r;
  y = x * 0.5f;
  i = *(long *)(&x);
  i = 0x5f3759df - (i >> 1);
  r = *(float *)(&i);
  r = r * (1.5f - r * r * y);
  return r;
}


x86 assembly (clang, -O0):
<egRSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f3759df,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe92(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @egRSqrt(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
%5 = alloca float
store float %0, float* %2
%6 = load float, float* %2
%7 = fmul float %6, 5.000000e-01
store float %7, float* %4
%8 = bitcast float* %2 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = ashr i64 %10, 1
%12 = sub nsw i64 1597463007, %11
store i64 %12, i64* %3
%13 = bitcast i64* %3 to float*
%14 = load float, float* %13
store float %14, float* %5
%15 = load float, float* %5
%16 = load float, float* %5
%17 = load float, float* %5
%18 = fmul float %16, %17
%19 = load float, float* %4
%20 = fneg float %18
%21 = call float @llvm.fmuladd.f32(float %20, float %19, float 1.500000e+00)
%22 = fmul float %15, %21
store float %22, float* %5
%23 = load float, float* %5
ret float %23
}

LLVM IR (-O2):
define float @egRSqrt(float %0) {
ret float poison
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *readline() {
  size_t nbytes = 2;
  char *line = NULL;
  ssize_t read = getline(&line, &nbytes, stdin);
  if (line[read - 1] == '\n') {
    line[read - 1] = '\0';
  }
  return line;
}


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x2,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <getline@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    116c <readline+0x5c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
sub    $0x18,%rsp
movq   $0x2,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <getline@plt>
mov    %eax,%ecx
mov    0x8(%rsp),%rax
movslq %ecx,%rcx
cmpb   $0xa,-0x1(%rcx,%rax,1)
jne    1159 <readline+0x49>
movb   $0x0,-0x1(%rax,%rcx,1)
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define i8* @readline() {
%1 = alloca i64
%2 = alloca i8*
%3 = bitcast i64* %1 to i8*
store i64 2, i64* %1
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = load i32, i32* @stdin
%6 = call i32 @getline(i8** %2, i64* %1, i32 %5)
%7 = load i8*, i8** %2
%8 = add nsw i32 %6, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %0
store i8 0, i8* %10
%14 = load i8*, i8** %2
br label %15
15: ; preds = %13, %0
%16 = phi i8* [ %14, %13 ], [ %7, %0 ]
ret i8* %16
}
/* Type definitions */
struct foo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ make_null(struct foo *);
int no(int i) {
  if (i == 0)
    make_null((struct foo *)0);
  return 1;
}


x86 assembly (clang, -O0):
<no>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112e <no+0x1e>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <make_null@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no>:
test   %edi,%edi
je     111a <no+0xa>
mov    $0x1,%eax
ret
push   %rax
xor    %edi,%edi
call   1030 <make_null@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.foo = type { i32 }
define i32 @no(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @make_null(%struct.foo* null)
br label %7
7: ; preds = %5, %1
ret i32 1
}

LLVM IR (-O2):
%struct.foo = type { i32 }
define i32 @no(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @make_null(%struct.foo* null)
br label %5
5: ; preds = %3, %1
ret i32 1
}
int test_imm_D8int16_mem(short *val) {
  return ((*val) & (0xD8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D8int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 216
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int clamp_to_range(int lo, int hi, int val) {
  return val <= lo ? lo : val <= hi ? val : hi;
}


x86 assembly (clang, -O0):
<clamp_to_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1124 <clamp_to_range+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp_to_range+0x47>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     113b <clamp_to_range+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp_to_range+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_to_range>:
mov    %esi,%eax
cmp    %esi,%edx
cmovle %edx,%eax
cmp    %edi,%edx
cmovle %edi,%eax
ret

LLVM IR (-O0):
define i32 @clamp_to_range(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 = icmp sle i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %22
12: ; preds = %3
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %5
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clamp_to_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %0
%5 = icmp sgt i32 %2, %1
%6 = select i1 %5, i32 %1, i32 %2
%7 = select i1 %4, i32 %6, i32 %0
ret i32 %7
}
unsigned xrop3_8_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D & stk3;
  stk1 = S & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_8_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_8_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
long long _mpy32su(int src1, unsigned int src2) {
  return ((long long)src1) * ((int)src2);
}


x86 assembly (clang, -O0):
<_mpy32su>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpy32su>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @_mpy32su(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @_mpy32su(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = mul nsw i64 %4, %3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(char *, char *);
void diag(char *s, char *arg) {
  msg(s, arg);
  exit(1);
}


x86 assembly (clang, -O0):
<diag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<diag>:
push   %rax
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @diag(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @msg(i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @diag(i8* %0, i8* %1) {
%3 = tail call i32 @msg(i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void slashcharclass2NHWHITESPACE() {}


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

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

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

LLVM IR (-O2):
define void @slashcharclass2NHWHITESPACE() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ heap_sort(int *, int);
int main() {
  int array[] = {16, 14, 10, 8, 7, 9, 3, 2, 4, 1};
  int size = sizeof(array) / sizeof(array[0]);
  heap_sort(array, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <heap_sort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <heap_sort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 16, i32 14, i32 10, i32 8, i32 7, i32 9, i32 3, i32 2, i32 4, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
store i32 10, i32* %3
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @heap_sort(i32* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 16, i32 14, i32 10, i32 8, i32 7, i32 9, i32 3, i32 2, i32 4, i32 1]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @heap_sort(i32* %3, i32 10)
ret i32 0
}
double sense_amp_delay(inrisetime, outrisetime)
double inrisetime, *outrisetime;
{
  *outrisetime = 7e-10;
  return (5.8e-10);
}


x86 assembly (clang, -O0):
<sense_amp_delay>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  0xedb(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sense_amp_delay>:
movabs $0x3e080d43de9cc603,%rax
0d 08 3e
mov    %rax,(%rdi)
movsd  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sense_amp_delay(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double*, double** %4
store double 0x3E080D43DE9CC603, double* %5
ret double 0x3E03EDBBE4560327
}

LLVM IR (-O2):
define double @sense_amp_delay(double %0, double* nocapture writeonly %1) {
store double 0x3E080D43DE9CC603, double* %1
ret double 0x3E03EDBBE4560327
}
int xfermem_getcmd(int fd, int block) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xfermem_getcmd(i32 %0, i32 %1) {
ret i32 0
}
void foo155() {}


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

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

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

LLVM IR (-O2):
define void @foo155() {
ret void
}
unsigned xrop3_23_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk2 = S ^ T;
  stk3 = D ^ S;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_23_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_23_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
xor    %ecx,%edx
mov    %ecx,%eax
xor    $0xff,%eax
and    %edx,%eax
xor    %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_23_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %9
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = xor i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = and i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = xor i32 %35, -1
store i32 %36, i32* %8
%37 = load i32, i32* %8
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_23_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, %4
%8 = xor i32 %4, 255
%9 = and i32 %7, %8
%10 = xor i32 %4, %9
%11 = xor i32 %10, -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __poet_fail();
int main() {
  int x = 10;
  if (x < 5)
    __poet_fail();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1137 <main+0x27>
mov    $0x0,%al
call   1030 <__poet_fail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @__poet_fail()
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sig_handler(int signo) { printf("catch the signal SIGINT %d\n", signo); }


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

x86 assembly (clang, -O2):
<sig_handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"catch the signal SIGINT %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"catch the signal SIGINT %d\0A\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
int /*<<< orphan*/ strncasecmp(char const *, char const *, scalar_t__);
int checkbegin(const char *response, const char *pattern) {
  if (strlen(response) < strlen(pattern)) {
    return 0;
  }
  return !strncasecmp(response, pattern, strlen(pattern));
}


x86 assembly (clang, -O0):
<checkbegin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    1162 <checkbegin+0x42>
movl   $0x0,-0x4(%rbp)
jmp    119b <checkbegin+0x7b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
call   1040 <strncasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkbegin>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rbx
jl     1159 <checkbegin+0x39>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strncasecmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @checkbegin(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
%10 = icmp slt i64 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %21
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %5
%16 = call i64 @strlen(i8* %15)
%17 = call i32 @strncasecmp(i8* %13, i8* %14, i64 %16)
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
store i32 %20, i32* %3
br label %21
21: ; preds = %12, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @checkbegin(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp slt i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %4)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int no;
  printf("请输入一个整数：");
  scanf("%d", &no);
  printf("该整数减去10的结果是%d\n", no - 10);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\EF\BC\9A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E5\87\8F\E5\8E\BB10\E7\9A\84\E7\BB\93\E6\9E\9C\E6\98\AF%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 10
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\EF\BC\9A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E5\87\8F\E5\8E\BB10\E7\9A\84\E7\BB\93\E6\9E\9C\E6\98\AF%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -10
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ event_loop_exit(int /*<<< orphan*/ *);
void mgmt_ipc_close(int fd) {
  event_loop_exit(NULL);
  if (fd >= 0)
    close(fd);
}


x86 assembly (clang, -O0):
<mgmt_ipc_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <event_loop_exit@plt>
cmpl   $0x0,-0x4(%rbp)
jl     1146 <mgmt_ipc_close+0x26>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgmt_ipc_close>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <event_loop_exit@plt>
test   %ebx,%ebx
js     1136 <mgmt_ipc_close+0x16>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @mgmt_ipc_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @event_loop_exit(i32* null)
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @mgmt_ipc_close(i32 %0) {
%2 = tail call i32 @event_loop_exit(i32* null)
%3 = icmp sgt i32 %0, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
int ReverseNumber(int num) {
  int rev = 0;
  while (num != 0) {
    rev = rev * 10;
    rev = rev + num % 10;
    num = num / 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<ReverseNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114b <ReverseNumber+0x4b>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <ReverseNumber+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseNumber>:
xor    %eax,%eax
test   %edi,%edi
je     113f <ReverseNumber+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <ReverseNumber+0x10>
ret

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

LLVM IR (-O2):
define i32 @ReverseNumber(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
void UART3_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UART3_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART3_Handler+0x9>
jmp    1109 <UART3_Handler+0x9>

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

LLVM IR (-O0):
define void @UART3_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UART3_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int main() {
  int x, *p;
  x = 1;
  p = &x;
  *p = 0;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%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 1, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
store i32 0, i32* %4
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_add(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
scalar_t__ mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_tdiv_r(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void positive_modulo(mpz_t results, mpz_t a, mpz_t modulo) {
  mpz_t zero_value;
  mpz_init(zero_value);
  mpz_tdiv_r(results, a, modulo);
  if (mpz_cmp(results, zero_value) < 0)
    mpz_add(results, results, modulo);
}


x86 assembly (clang, -O0):
<positive_modulo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <mpz_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <mpz_tdiv_r@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1060 <mpz_cmp@plt>
cmp    $0x0,%rax
jge    118a <positive_modulo+0x4a>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <mpz_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<positive_modulo>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <mpz_init@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <mpz_tdiv_r@plt>
mov    %ebp,%edi
call   1060 <mpz_cmp@plt>
test   %rax,%rax
js     116d <positive_modulo+0x2d>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <mpz_add@plt>

LLVM IR (-O0):
define void @positive_modulo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %7
%9 = call i32 @mpz_init(i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @mpz_tdiv_r(i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %7
%16 = call i64 @mpz_cmp(i32 %14, i32 %15)
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %3
%19 = load i32, i32* %4
%20 = load i32, i32* %4
%21 = load i32, i32* %6
%22 = call i32 @mpz_add(i32 %19, i32 %20, i32 %21)
br label %23
23: ; preds = %18, %3
ret void
}

LLVM IR (-O2):
define void @positive_modulo(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_init(i32 undef)
%5 = tail call i32 @mpz_tdiv_r(i32 %0, i32 %1, i32 %2)
%6 = tail call i64 @mpz_cmp(i32 %0, i32 undef)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @mpz_add(i32 %0, i32 %0, i32 %2)
br label %10
10: ; preds = %8, %3
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
extern int not_exist(char *f) {
  struct stat info;
  return (stat(f, &info) == -1);
}


x86 assembly (clang, -O0):
<not_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @not_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @not_exist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
int sched_wakeup() {}


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

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

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

LLVM IR (-O2):
define i32 @sched_wakeup() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ local_error(char *);
int main() { local_error("This is an error message"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"This is an error message\00"
define i32 @main() {
%1 = call i32 @local_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"This is an error message\00"
define i32 @main() {
%1 = tail call i32 @local_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *mem_malloc_func(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *mem_calloc2(size_t nmemb, size_t size) {
  register void *mem;
  size *= nmemb;
  mem = mem_malloc_func(size);
  if (mem != 0)
    memset(mem, 0, size);
  return mem;
}


x86 assembly (clang, -O0):
<mem_calloc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mem_malloc_func@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <mem_calloc2+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_calloc2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <mem_malloc_func@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <mem_calloc2+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mem_calloc2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %7, %6
store i64 %8, i64* %4
%9 = load i64, i64* %4
%10 = call i8* @mem_malloc_func(i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = call i32 @memset(i8* %14, i32 0, i64 %15)
br label %17
17: ; preds = %13, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @mem_calloc2(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @mem_malloc_func(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
unsigned char clamp(int i) {
  if (i < 0)
    return 0;
  else if (i > 255)
    return 255;
  else
    return i;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111a <clamp+0x1a>
movb   $0x0,-0x1(%rbp)
jmp    1136 <clamp+0x36>
cmpl   $0xff,-0x8(%rbp)
jle    1130 <clamp+0x30>
movb   $0xff,-0x1(%rbp)
jmp    1136 <clamp+0x36>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @clamp(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = trunc i32 %5 to i8
ret i8 %6
}
int fun600() { return 600; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x258,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x258,%eax
ret

LLVM IR (-O0):
define i32 @fun600() {
ret i32 600
}

LLVM IR (-O2):
define i32 @fun600() {
ret i32 600
}
void gtk_about_dialog_set_copyright() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_set_copyright() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stringReverse(char *);
int main(int argc, char const *argv[]) {
  char *str = "hello dada";
  printf("%s\n", str);
  stringReverse(str);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <stringReverse@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <stringReverse@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"hello dada\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @stringReverse(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int S_precomp(int);
double sqrt(int);
double Sij_precomp(int spec_i, int spec_j) {
  return sqrt(S_precomp(spec_i) * S_precomp(spec_j));
}


x86 assembly (clang, -O0):
<Sij_precomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <S_precomp@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <S_precomp@plt>
mov    -0xc(%rbp),%edi
imul   %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sij_precomp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <S_precomp@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <S_precomp@plt>
imul   %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @Sij_precomp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @S_precomp(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @S_precomp(i32 %7)
%9 = mul nsw i32 %6, %8
%10 = call double @sqrt(i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @Sij_precomp(i32 %0, i32 %1) {
%3 = tail call i32 @S_precomp(i32 %0)
%4 = tail call i32 @S_precomp(i32 %1)
%5 = mul nsw i32 %4, %3
%6 = tail call double @sqrt(i32 %5)
ret double %6
}
/* Variables and functions */
int fibo(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fibo(40));
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *get_rfc3526_prime_6144(int /*<<< orphan*/ *);
BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn) {
  return get_rfc3526_prime_6144(bn);
}


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

x86 assembly (clang, -O2):
<BN_get_rfc3526_prime_6144>:
jmp    1030 <get_rfc3526_prime_6144@plt>

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

LLVM IR (-O2):
define i32* @BN_get_rfc3526_prime_6144(i32* %0) {
%2 = tail call i32* @get_rfc3526_prime_6144(i32* %0)
ret i32* %2
}
int num_datadir() { return 3; }


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

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

LLVM IR (-O0):
define i32 @num_datadir() {
ret i32 3
}

LLVM IR (-O2):
define i32 @num_datadir() {
ret i32 3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ scanline_pad;
};
typedef TYPE_1__ XPixmapFormatValues;

/* Variables and functions */
int get_XPixmapFormatValues_scanline_pad(void *_p) {
  return (int)((XPixmapFormatValues *)_p)->scanline_pad;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XPixmapFormatValues_scanline_pad(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *xstrdup(const char *p) {
  char *ret = xmalloc(strlen(p) + 1);
  strcpy(ret, p);
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}