xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t get_key_at(size_t *items, size_t i) { return items[(i * 2) + 1]; }


x86 assembly (clang, -O0):
<get_key_at>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
mov    0x8(%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_key_at>:
shl    $0x4,%rsi
mov    0x8(%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @get_key_at(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = mul i64 %6, 2
%8 = add i64 %7, 1
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @get_key_at(i64* nocapture %0, i64 %1) {
%3 = shl i64 %1, 1
%4 = or i64 %3, 1
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
ret i64 %6
}
void sca3000_powerdown(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @sca3000_powerdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int Msleep(int nargs, int *argsv) {
  int N = *argsv;
  sleep(N);
  return 0;
}


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

x86 assembly (clang, -O2):
<Msleep>:
push   %rax
mov    (%rsi),%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Msleep(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @sleep(i32 %3)
ret i32 0
}
const char *json_skip(const char *in) {
  while (in && *in && (unsigned char)*(in) <= 32) {
    in++;
  }
  return in;
}


x86 assembly (clang, -O0):
<json_skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113d <json_skip+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     113d <json_skip+0x3d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114d <json_skip+0x4d>
jmp    115e <json_skip+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <json_skip+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_skip>:
test   %rdi,%rdi
je     1121 <json_skip+0x21>
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xff,%cl
cmp    $0x20,%cl
jb     1110 <json_skip+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @json_skip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %18, %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 32
br label %16
16: ; preds = %11, %6, %3
%17 = phi i1 [ false, %6 ], [ false, %3 ], [ %15, %11 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %3
21: ; preds = %16
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @json_skip(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = add i8 %5, -1
%7 = icmp ult i8 %6, 32
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %3, label %9
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ sendMsg(int, char *, int);
void sendNullMsg(int sockFD) {
  if (sockFD < 0)
    return;
  sendMsg(sockFD, "\n\n\n", 3);
}


x86 assembly (clang, -O0):
<sendNullMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <sendNullMsg+0x1a>
jmp    113e <sendNullMsg+0x2e>
mov    -0x4(%rbp),%edi
lea    0xecc(%rip),%rsi
mov    $0x3,%edx
call   1030 <sendMsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendNullMsg>:
test   %edi,%edi
js     1125 <sendNullMsg+0x15>
lea    0xee5(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <sendMsg@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A\0A\0A\00"
define void @sendNullMsg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @sendMsg(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A\0A\0A\00"
define void @sendNullMsg(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sendMsg(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arg(int);
int /*<<< orphan*/ decbin(int);
int /*<<< orphan*/ newdef(int /*<<< orphan*/);
int /*<<< orphan*/ remove(int);
int /*<<< orphan*/ setdef(int /*<<< orphan*/, int /*<<< orphan*/);
define() {
  remove(1);
  newdef(decbin(3));
  setdef(arg(1), arg(2));
}


x86 assembly (clang, -O0):
<define>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <remove@plt>
mov    $0x3,%edi
call   1060 <decbin@plt>
mov    %eax,%edi
call   1070 <newdef@plt>
mov    $0x1,%edi
call   1050 <arg@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1050 <arg@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <setdef@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<define>:
push   %rbx
mov    $0x1,%edi
call   1040 <remove@plt>
mov    $0x3,%edi
call   1060 <decbin@plt>
mov    %eax,%edi
call   1070 <newdef@plt>
mov    $0x1,%edi
call   1050 <arg@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1050 <arg@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <setdef@plt>

LLVM IR (-O0):
define i32 @define() {
%1 = alloca i32
%2 = call i32 @remove(i32 1)
%3 = call i32 @decbin(i32 3)
%4 = call i32 @newdef(i32 %3)
%5 = call i32 @arg(i32 1)
%6 = call i32 @arg(i32 2)
%7 = call i32 @setdef(i32 %5, i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @define() {
%1 = tail call i32 @remove(i32 1)
%2 = tail call i32 @decbin(i32 3)
%3 = tail call i32 @newdef(i32 %2)
%4 = tail call i32 @arg(i32 1)
%5 = tail call i32 @arg(i32 2)
%6 = tail call i32 @setdef(i32 %4, i32 %5)
ret i32 undef
}
signed int wctomb(char *__s, signed int __wchar) {
  signed int return_value___wctomb_chk$1;
  signed int return_value___wctomb_alias$2;
  return_value___wctomb_alias$2 = __wctomb_alias(__s, __wchar);
  return return_value___wctomb_alias$2;
}


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

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

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

LLVM IR (-O2):
define i32 @wctomb(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @__wctomb_alias to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
ret i32 %3
}
int msgidxof(int code) {
  return (0                                ? 0
          : ((code >= 0) && (code <= 13))  ? (code - 0)
          : ((code >= 31) && (code <= 35)) ? (code - 17)
                                           : 36 - 17);
}


x86 assembly (clang, -O0):
<msgidxof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1129 <msgidxof+0x29>
cmpl   $0xd,-0x4(%rbp)
jg     1129 <msgidxof+0x29>
mov    -0x4(%rbp),%eax
sub    $0x0,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <msgidxof+0x5e>
cmpl   $0x1f,-0x4(%rbp)
jl     114b <msgidxof+0x4b>
cmpl   $0x23,-0x4(%rbp)
jg     114b <msgidxof+0x4b>
mov    -0x4(%rbp),%eax
sub    $0x11,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <msgidxof+0x58>
mov    $0x13,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <msgidxof+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgidxof>:
lea    -0x1f(%rdi),%eax
lea    -0x11(%rdi),%ecx
cmp    $0x5,%eax
mov    $0x13,%eax
cmovb  %ecx,%eax
cmp    $0xe,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @msgidxof(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 13
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 0
br label %23
11: ; preds = %5, %1
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 31
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 35
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = sub nsw i32 %18, 17
br label %21
20: ; preds = %14, %11
br label %21
21: ; preds = %20, %17
%22 = phi i32 [ %19, %17 ], [ 19, %20 ]
br label %23
23: ; preds = %21, %8
%24 = phi i32 [ %10, %8 ], [ %22, %21 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @msgidxof(i32 %0) {
%2 = icmp ult i32 %0, 14
%3 = add i32 %0, -31
%4 = icmp ult i32 %3, 5
%5 = add nsw i32 %0, -17
%6 = select i1 %4, i32 %5, i32 19
%7 = select i1 %2, i32 %0, i32 %6
ret i32 %7
}
/* Type definitions */
struct drc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct drc *);
int /*<<< orphan*/ free_data_buffer(struct drc *);
int /*<<< orphan*/ free_emphasis_eq(struct drc *);
int /*<<< orphan*/ free_kernel(struct drc *);
void drc_free(struct drc *drc) {
  free_kernel(drc);
  free_emphasis_eq(drc);
  free_data_buffer(drc);
  free(drc);
}


x86 assembly (clang, -O0):
<drc_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <free_kernel@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free_emphasis_eq@plt>
mov    -0x8(%rbp),%rdi
call   1060 <free_data_buffer@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drc_free>:
push   %rbx
mov    %rdi,%rbx
call   1050 <free_kernel@plt>
mov    %rbx,%rdi
call   1040 <free_emphasis_eq@plt>
mov    %rbx,%rdi
call   1060 <free_data_buffer@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.drc = type { i32 }
define void @drc_free(%struct.drc* %0) {
%2 = alloca %struct.drc*
store %struct.drc* %0, %struct.drc** %2
%3 = load %struct.drc*, %struct.drc** %2
%4 = call i32 @free_kernel(%struct.drc* %3)
%5 = load %struct.drc*, %struct.drc** %2
%6 = call i32 @free_emphasis_eq(%struct.drc* %5)
%7 = load %struct.drc*, %struct.drc** %2
%8 = call i32 @free_data_buffer(%struct.drc* %7)
%9 = load %struct.drc*, %struct.drc** %2
%10 = call i32 @free(%struct.drc* %9)
ret void
}

LLVM IR (-O2):
%struct.drc = type { i32 }
define void @drc_free(%struct.drc* %0) {
%2 = tail call i32 @free_kernel(%struct.drc* %0)
%3 = tail call i32 @free_emphasis_eq(%struct.drc* %0)
%4 = tail call i32 @free_data_buffer(%struct.drc* %0)
%5 = tail call i32 @free(%struct.drc* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
  int rem;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
div_t div(int numer, int denom) {
  div_t res;
  res.quot = numer / denom;
  res.rem = numer % denom;
  return res;
}


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

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i64 @div(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = sdiv i32 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = srem i32 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i32 %12, i32* %13
%14 = bitcast %struct.TYPE_3__* %3 to i64*
%15 = load i64, i64* %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = zext i32 %4 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %3 to i64
%8 = or i64 %6, %7
ret i64 %8
}
unsigned long long BIT_XOR(unsigned long long value, unsigned long long mask) {
  value = value & mask;
  unsigned long long xorbit = value;
  unsigned long long i = sizeof(unsigned long long) << 2;
  while (i != 0) {
    xorbit = (xorbit & (((unsigned long long)1 << i) - 1)) ^ (xorbit >> i);
    i >>= 1;
  }
  return xorbit;
}


x86 assembly (clang, -O0):
<BIT_XOR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x20,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1173 <BIT_XOR+0x73>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
and    %rcx,%rax
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
shr    %cl,%rdx
mov    %rdx,%rcx
xor    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1128 <BIT_XOR+0x28>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIT_XOR>:
and    %rsi,%rdi
mov    %edi,%eax
shr    $0x20,%rdi
xor    %rdi,%rax
movzwl %ax,%ecx
shr    $0x10,%rax
xor    %rcx,%rax
movzbl %al,%ecx
shr    $0x8,%rax
xor    %rcx,%rax
mov    %eax,%ecx
and    $0xf,%ecx
shr    $0x4,%rax
xor    %rcx,%rax
mov    %eax,%ecx
and    $0x3,%ecx
shr    $0x2,%rax
xor    %rcx,%rax
mov    %eax,%ecx
and    $0x1,%ecx
shr    %rax
xor    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @BIT_XOR(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = and i64 %7, %8
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
store i64 32, i64* %6
br label %11
11: ; preds = %14, %2
%12 = load i64, i64* %6
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = shl i64 1, %16
%18 = sub i64 %17, 1
%19 = and i64 %15, %18
%20 = load i64, i64* %5
%21 = load i64, i64* %6
%22 = lshr i64 %20, %21
%23 = xor i64 %19, %22
store i64 %23, i64* %5
%24 = load i64, i64* %6
%25 = lshr i64 %24, 1
store i64 %25, i64* %6
br label %11
26: ; preds = %11
%27 = load i64, i64* %5
ret i64 %27
}

LLVM IR (-O2):
define i64 @BIT_XOR(i64 %0, i64 %1) {
%3 = and i64 %1, %0
%4 = and i64 %3, 4294967295
%5 = lshr i64 %3, 32
%6 = xor i64 %4, %5
%7 = and i64 %6, 65535
%8 = lshr i64 %6, 16
%9 = xor i64 %7, %8
%10 = and i64 %9, 255
%11 = lshr i64 %9, 8
%12 = xor i64 %10, %11
%13 = and i64 %12, 15
%14 = lshr i64 %12, 4
%15 = xor i64 %13, %14
%16 = and i64 %15, 3
%17 = lshr i64 %15, 2
%18 = xor i64 %16, %17
%19 = and i64 %18, 1
%20 = lshr i64 %18, 1
%21 = xor i64 %19, %20
ret i64 %21
}
int test1(char *w1, char *w2) {}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test1(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int init_server_socket_in();
int init_server_socket(void) { return init_server_socket_in(); }


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

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

LLVM IR (-O0):
define i32 @init_server_socket() {
%1 = call i32 (...) @init_server_socket_in()
ret i32 %1
}

LLVM IR (-O2):
define i32 @init_server_socket() {
%1 = tail call i32 (...) @init_server_socket_in()
ret i32 %1
}
/* Variables and functions */
size_t st_strhash(const void *s, int type) {
  register const char *p = (const char *)s;
  register size_t h = (size_t)type;
  while (*p)
    h = h * 251 + (size_t)(unsigned char)*p++;
  return h;
}


x86 assembly (clang, -O0):
<st_strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <st_strhash+0x4e>
imul   $0xfb,-0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    111b <st_strhash+0x1b>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_strhash>:
movslq %esi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <st_strhash+0x28>
add    $0x1,%rdi
nopl   (%rax)
imul   $0xfb,%rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <st_strhash+0x10>
ret

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

LLVM IR (-O2):
define i64 @st_strhash(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %14, %6 ], [ %4, %2 ]
%8 = phi i64 [ %13, %6 ], [ %3, %2 ]
%9 = phi i8* [ %11, %6 ], [ %0, %2 ]
%10 = mul i64 %8, 251
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = zext i8 %7 to i64
%13 = add i64 %10, %12
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i64 [ %3, %2 ], [ %13, %6 ]
ret i64 %17
}
/* Variables and functions */
int palindrom(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c[1000];
  printf("Text:");
  scanf("%s", c);
  printf("%d\n", palindrom(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
call   1050 <palindrom@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <palindrom@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"Text:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @palindrom(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
double I(int);
void integral_recur(int nmin, int nmax, double vals[]) {
  int i;
  for (i = nmin; i <= nmax; i++) {
    vals[i] = I(i);
  }
}


x86 assembly (clang, -O0):
<integral_recur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1157 <integral_recur+0x47>
mov    -0x14(%rbp),%edi
call   1030 <I@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <integral_recur+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integral_recur>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jg     1147 <integral_recur+0x37>
mov    %esi,%r14d
mov    %edi,%ebp
movslq %edi,%rax
add    $0x1,%r14d
lea    (%rdx,%rax,8),%rbx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <I@plt>
movsd  %xmm0,(%rbx)
add    $0x8,%rbx
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <integral_recur+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @integral_recur(i32 %0, i32 %1, double* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, %1
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = sext i32 %0 to i64
%7 = add i32 %1, 1
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %6, %5 ], [ %13, %8 ]
%10 = trunc i64 %9 to i32
%11 = tail call double @I(i32 %10)
%12 = getelementptr inbounds double, double* %2, i64 %9
store double %11, double* %12
%13 = add nsw i64 %9, 1
%14 = trunc i64 %13 to i32
%15 = icmp eq i32 %7, %14
br i1 %15, label %16, label %8
16: ; preds = %8, %3
ret void
}
/* Variables and functions */
int HRF_readreg(int);
void HRF_clear_fifo(void) {
  while ((HRF_readreg(0x28) & 0x40) == 0x40) {
    HRF_readreg(0x00);
  }
}


x86 assembly (clang, -O0):
<HRF_clear_fifo>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <HRF_clear_fifo+0x9>
mov    $0x28,%edi
call   1030 <HRF_readreg@plt>
and    $0x40,%eax
cmp    $0x40,%eax
jne    113b <HRF_clear_fifo+0x2b>
xor    %edi,%edi
call   1030 <HRF_readreg@plt>
jmp    1119 <HRF_clear_fifo+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HRF_clear_fifo>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x28,%edi
call   1030 <HRF_readreg@plt>
test   $0x40,%al
je     1137 <HRF_clear_fifo+0x27>
xor    %edi,%edi
call   1030 <HRF_readreg@plt>
jmp    1120 <HRF_clear_fifo+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @HRF_clear_fifo() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @HRF_readreg(i32 40)
%3 = and i32 %2, 64
%4 = icmp eq i32 %3, 64
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @HRF_readreg(i32 0)
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @HRF_clear_fifo() {
%1 = tail call i32 @HRF_readreg(i32 40)
%2 = and i32 %1, 64
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 @HRF_readreg(i32 0)
%6 = tail call i32 @HRF_readreg(i32 40)
%7 = and i32 %6, 64
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char func_c();
char __attribute__((visibility("default"))) func_b() {
  if (func_c() != 'c') {
    exit(3);
  }
  return 'b';
}


x86 assembly (clang, -O0):
<func_b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func_c@plt>
movsbl %al,%eax
cmp    $0x63,%eax
je     1141 <func_b+0x21>
mov    $0x3,%edi
call   1040 <exit@plt>
mov    $0x62,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_b>:
push   %rax
xor    %eax,%eax
call   1030 <func_c@plt>
cmp    $0x63,%al
jne    1130 <func_b+0x10>
mov    $0x62,%al
pop    %rcx
ret
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define signext i8 @func_b() {
%1 = call signext i8 (...) @func_c()
%2 = sext i8 %1 to i32
%3 = icmp ne i32 %2, 99
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 3)
unreachable
6: ; preds = %0
ret i8 98
}

LLVM IR (-O2):
define signext i8 @func_b() {
%1 = tail call signext i8 (...) @func_c()
%2 = icmp eq i8 %1, 99
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @exit(i32 3)
unreachable
5: ; preds = %0
ret i8 98
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_tree(void *i, void *u) { printf("%i\n", *(int *)i); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @print_tree(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
scalar_t__ rand();
__attribute__((always_)) uint16_t system_15bit_rand(void) {
  return ((uint16_t)rand()) & 0x7fff;
}


x86 assembly (clang, -O0):
<system_15bit_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_15bit_rand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @system_15bit_rand() {
%1 = call i64 (...) @rand()
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 32767
ret i32 %3
}

LLVM IR (-O2):
define i32 @system_15bit_rand() {
%1 = tail call i64 (...) @rand()
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 32767
ret i32 %3
}
__attribute__((always_)) void pm_runtime_forbid(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @pm_runtime_forbid(%struct.device* nocapture %0) {
ret void
}
int fun1366() { return 1366; }


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

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

LLVM IR (-O0):
define i32 @fun1366() {
ret i32 1366
}

LLVM IR (-O2):
define i32 @fun1366() {
ret i32 1366
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rev(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *st = malloc(sizeof(char) * 255);
  scanf("%s", st);
  rev(st);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xff,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rev@plt>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xff,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
mov    %rax,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <rev@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(255) i8* @malloc(i32 255)
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @rev(i8* %1)
%4 = tail call i32 @putchar(i32 10)
ret i32 0
}
void warn_arg(const char *e) {
  const char *p = optparser_get_arg();
  if (p == ((void *)0))
    warn("%s (null)", e);
  else
    warn("%s \'%s\'", e, p);
}


x86 assembly (clang, -O0):
<warn_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <optparser_get_arg@plt>
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <warn_arg+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <warn@plt>
jmp    1171 <warn_arg+0x51>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <warn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_arg>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <optparser_get_arg@plt>
test   %eax,%eax
je     1144 <warn_arg+0x24>
movslq %eax,%rdx
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <warn@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <warn@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s (null)\00"
@.str.1 = [8 x i8] c"%s '%s'\00"
define void @warn_arg(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i32 (...) @optparser_get_arg()
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @warn to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %16
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @warn to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %14)
br label %16
16: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s (null)\00"
@.str.1 = [8 x i8] c"%s '%s'\00"
define void @warn_arg(i8* %0) {
%2 = tail call i32 (...) @optparser_get_arg()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @warn to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
6: ; preds = %1
%7 = sext i32 %2 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @warn to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %8)
br label %10
10: ; preds = %6, %4
ret void
}
/* Variables and functions */
scalar_t__ c_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *c_strdup(const char *str) {
  char *ret;
  ret = (char *)c_malloc(strlen(str) + 1);
  if (ret == NULL) {
    return NULL;
  }
  strcpy(ret, str);
  return ret;
}


x86 assembly (clang, -O0):
<c_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <c_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <c_strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <c_strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <c_malloc@plt>
test   %rax,%rax
je     115a <c_strdup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <c_strdup+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @c_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @c_malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
scalar_t__ hxd_isspace(unsigned char const, _Bool);
unsigned char skipws(const unsigned char **fmt, _Bool nlok) {
  while (hxd_isspace(**fmt, nlok))
    ++*fmt;
  return **fmt;
}


x86 assembly (clang, -O0):
<skipws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
and    $0x1,%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%cl
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <hxd_isspace@plt>
cmp    $0x0,%rax
je     115a <skipws+0x4a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1124 <skipws+0x14>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipws>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%rax
movzbl (%rax),%edi
call   1030 <hxd_isspace@plt>
test   %rax,%rax
je     114a <skipws+0x3a>
movzbl %bpl,%ebp
nopl   0x0(%rax)
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movzbl 0x1(%rax),%edi
mov    %ebp,%esi
call   1030 <hxd_isspace@plt>
test   %rax,%rax
jne    1130 <skipws+0x20>
mov    (%rbx),%rax
mov    (%rax),%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i8 @skipws(i8** nocapture %0, i1 zeroext %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = tail call i64 @hxd_isspace(i8 zeroext %4, i1 zeroext %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2, %7
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
%10 = load i8, i8* %9
%11 = tail call i64 @hxd_isspace(i8 zeroext %10, i1 zeroext %1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %2
%14 = load i8*, i8** %0
%15 = load i8, i8* %14
ret i8 %15
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
int main() {
  char *str;
  str = "Hello";
  ft_putstr(str);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("USAGE: variload controlfile\n"); }


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"USAGE: variload controlfile\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char c, d;
  c = 'd';
  d = c;
  printf("d = %c\n", d);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"d = %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int strcmp(char *, char *);
int main(int argc, char **argv) {
  char *s1 = "Hello, Programmers!";
  char *s2 = "Hello, Programmers!";
  int ret;
  ret = strcmp(s1, s2);
  if (!ret)
    printf("s1 and s2 are identical");
  else if (ret < 0)
    printf("s1 less than s2");
  else
    printf("s1 greater than s2");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1177 <main+0x57>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x83>
cmpl   $0x0,-0x24(%rbp)
jge    1192 <main+0x72>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <main+0x7e>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x83>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello, Programmers!\00"
@.str.1 = [24 x i8] c"s1 and s2 are identical\00"
@.str.2 = [16 x i8] c"s1 less than s2\00"
@.str.3 = [19 x i8] c"s1 greater than s2\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %7
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i32 @strcmp(i8* %9, i8* %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %24
16: ; preds = %2
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %23
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %24
24: ; preds = %23, %14
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"s1 and s2 are identical\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char *_Locale_extract_time_name(const char *__DUMMY_PAR1, char *__DUMMY_PAR) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_extract_time_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
struct hsearch_data {
  int dummy;
};

/* Variables and functions */
char *search_store(struct hsearch_data *, char *);
int strtol(char *, char **, int);
int check_int_setting(struct hsearch_data *store, char *setting_name) {
  char *setting = search_store(store, setting_name);
  if (!setting) {
    return 0;
  } else {
    return strtol(setting, (char **)NULL, 10);
  }
}


x86 assembly (clang, -O0):
<check_int_setting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <search_store@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1158 <check_int_setting+0x38>
movl   $0x0,-0x4(%rbp)
jmp    116d <check_int_setting+0x4d>
mov    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_int_setting>:
push   %rax
call   1030 <search_store@plt>
test   %rax,%rax
je     113b <check_int_setting+0x1b>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rax
jmp    1040 <strtol@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hsearch_data = type { i32 }
define i32 @check_int_setting(%struct.hsearch_data* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.hsearch_data*
%5 = alloca i8*
%6 = alloca i8*
store %struct.hsearch_data* %0, %struct.hsearch_data** %4
store i8* %1, i8** %5
%7 = load %struct.hsearch_data*, %struct.hsearch_data** %4
%8 = load i8*, i8** %5
%9 = call i8* @search_store(%struct.hsearch_data* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 0, i32* %3
br label %16
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call i32 @strtol(i8* %14, i8** null, i32 10)
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.hsearch_data = type { i32 }
define i32 @check_int_setting(%struct.hsearch_data* %0, i8* %1) {
%3 = tail call i8* @search_store(%struct.hsearch_data* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strtol(i8* nocapture %3, i8** null, i32 10)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}