xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
int clear_string(char str[]) {
  int err = 0;
  int i;
  int str_length = strlen(str);
  for (i = 0; i <= str_length; str[i++] = '\0')
    ;
  return err;
}


x86 assembly (clang, -O0):
<clear_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1162 <clear_string+0x52>
jmp    1147 <clear_string+0x37>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1136 <clear_string+0x26>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
js     113d <clear_string+0x1d>
mov    %eax,%edx
add    $0x1,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @clear_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = add nuw nsw i64 %5, 1
br label %7
7: ; preds = %4, %1
ret i32 0
}
int iscntrl(int c) { return ((c) < ' ') || ((c) > 126); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <iscntrl+0x20>
cmpl   $0x7e,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
add    $0xffffff81,%edi
xor    %eax,%eax
cmp    $0xffffffa1,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = add i32 %0, -127
%3 = icmp ult i32 %2, -95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *malloc(unsigned int);
void *vmalloc(unsigned long size) {
  void *tmp;
  unsigned int __cil_tmp3;
  {
    {
      __cil_tmp3 = (unsigned int)size;
      tmp = malloc(__cil_tmp3);
    }
    return (tmp);
  }
}


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

x86 assembly (clang, -O2):
<vmalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @vmalloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i8* @malloc(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts("EssiConv - a tool for converting CNC-program\nfrom ESSI format to EIA "
       "(G-code) format.\nUsage:\n    essi2eia [options] < essi_prog > "
       "eia_prog\nOptions:\n    -c    Print comment for each exporting "
       "block.\n    -h    This help message.\n    -v    Version information.");
}


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

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

LLVM IR (-O0):
@.str = [258 x i8] c"EssiConv - a tool for converting CNC-program\0Afrom ESSI format to EIA (G-code) format.\0AUsage:\0A essi2eia [options] < essi_prog > eia_prog\0AOptions:\0A -c Print comment for each exporting block.\0A -h This help message.\0A -v Version information.\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([258 x i8], [258 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [258 x i8] c"EssiConv - a tool for converting CNC-program\0Afrom ESSI format to EIA (G-code) format.\0AUsage:\0A essi2eia [options] < essi_prog > eia_prog\0AOptions:\0A -c Print comment for each exporting block.\0A -h This help message.\0A -v Version information.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([258 x i8], [258 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dice_parse(char const *, int *, int *, int *);
int dice_average(const char *fmt) {
  int num, faces, bias;
  dice_parse(fmt, &num, &faces, &bias);
  return ((faces / 2) + 1) * num + bias;
}


x86 assembly (clang, -O0):
<dice_average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <dice_parse@plt>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
imul   -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dice_average>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <dice_parse@plt>
mov    0x10(%rsp),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    $0x1,%eax
imul   0x14(%rsp),%eax
add    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @dice_average(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @dice_parse(i8* %0, i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = sdiv i32 %9, 2
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}
int test_imm_D1uint16_mem(unsigned short *val) {
  return ((*val) & (0xD1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D1uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 209
%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_D1uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 209
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((no_sanitize("implicit-conversion"))) unsigned char
blacklist_2(unsigned int src) {
  return src;
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @blacklist_2(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ LrsCreateSocket(char *, char *, char *, char *);
int /*<<< orphan*/ LrsStartup(int);
vuser_init() {
  LrsStartup(257);
  LrsCreateSocket("socket0", "TCP", "RemoteHost=192.168.1.252:1980", "0");
  return 0;
}


x86 assembly (clang, -O0):
<vuser_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x101,%edi
call   1030 <LrsStartup@plt>
lea    0xecb(%rip),%rdi
lea    0xecc(%rip),%rsi
lea    0xec9(%rip),%rdx
lea    0xede(%rip),%rcx
call   1040 <LrsCreateSocket@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuser_init>:
push   %rax
mov    $0x101,%edi
call   1030 <LrsStartup@plt>
lea    0xece(%rip),%rdi
lea    0xecf(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xee1(%rip),%rcx
call   1040 <LrsCreateSocket@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"socket0\00"
@.str.1 = [4 x i8] c"TCP\00"
@.str.2 = [30 x i8] c"RemoteHost=192.168.1.252:1980\00"
@.str.3 = [2 x i8] c"0\00"
define i32 @vuser_init() {
%1 = call i32 @LrsStartup(i32 257)
%2 = call i32 @LrsCreateSocket(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"socket0\00"
@.str.1 = [4 x i8] c"TCP\00"
@.str.2 = [30 x i8] c"RemoteHost=192.168.1.252:1980\00"
@.str.3 = [2 x i8] c"0\00"
define i32 @vuser_init() {
%1 = tail call i32 @LrsStartup(i32 257)
%2 = tail call i32 @LrsCreateSocket(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int vlistInqVarDatatype(int, int);
int vlistInqNWPV(int vlistID, int varID) {
  int nwpv;
  if (vlistInqVarDatatype(vlistID, varID) == 64 ||
      vlistInqVarDatatype(vlistID, varID) == 128)
    nwpv = 2;
  else
    nwpv = 1;
  return (nwpv);
}


x86 assembly (clang, -O0):
<vlistInqNWPV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <vlistInqVarDatatype@plt>
cmp    $0x40,%eax
je     1148 <vlistInqNWPV+0x38>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <vlistInqVarDatatype@plt>
cmp    $0x80,%eax
jne    1154 <vlistInqNWPV+0x44>
movl   $0x2,-0xc(%rbp)
jmp    115b <vlistInqNWPV+0x4b>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistInqNWPV>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <vlistInqVarDatatype@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    $0x40,%ecx
je     1141 <vlistInqNWPV+0x31>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <vlistInqVarDatatype@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x80,%ecx
sete   %al
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vlistInqNWPV(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* %4
%8 = call i32 @vlistInqVarDatatype(i32 %6, i32 %7)
%9 = icmp eq i32 %8, 64
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @vlistInqVarDatatype(i32 %11, i32 %12)
%14 = icmp eq i32 %13, 128
br i1 %14, label %15, label %16
15: ; preds = %10, %2
store i32 2, i32* %5
br label %17
16: ; preds = %10
store i32 1, i32* %5
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @vlistInqNWPV(i32 %0, i32 %1) {
%3 = tail call i32 @vlistInqVarDatatype(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 64
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @vlistInqVarDatatype(i32 %0, i32 %1)
%7 = icmp eq i32 %6, 128
%8 = select i1 %7, i32 2, i32 1
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 2, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int popcnt4(uint64_t x2) {
  uint32_t x;
  x2 = x2 - ((x2 >> 1) & 0x5555555555555555uLL);
  x2 = ((x2 >> 2) & 0x3333333333333333uLL) + (x2 & 0x3333333333333333uLL);
  x2 = (x2 + (x2 >> 4)) & 0x0F0F0F0F0F0F0F0FuLL;
  x = (uint32_t)(x2 + (x2 >> 32));
  x = x + (x >> 16);
  return (x + (x >> 8)) & 0x0000007F;
}


x86 assembly (clang, -O0):
<popcnt4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
movslq %ecx,%rcx
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
cltq
movabs $0x3333333333333333,%rcx
33 33 33
and    %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0x3333333333333333,%rdx
33 33 33
and    %rdx,%rcx
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
cltq
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
add    %ecx,%eax
and    $0x7f,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @popcnt4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = sext i32 %7 to i64
%9 = and i64 %8, 6148914691236517205
%10 = sub i64 %5, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = ashr i32 %12, 2
%14 = sext i32 %13 to i64
%15 = and i64 %14, 3689348814741910323
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = and i64 %17, 3689348814741910323
%19 = add i64 %15, %18
%20 = trunc i64 %19 to i32
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = ashr i32 %22, 4
%24 = add nsw i32 %21, %23
%25 = sext i32 %24 to i64
%26 = and i64 %25, 1085102592571150095
%27 = trunc i64 %26 to i32
store i32 %27, i32* %2
%28 = load i32, i32* %2
%29 = load i32, i32* %2
%30 = ashr i32 %29, 32
%31 = add nsw i32 %28, %30
store i32 %31, i32* %3
%32 = load i32, i32* %3
%33 = load i32, i32* %3
%34 = ashr i32 %33, 16
%35 = add nsw i32 %32, %34
store i32 %35, i32* %3
%36 = load i32, i32* %3
%37 = load i32, i32* %3
%38 = ashr i32 %37, 8
%39 = add nsw i32 %36, %38
%40 = and i32 %39, 127
ret i32 %40
}

LLVM IR (-O2):
define i32 @popcnt4(i32 %0) {
ret i32 poison
}
/* Variables and functions */
void *int_to_voidp(intptr_t i) { return (void *)i; }


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

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

LLVM IR (-O0):
define i8* @int_to_voidp(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @int_to_voidp(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct sctphdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_transport_header(struct sk_buff const *);
struct sctphdr *sctp_hdr(const struct sk_buff *skb) {
  return (struct sctphdr *)skb_transport_header(skb);
}


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

x86 assembly (clang, -O2):
<sctp_hdr>:
jmp    1030 <skb_transport_header@plt>

LLVM IR (-O0):
%struct.sctphdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.sctphdr* @sctp_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_transport_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.sctphdr*
ret %struct.sctphdr* %5
}

LLVM IR (-O2):
%struct.sctphdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.sctphdr* @sctp_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_transport_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.sctphdr*
ret %struct.sctphdr* %3
}
/* Variables and functions */
int M_PI;
double cos(double);
double rand_double_exponential(double);
double rand_double_range(int, int);
double sqrt(double);
double rand_double_gaussian(void) {
  double theta, rsq;
  theta = rand_double_range(0., 2. * M_PI);
  rsq = rand_double_exponential(0.5);
  return (sqrt(rsq) * cos(theta));
}


x86 assembly (clang, -O0):
<rand_double_gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2e99(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xead(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
xor    %edi,%edi
call   1060 <rand_double_range@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  0xe89(%rip),%xmm0
call   1030 <rand_double_exponential@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double_gaussian>:
sub    $0x18,%rsp
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
add    %esi,%esi
xor    %edi,%edi
call   1060 <rand_double_range@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xe9c(%rip),%xmm0
call   1030 <rand_double_exponential@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1179 <rand_double_gaussian+0x39>
sqrtsd %xmm0,%xmm0
jmp    117e <rand_double_gaussian+0x3e>
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @rand_double_gaussian() {
%1 = alloca double
%2 = alloca double
%3 = load i32, i32* @M_PI
%4 = sitofp i32 %3 to double
%5 = fmul double 2.000000e+00, %4
%6 = fptosi double %5 to i32
%7 = call double @rand_double_range(i32 0, i32 %6)
store double %7, double* %1
%8 = call double @rand_double_exponential(double 5.000000e-01)
store double %8, double* %2
%9 = load double, double* %2
%10 = call double @sqrt(double %9)
%11 = load double, double* %1
%12 = call double @cos(double %11)
%13 = fmul double %10, %12
ret double %13
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @rand_double_gaussian() {
%1 = load i32, i32* @M_PI
%2 = shl i32 %1, 1
%3 = tail call double @rand_double_range(i32 0, i32 %2)
%4 = tail call double @rand_double_exponential(double 5.000000e-01)
%5 = tail call double @sqrt(double %4)
%6 = tail call double @cos(double %3)
%7 = fmul double %5, %6
ret double %7
}
/* Variables and functions */
int read(int, void *, int);
int Serial_Read(int fd, unsigned char *byReadBuf, int nReadLen) {
  int nLen;
  nLen = read(fd, (void *)byReadBuf, nReadLen);
  return nLen;
}


x86 assembly (clang, -O0):
<Serial_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serial_Read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @Serial_Read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ magenta(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmMagenta(char *str) { printColor(magenta(str)); }


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

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

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

LLVM IR (-O2):
define void @cmMagenta(i8* %0) {
%2 = tail call i32 @magenta(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
void ff_hevc_put_hevc_bi_w_qpel_hv8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv8_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exit_with_help() {
  printf("Usage: svm-scale [options] data_filename\n"
         "options:\n"
         "-l lower : x scaling lower limit (default -1)\n"
         "-u upper : x scaling upper limit (default +1)\n"
         "-y y_lower y_upper : y scaling limits (default: no y scaling)\n"
         "-s save_filename : save scaling parameters to save_filename\n"
         "-r restore_filename : restore scaling parameters from "
         "restore_filename\n");
  exit(1);
}


x86 assembly (clang, -O0):
<exit_with_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [336 x i8] c"Usage: svm-scale [options] data_filename\0Aoptions:\0A-l lower : x scaling lower limit (default -1)\0A-u upper : x scaling upper limit (default +1)\0A-y y_lower y_upper : y scaling limits (default: no y scaling)\0A-s save_filename : save scaling parameters to save_filename\0A-r restore_filename : restore scaling parameters from restore_filename\0A\00"
define void @exit_with_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([336 x i8], [336 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [335 x i8] c"Usage: svm-scale [options] data_filename\0Aoptions:\0A-l lower : x scaling lower limit (default -1)\0A-u upper : x scaling upper limit (default +1)\0A-y y_lower y_upper : y scaling limits (default: no y scaling)\0A-s save_filename : save scaling parameters to save_filename\0A-r restore_filename : restore scaling parameters from restore_filename\00"
define void @exit_with_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([335 x i8], [335 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_li_pow();
int main(int argc, const char *argv[]) {
  test_li_pow();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_li_pow@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_li_pow()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f2() { printf("Hello! You have invoked f2().\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Hello! You have invoked f2().\0A\00"
define void @f2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Hello! You have invoked f2().\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
int cairo_code_draw_ivoryDial_get_width() { return 91; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_ivoryDial_get_width() {
ret i32 91
}

LLVM IR (-O2):
define i32 @cairo_code_draw_ivoryDial_get_width() {
ret i32 91
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned int f5(unsigned int x, unsigned int y) {
  unsigned int r = x - y;
  if (r >= x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     113a <f5+0x2a>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
push   %rbx
mov    %edi,%ebx
sub    %esi,%ebx
cmp    %edi,%ebx
jb     1120 <f5+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f5(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* %4
%8 = sub i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp uge i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = icmp ult i32 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Type definitions */
struct feed_prompt {
  int dummy;
};
struct feed_line {
  int dummy;
};

/* Variables and functions */
struct feed_line *feed_prompt_get(struct feed_prompt *const, unsigned int);
struct feed_line *feed_prompt_get2(struct feed_prompt *const p_prompt) {
  return feed_prompt_get(p_prompt, 1u);
}


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

x86 assembly (clang, -O2):
<feed_prompt_get2>:
mov    $0x1,%esi
jmp    1030 <feed_prompt_get@plt>

LLVM IR (-O0):
%struct.feed_line = type { i32 }
%struct.feed_prompt = type { i32 }
define %struct.feed_line* @feed_prompt_get2(%struct.feed_prompt* %0) {
%2 = alloca %struct.feed_prompt*
store %struct.feed_prompt* %0, %struct.feed_prompt** %2
%3 = load %struct.feed_prompt*, %struct.feed_prompt** %2
%4 = call %struct.feed_line* @feed_prompt_get(%struct.feed_prompt* %3, i32 1)
ret %struct.feed_line* %4
}

LLVM IR (-O2):
%struct.feed_line = type { i32 }
%struct.feed_prompt = type { i32 }
define %struct.feed_line* @feed_prompt_get2(%struct.feed_prompt* %0) {
%2 = tail call %struct.feed_line* @feed_prompt_get(%struct.feed_prompt* %0, i32 1)
ret %struct.feed_line* %2
}
void test56_On5_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test56_On5_targetInit__I() {
ret void
}
int descend(const void *a, const void *b) { return (*(int *)b - *(int *)a); }


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

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

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

LLVM IR (-O2):
define i32 @descend(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int get_piece(int, int, int **);
int /*<<< orphan*/ set_piece(int, int, int, int **);
void move_piece(int row1, int col1, int row2, int col2, int **board) {
  int piece = get_piece(row1, col1, board);
  set_piece(0, row1, col1, board);
  set_piece(piece, row2, col2, board);
}


x86 assembly (clang, -O0):
<move_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <get_piece@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1040 <set_piece@plt>
mov    -0x1c(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <set_piece@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_piece>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%r12d
mov    %edi,%ebp
mov    %r8,%rdx
call   1030 <get_piece@plt>
mov    %eax,%r13d
xor    %edi,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %rbx,%rcx
call   1040 <set_piece@plt>
mov    %r13d,%edi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <set_piece@plt>

LLVM IR (-O0):
define void @move_piece(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32**
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32** %4, i32*** %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32**, i32*** %10
%15 = call i32 @get_piece(i32 %12, i32 %13, i32** %14)
store i32 %15, i32* %11
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32**, i32*** %10
%19 = call i32 @set_piece(i32 0, i32 %16, i32 %17, i32** %18)
%20 = load i32, i32* %11
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = load i32**, i32*** %10
%24 = call i32 @set_piece(i32 %20, i32 %21, i32 %22, i32** %23)
ret void
}

LLVM IR (-O2):
define void @move_piece(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = tail call i32 @get_piece(i32 %0, i32 %1, i32** %4)
%7 = tail call i32 @set_piece(i32 0, i32 %0, i32 %1, i32** %4)
%8 = tail call i32 @set_piece(i32 %6, i32 %2, i32 %3, i32** %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int IPC_CREAT;
int semget(int /*<<< orphan*/, int, int);
int get_semaphore_id(void) {
  int sem_id;
  sem_id = semget((key_t)(3555), 2, 0666 | IPC_CREAT);
  return sem_id;
}


x86 assembly (clang, -O0):
<get_semaphore_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
or     $0x1b6,%edx
mov    $0xde3,%edi
mov    $0x2,%esi
call   1030 <semget@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_semaphore_id>:
mov    0x2ec9(%rip),%rax
mov    $0x1b6,%edx
or     (%rax),%edx
mov    $0xde3,%edi
mov    $0x2,%esi
jmp    1030 <semget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @get_semaphore_id() {
%1 = alloca i32
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 438, %2
%4 = call i32 @semget(i32 3555, i32 2, i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @get_semaphore_id() {
%1 = load i32, i32* @IPC_CREAT
%2 = or i32 %1, 438
%3 = tail call i32 @semget(i32 3555, i32 2, i32 %2)
ret i32 %3
}
int test_imm_03uint8_mem(unsigned char *val) {
  return ((*val) & (-0x03 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_03uint8_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, -3
%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_03uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -3
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void BRAKE_ADC_ISR4(void) {}


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

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

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

LLVM IR (-O2):
define void @BRAKE_ADC_ISR4() {
ret void
}
/* Variables and functions */
int check_idle();
int check_load();
int delay() {
  if (check_idle() > 5)
    return (0);
  if (check_load() > 1000)
    return (3000);
  if (check_load() < 200)
    return (0);
  return (check_load() / 100);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <check_idle@plt>
cmp    $0x5,%eax
jle    1144 <delay+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1192 <delay+0x72>
mov    $0x0,%al
call   1030 <check_load@plt>
cmp    $0x3e8,%eax
jle    1162 <delay+0x42>
movl   $0xbb8,-0x4(%rbp)
jmp    1192 <delay+0x72>
mov    $0x0,%al
call   1030 <check_load@plt>
cmp    $0xc8,%eax
jge    1180 <delay+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1192 <delay+0x72>
mov    $0x0,%al
call   1030 <check_load@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <check_idle@plt>
cmp    $0x5,%eax
jg     1172 <delay+0x52>
xor    %eax,%eax
call   1030 <check_load@plt>
mov    $0xbb8,%ebx
cmp    $0x3e8,%eax
jg     1172 <delay+0x52>
xor    %eax,%eax
call   1030 <check_load@plt>
mov    $0x0,%ebx
cmp    $0xc8,%eax
jl     1172 <delay+0x52>
xor    %eax,%eax
call   1030 <check_load@plt>
cltq
imul   $0x51eb851f,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x25,%rbx
add    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @delay() {
%1 = alloca i32
%2 = call i32 (...) @check_idle()
%3 = icmp sgt i32 %2, 5
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %16
5: ; preds = %0
%6 = call i32 (...) @check_load()
%7 = icmp sgt i32 %6, 1000
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 3000, i32* %1
br label %16
9: ; preds = %5
%10 = call i32 (...) @check_load()
%11 = icmp slt i32 %10, 200
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* %1
br label %16
13: ; preds = %9
%14 = call i32 (...) @check_load()
%15 = sdiv i32 %14, 100
store i32 %15, i32* %1
br label %16
16: ; preds = %13, %12, %8, %4
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @delay() {
%1 = tail call i32 (...) @check_idle()
%2 = icmp sgt i32 %1, 5
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32 (...) @check_load()
%5 = icmp sgt i32 %4, 1000
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = tail call i32 (...) @check_load()
%8 = icmp slt i32 %7, 200
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 (...) @check_load()
%11 = sdiv i32 %10, 100
br label %12
12: ; preds = %6, %3, %0, %9
%13 = phi i32 [ %11, %9 ], [ 0, %0 ], [ 3000, %3 ], [ 0, %6 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fputs(char *, int /*<<< orphan*/ *);
int pc_writesrc(void *handle, unsigned char *source) {
  return fputs((char *)source, (FILE *)handle) >= 0;
}


x86 assembly (clang, -O0):
<pc_writesrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_writesrc>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <fputs@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pc_writesrc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = call i64 @fputs(i8* %5, i32* %7)
%9 = icmp sge i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @pc_writesrc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i64 @fputs(i8* %1, i32* %3)
%5 = lshr i64 %4, 63
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *value = malloc(size);
  if (value == 0)
    fatal("FATAL: virtual memory exhausted");
  return value;
}


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

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

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

LLVM IR (-O2):
@.str = [32 x i8] c"FATAL: virtual memory exhausted\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void _memSet(void *addr, int size) { memset(addr, 0, size); }


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

x86 assembly (clang, -O2):
<_memSet>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @_memSet(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ stdscr;
void con_init(void) {
  initscr();
  cbreak();
  noecho();
  nodelay(stdscr, FALSE);
  curs_set(FALSE);
}


x86 assembly (clang, -O0):
<con_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    0x2e5f(%rip),%rax
mov    (%rax),%esi
call   1050 <nodelay@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1070 <curs_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_init>:
push   %rbx
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    0x2e62(%rip),%rbx
mov    (%rbx),%esi
call   1050 <nodelay@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1070 <curs_set@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@FALSE = global i32 0
define void @con_init() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @FALSE
%6 = call i32 @nodelay(i32 %4, i32 %5)
%7 = load i32, i32* @FALSE
%8 = call i32 @curs_set(i32 %7)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@FALSE = global i32 0
define void @con_init() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @FALSE
%6 = tail call i32 @nodelay(i32 %4, i32 %5)
%7 = load i32, i32* @FALSE
%8 = tail call i32 @curs_set(i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *);
int8_t impl_4(FILE **this, void **unused, bool *valid) {
  int8_t x;
  *valid = fscanf(*this, "%c", &x) == 1;
  return x;
}


x86 assembly (clang, -O0):
<impl_4>:
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),%rdi
lea    0xece(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<impl_4>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    (%rdi),%rdi
lea    0xede(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1030 <fscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,(%rbx)
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @impl_4(i32** %0, i8** %1, i32* %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%8 = load i32**, i32*** %4
%9 = load i32*, i32** %8
%10 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = load i32*, i32** %6
store i32 %12, i32* %13
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @impl_4(i32** nocapture %0, i8** nocapture readnone %1, i32* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32*, i32** %0
%7 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
store i32 %9, i32* %2
%10 = load i32, i32* %4
ret i32 %10
}
/* Type definitions */
struct namedb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ namedb_destroy(struct namedb *);
int /*<<< orphan*/ namedb_fd_close(struct namedb *);
void namedb_close(struct namedb *db) {
  namedb_fd_close(db);
  if (db) {
    namedb_destroy(db);
  }
}


x86 assembly (clang, -O0):
<namedb_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <namedb_fd_close@plt>
cmpq   $0x0,-0x8(%rbp)
je     1149 <namedb_close+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <namedb_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<namedb_close>:
push   %rbx
mov    %rdi,%rbx
call   1030 <namedb_fd_close@plt>
test   %rbx,%rbx
je     1137 <namedb_close+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <namedb_destroy@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.namedb = type { i32 }
define void @namedb_close(%struct.namedb* %0) {
%2 = alloca %struct.namedb*
store %struct.namedb* %0, %struct.namedb** %2
%3 = load %struct.namedb*, %struct.namedb** %2
%4 = call i32 @namedb_fd_close(%struct.namedb* %3)
%5 = load %struct.namedb*, %struct.namedb** %2
%6 = icmp ne %struct.namedb* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load %struct.namedb*, %struct.namedb** %2
%9 = call i32 @namedb_destroy(%struct.namedb* %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.namedb = type { i32 }
define void @namedb_close(%struct.namedb* %0) {
%2 = tail call i32 @namedb_fd_close(%struct.namedb* %0)
%3 = icmp eq %struct.namedb* %0, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @namedb_destroy(%struct.namedb* %0)
br label %6
6: ; preds = %4, %1
ret void
}
void __attribute__((__no__)) foo(unsigned char *p) { *p = 0x81; }


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

x86 assembly (clang, -O2):
<foo>:
movb   $0x81,(%rdi)
ret

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

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0) {
store i8 -127, i8* %0
ret void
}