xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char *, char);
char *chomp(char *str) {
  char *pnt;
  if ((pnt = strrchr(str, '\n')) != NULL) {
    *pnt = 0;
  }
  if ((pnt = strrchr(str, '\r')) != NULL) {
    *pnt = 0;
  }
  return str;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     113f <chomp+0x2f>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1162 <chomp+0x52>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1126 <chomp+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     113b <chomp+0x2b>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @chomp(i8* returned %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 13)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i8 0, i8* %6
br label %9
9: ; preds = %8, %5
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void POP_CS() {
  ;
  _c_setbyte(0x0f);
  ;
}


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

x86 assembly (clang, -O2):
<POP_CS>:
mov    $0xf,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @POP_CS() {
%1 = call i32 @_c_setbyte(i32 15)
ret void
}

LLVM IR (-O2):
define void @POP_CS() {
%1 = tail call i32 @_c_setbyte(i32 15)
ret void
}
int vby_skip(char *buf) {
  unsigned int ret = 1;
  int nb = 0;
  while (1) {
    if (!(buf[nb++] & 0x80)) {
      return ret;
    }
    ret++;
  }
}


x86 assembly (clang, -O0):
<vby_skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    113f <vby_skip+0x3f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <vby_skip+0x16>

x86 assembly (clang, -O2):
<vby_skip>:
mov    $0x1,%eax
cmpb   $0x0,(%rdi)
jns    111a <vby_skip+0x1a>
mov    $0x1,%eax
nop
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
js     1110 <vby_skip+0x10>
ret

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

LLVM IR (-O2):
define i32 @vby_skip(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 1, %1 ], [ %10, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %9, %6 ], [ 0, %1 ]
%8 = phi i32 [ %10, %6 ], [ 1, %1 ]
%9 = add nuw nsw i64 %7, 1
%10 = add nuw i32 %8, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = icmp sgt i8 %12, -1
br i1 %13, label %4, label %6
}
int test_imm_D3uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xD3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D3uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 906238099456
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int dummy() {
  static int d = 0;
  return d++;
}


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@dummy.d = internal global i32 0
define i32 @dummy() {
%1 = load i32, i32* @dummy.d
%2 = add nsw i32 %1, 1
store i32 %2, i32* @dummy.d
ret i32 %1
}

LLVM IR (-O2):
@dummy.d = internal unnamed_addr global i32 0
define i32 @dummy() {
%1 = load i32, i32* @dummy.d
%2 = add nsw i32 %1, 1
store i32 %2, i32* @dummy.d
ret i32 %1
}
void vPortYieldProcessor(void) { return; }


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

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

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

LLVM IR (-O2):
define void @vPortYieldProcessor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xapic_write(int, int);
void enable_apic(void) {
  printf("enabling apic\n");
  xapic_write(0xf0, 0x1ff);
}


x86 assembly (clang, -O0):
<enable_apic>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xf0,%edi
mov    $0x1ff,%esi
call   1040 <xapic_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_apic>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xf0,%edi
mov    $0x1ff,%esi
pop    %rax
jmp    1040 <xapic_write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"enabling apic\0A\00"
define void @enable_apic() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @xapic_write(i32 240, i32 511)
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"enabling apic\00"
define void @enable_apic() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @xapic_write(i32 240, i32 511)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ pow5bits(int /*<<< orphan*/ const);
int32_t ceil_log2pow5(const int32_t e) { return pow5bits(e); }


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

x86 assembly (clang, -O2):
<ceil_log2pow5>:
jmp    1030 <pow5bits@plt>

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

LLVM IR (-O2):
define i32 @ceil_log2pow5(i32 %0) {
%2 = tail call i32 @pow5bits(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ hashpipe_ipckey(int);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
key_t hashpipe_databuf_key(int instance_id) {
  key_t key = ((key_t)-1);
  char *databuf_key = getenv("HASHPIPE_DATABUF_KEY");
  if (databuf_key) {
    key = strtoul(databuf_key, NULL, 0);
  } else {
    key = hashpipe_ipckey((instance_id & 0x3f) | 0x80);
  }
  return key;
}


x86 assembly (clang, -O0):
<hashpipe_databuf_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1174 <hashpipe_databuf_key+0x44>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1050 <strtoul@plt>
mov    %eax,-0x8(%rbp)
jmp    1188 <hashpipe_databuf_key+0x58>
mov    -0x4(%rbp),%edi
and    $0x3f,%edi
or     $0x80,%edi
call   1040 <hashpipe_ipckey@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashpipe_databuf_key>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1151 <hashpipe_databuf_key+0x21>
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rbx
jmp    1050 <strtoul@plt>
and    $0x3f,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <hashpipe_ipckey@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"HASHPIPE_DATABUF_KEY\00"
define i32 @hashpipe_databuf_key(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 -1, i32* %3
%5 = call i8* @getenv(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %4
%10 = call i32 @strtoul(i8* %9, i32* null, i32 0)
store i32 %10, i32* %3
br label %16
11: ; preds = %1
%12 = load i32, i32* %2
%13 = and i32 %12, 63
%14 = or i32 %13, 128
%15 = call i32 @hashpipe_ipckey(i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [21 x i8] c"HASHPIPE_DATABUF_KEY\00"
define i32 @hashpipe_databuf_key(i32 %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @strtoul(i8* nocapture %2, i32* null, i32 0)
br label %10
6: ; preds = %1
%7 = and i32 %0, 63
%8 = or i32 %7, 128
%9 = tail call i32 @hashpipe_ipckey(i32 %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
void swap(int *x, int *y) {
  int aux = *x;
  *x = *y;
  *y = aux;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
float QSqrt(const float number) {
  const float x2 = number * 0.5f;
  float y = number;
  long i = *(long *)&y;
  i = (0x5f375a86) - (i >> 1);
  y = *(float *)&i;
  y = y * ((1.5f) - (x2 * y * y));
  return y;
}


x86 assembly (clang, -O0):
<QSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f375a86,%eax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe88(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @QSqrt(float %0) {
ret float poison
}
void ff_hevc_put_hevc_qpel_v48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v48_10_sse4() {
ret void
}
/* Variables and functions */
unsigned char *perturbation_number_location(unsigned char **);
int perturbation_number(unsigned char **sec) {
  unsigned char *p;
  p = perturbation_number_location(sec);
  if (p)
    return (int)*p;
  return -1;
}


x86 assembly (clang, -O0):
<perturbation_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <perturbation_number_location@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1143 <perturbation_number+0x33>
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <perturbation_number+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perturbation_number>:
push   %rax
call   1030 <perturbation_number_location@plt>
test   %rax,%rax
je     1120 <perturbation_number+0x10>
movzbl (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @perturbation_number(i8** %0) {
%2 = tail call i8* @perturbation_number_location(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strbuf_complete(struct strbuf *, char);
void strbuf_complete_line(struct strbuf *sb) { strbuf_complete(sb, '\n'); }


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

x86 assembly (clang, -O2):
<strbuf_complete_line>:
mov    $0xa,%esi
jmp    1030 <strbuf_complete@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define void @strbuf_complete_line(%struct.strbuf* %0) {
%2 = alloca %struct.strbuf*
store %struct.strbuf* %0, %struct.strbuf** %2
%3 = load %struct.strbuf*, %struct.strbuf** %2
%4 = call i32 @strbuf_complete(%struct.strbuf* %3, i8 signext 10)
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define void @strbuf_complete_line(%struct.strbuf* %0) {
%2 = tail call i32 @strbuf_complete(%struct.strbuf* %0, i8 signext 10)
ret void
}
/* Variables and functions */
int socket(int, int, int);
int /*<<< orphan*/ unix_error(char *);
int csapp_socket(int domain, int type, int protocol) {
  int rc;
  if ((rc = socket(domain, type, protocol)) < 0)
    unix_error("socket error");
  return rc;
}


x86 assembly (clang, -O0):
<csapp_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1157 <csapp_socket+0x37>
lea    0xeae(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csapp_socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <csapp_socket+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"socket error\00"
define i32 @csapp_socket(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* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@.str = [13 x i8] c"socket error\00"
define i32 @csapp_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: tcp source target\n");
  printf("Copy the contents of the source to target\n");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: tcp source target\0A\00"
@.str.1 = [43 x i8] c"Copy the contents of the source to target\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Usage: tcp source target\00"
@str.2 = [42 x i8] c"Copy the contents of the source to target\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.2, i64 0, i64 0))
ret void
}
__attribute__((no)) int order2(int y, int x) { return x < y ? 2 : 4; }


x86 assembly (clang, -O0):
<order2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%esi
mov    $0x4,%eax
mov    $0x2,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<order2>:
xor    %eax,%eax
cmp    %edi,%esi
setge  %al
add    %eax,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @order2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 2, i32 4
ret i32 %9
}

LLVM IR (-O2):
define i32 @order2(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 2, i32 4
ret i32 %4
}
void aliyun_iot_common_log_release() {}


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

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

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

LLVM IR (-O2):
define void @aliyun_iot_common_log_release() {
ret void
}
int test_imm_83uint8_mem(unsigned char *val) {
  return ((*val) & (-0x83 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_83uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -131
%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_83uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 125
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
};
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void _gettimer(struct timespec *ts, unsigned int sec) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  ts->tv_nsec = 0;
  ts->tv_sec = tv.tv_sec + sec;
}


x86 assembly (clang, -O0):
<_gettimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%eax
add    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gettimer>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movq   $0x0,0x8(%rbx)
mov    %ebp,%eax
add    (%rsp),%rax
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
%struct.timeval = type { i64 }
define void @_gettimer(%struct.timespec* %0, i32 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i32
%5 = alloca %struct.timeval
store %struct.timespec* %0, %struct.timespec** %3
store i32 %1, i32* %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = load %struct.timespec*, %struct.timespec** %3
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%10 = load i64, i64* %9
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = add nsw i64 %10, %12
%14 = load %struct.timespec*, %struct.timespec** %3
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 0
store i64 %13, i64* %15
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
%struct.timeval = type { i64 }
define void @_gettimer(%struct.timespec* nocapture writeonly %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%8 = load i64, i64* %7
%9 = zext i32 %1 to i64
%10 = add nsw i64 %8, %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i64 %10, i64* %11
ret void
}
void *return_arg(void *p) { return p; }


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

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

LLVM IR (-O0):
define i8* @return_arg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @return_arg(i8* readnone returned %0) {
ret i8* %0
}
int execute_faccessat() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_faccessat() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_faccessat() {
ret i32 0
}
int do_962() { return 962; }


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

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

LLVM IR (-O0):
define i32 @do_962() {
ret i32 962
}

LLVM IR (-O2):
define i32 @do_962() {
ret i32 962
}
int septlen(int origsize) {
  if (origsize / 7 == 1)
    return origsize;
  else
    return origsize - (origsize / 7);
}


x86 assembly (clang, -O0):
<septlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x1,%eax
jne    1126 <septlen+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <septlen+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<septlen>:
mov    %edi,%eax
lea    -0x7(%rax),%ecx
cmp    $0x7,%ecx
jb     1128 <septlen+0x28>
movslq %eax,%rcx
imul   $0x6db6db6d,%rcx,%rcx
shr    $0x20,%rcx
sub    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
add    %eax,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @septlen(i32 %0) {
%2 = add i32 %0, -7
%3 = icmp ult i32 %2, 7
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = sdiv i32 %0, -7
%6 = add i32 %5, %0
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ %0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x38_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x38_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x38_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x38_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x38_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void kgsl_cffdump_close(struct kgsl_device *device) { return; }


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

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

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

LLVM IR (-O2):
%struct.kgsl_device = type opaque
define void @kgsl_cffdump_close(%struct.kgsl_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t get_s8(const void *ptr) { return *((int8_t *)ptr); }


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

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

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

LLVM IR (-O2):
define i32 @get_s8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
unsigned int bam_swap_endian_4(unsigned int);
void *bam_swap_endian_4p(void *x) {
  *(unsigned int *)x = bam_swap_endian_4(*(unsigned int *)x);
  return x;
}


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

x86 assembly (clang, -O2):
<bam_swap_endian_4p>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <bam_swap_endian_4@plt>
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @bam_swap_endian_4p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @bam_swap_endian_4(i32 %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @bam_swap_endian_4p(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @bam_swap_endian_4(i32 %3)
store i32 %4, i32* %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ _libc_exit_func(int);
void _Exit(int status) { _libc_exit_func(status); }


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_libc_exit_func@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rax
call   1030 <_libc_exit_func@plt>

LLVM IR (-O0):
define void @_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_libc_exit_func(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 @_libc_exit_func(i32 %0)
unreachable
}
/* Type definitions */
struct dns_rr_txt {
  int dummy;
};
struct dns_ctx {
  int dummy;
};

/* Variables and functions */
scalar_t__ dns_resolve(struct dns_ctx *, int /*<<< orphan*/);
int /*<<< orphan*/ dns_submit_rhsbl_txt(struct dns_ctx *, char const *,
                                        char const *, int /*<<< orphan*/,
                                        int /*<<< orphan*/);
struct dns_rr_txt *dns_resolve_rhsbl_txt(struct dns_ctx *ctx, const char *name,
                                         const char *rhsbl) {
  return (struct dns_rr_txt *)dns_resolve(
      ctx, dns_submit_rhsbl_txt(ctx, name, rhsbl, 0, 0));
}


x86 assembly (clang, -O0):
<dns_resolve_rhsbl_txt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1040 <dns_submit_rhsbl_txt@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <dns_resolve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_resolve_rhsbl_txt>:
push   %rbx
mov    %rdi,%rbx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <dns_submit_rhsbl_txt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dns_resolve@plt>

LLVM IR (-O0):
%struct.dns_rr_txt = type { i32 }
%struct.dns_ctx = type { i32 }
define %struct.dns_rr_txt* @dns_resolve_rhsbl_txt(%struct.dns_ctx* %0, i8* %1, i8* %2) {
%4 = alloca %struct.dns_ctx*
%5 = alloca i8*
%6 = alloca i8*
store %struct.dns_ctx* %0, %struct.dns_ctx** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.dns_ctx*, %struct.dns_ctx** %4
%8 = load %struct.dns_ctx*, %struct.dns_ctx** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @dns_submit_rhsbl_txt(%struct.dns_ctx* %8, i8* %9, i8* %10, i32 0, i32 0)
%12 = call i64 @dns_resolve(%struct.dns_ctx* %7, i32 %11)
%13 = inttoptr i64 %12 to %struct.dns_rr_txt*
ret %struct.dns_rr_txt* %13
}

LLVM IR (-O2):
%struct.dns_rr_txt = type { i32 }
%struct.dns_ctx = type { i32 }
define %struct.dns_rr_txt* @dns_resolve_rhsbl_txt(%struct.dns_ctx* %0, i8* %1, i8* %2) {
%4 = tail call i32 @dns_submit_rhsbl_txt(%struct.dns_ctx* %0, i8* %1, i8* %2, i32 0, i32 0)
%5 = tail call i64 @dns_resolve(%struct.dns_ctx* %0, i32 %4)
%6 = inttoptr i64 %5 to %struct.dns_rr_txt*
ret %struct.dns_rr_txt* %6
}
/* Variables and functions */
char *__revert_fqdn(char *, char const *, int /*<<< orphan*/ *);
char *isns_build_source_pattern(const char *fqdn) {
  return __revert_fqdn("match:", fqdn, NULL);
}


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

x86 assembly (clang, -O2):
<isns_build_source_pattern>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
jmp    1030 <__revert_fqdn@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"match:\00"
define i8* @isns_build_source_pattern(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @__revert_fqdn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i32* null)
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"match:\00"
define i8* @isns_build_source_pattern(i8* %0) {
%2 = tail call i8* @__revert_fqdn(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32* null)
ret i8* %2
}
int multiplicate(int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @multiplicate(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 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @multiplicate(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int lm_get_lockspaces_dlm(struct list_head *ls_rejoin) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.list_head = type opaque
define i32 @lm_get_lockspaces_dlm(%struct.list_head* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
struct inotify_event {
  int dummy;
};

/* Variables and functions */
int inotifytools_snprintf(char *, int, struct inotify_event *, char *);
int inotifytools_sprintf(char *out, struct inotify_event *event, char *fmt) {
  return inotifytools_snprintf(out, 4096, event, fmt);
}


x86 assembly (clang, -O0):
<inotifytools_sprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1000,%esi
call   1030 <inotifytools_snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotifytools_sprintf>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1000,%esi
jmp    1030 <inotifytools_snprintf@plt>

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

LLVM IR (-O2):
%struct.inotify_event = type { i32 }
define i32 @inotifytools_sprintf(i8* %0, %struct.inotify_event* %1, i8* %2) {
%4 = tail call i32 @inotifytools_snprintf(i8* %0, i32 4096, %struct.inotify_event* %1, i8* %2)
ret i32 %4
}
void invalid(int **x) {
  int k;
  **x = k;
  return;
}


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

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

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

LLVM IR (-O2):
define void @invalid(i32** nocapture %0) {
ret void
}
int get_y(int codificado) { return codificado % 100; }


x86 assembly (clang, -O0):
<get_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_y>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_y(i32 %0) {
%2 = srem i32 %0, 100
ret i32 %2
}
float Bound0_1(float x) { return x < 0.0f ? 0.0f : (x > 1.0f ? 1.0f : x); }


x86 assembly (clang, -O0):
<Bound0_1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1123 <Bound0_1+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    115f <Bound0_1+0x5f>
movss  -0x4(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114b <Bound0_1+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1155 <Bound0_1+0x55>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bound0_1>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @Bound0_1(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
void adis16203_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16203_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
double denom(double, double);
double sphsr(double a, double es, double sphi) {
  double dn = denom(es, sphi);
  return a * (1.0 - es) / (dn * dn * dn);
}


x86 assembly (clang, -O0):
<sphsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <denom@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphsr>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <denom@plt>
movsd  0xecc(%rip),%xmm1
subsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sphsr(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @denom(double %8, double %9)
store double %10, double* %7
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fsub double 1.000000e+00, %12
%14 = fmul double %11, %13
%15 = load double, double* %7
%16 = load double, double* %7
%17 = fmul double %15, %16
%18 = load double, double* %7
%19 = fmul double %17, %18
%20 = fdiv double %14, %19
ret double %20
}

LLVM IR (-O2):
define double @sphsr(double %0, double %1, double %2) {
%4 = tail call double @denom(double %1, double %2)
%5 = fsub double 1.000000e+00, %1
%6 = fmul double %5, %0
%7 = fmul double %4, %4
%8 = fmul double %4, %7
%9 = fdiv double %6, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, char const *);
void decll(const char *ps) { do_csi("%sq", ps); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%sq\00"
define void @decll(i8* %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ acer386sx_init();
int /*<<< orphan*/ at_init();
int /*<<< orphan*/ ide_init();
void at_acer386sx_init() {
  at_init();
  ide_init();
  acer386sx_init();
}


x86 assembly (clang, -O0):
<at_acer386sx_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <at_init@plt>
mov    $0x0,%al
call   1050 <ide_init@plt>
mov    $0x0,%al
call   1040 <acer386sx_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_acer386sx_init>:
push   %rax
xor    %eax,%eax
call   1030 <at_init@plt>
xor    %eax,%eax
call   1050 <ide_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <acer386sx_init@plt>

LLVM IR (-O0):
define void @at_acer386sx_init() {
%1 = call i32 (...) @at_init()
%2 = call i32 (...) @ide_init()
%3 = call i32 (...) @acer386sx_init()
ret void
}

LLVM IR (-O2):
define void @at_acer386sx_init() {
%1 = tail call i32 (...) @at_init()
%2 = tail call i32 (...) @ide_init()
%3 = tail call i32 (...) @acer386sx_init()
ret void
}
/* Variables and functions */
scalar_t__ of_call_prom(char *, int, int, char const *);
void *of_finddevice(const char *name) {
  return (void *)(unsigned long)of_call_prom("finddevice", 1, 1, name);
}


x86 assembly (clang, -O0):
<of_finddevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <of_call_prom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_finddevice>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <of_call_prom@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"finddevice\00"
define i8* @of_finddevice(i8* %0) {
%2 = tail call i64 @of_call_prom(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}