xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
int mask(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++)
    s[i] ^= 3;
  return 0;
}


x86 assembly (clang, -O0):
<mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    115f <mask+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
xor    $0x3,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <mask+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1148 <mask+0x38>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorb   $0x3,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <mask+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @mask(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = xor i8 %7, 3
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i32 0
}
int pY(int y, int z) {
  if (z) {
    if (y < 120) {
      return ((120 - z) * (120 - y)) / 120;
    } else {
      return 120 + ((120 + z) * (y - 120)) / 120;
    }
  }
}


x86 assembly (clang, -O0):
<pY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115e <pY+0x5e>
cmpl   $0x78,-0x8(%rbp)
jge    1141 <pY+0x41>
mov    $0x78,%eax
sub    -0xc(%rbp),%eax
mov    $0x78,%ecx
sub    -0x8(%rbp),%ecx
imul   %ecx,%eax
mov    $0x78,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    115e <pY+0x5e>
mov    -0xc(%rbp),%eax
add    $0x78,%eax
mov    -0x8(%rbp),%ecx
sub    $0x78,%ecx
imul   %ecx,%eax
mov    $0x78,%ecx
cltd
idiv   %ecx
add    $0x78,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pY>:
test   %esi,%esi
je     1134 <pY+0x34>
cmp    $0x77,%edi
jg     1135 <pY+0x35>
mov    $0x78,%eax
mov    $0x78,%ecx
sub    %esi,%ecx
sub    %edi,%eax
imul   %ecx,%eax
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x6,%eax
add    %ecx,%eax
ret
ret
add    $0x78,%esi
add    $0xffffff88,%edi
imul   %esi,%edi
movslq %edi,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
sar    $0x6,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
add    $0x78,%eax
ret

LLVM IR (-O0):
define i32 @pY(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %26
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 120
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %5
%13 = sub nsw i32 120, %12
%14 = load i32, i32* %4
%15 = sub nsw i32 120, %14
%16 = mul nsw i32 %13, %15
%17 = sdiv i32 %16, 120
store i32 %17, i32* %3
br label %26
18: ; preds = %8
%19 = load i32, i32* %5
%20 = add nsw i32 120, %19
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 120
%23 = mul nsw i32 %20, %22
%24 = sdiv i32 %23, 120
%25 = add nsw i32 120, %24
store i32 %25, i32* %3
br label %26
26: ; preds = %11, %18, %2
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @pY(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = icmp slt i32 %0, 120
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = sub nsw i32 120, %1
%8 = sub nsw i32 120, %0
%9 = mul nsw i32 %7, %8
%10 = sdiv i32 %9, 120
br label %17
11: ; preds = %4
%12 = add nsw i32 %1, 120
%13 = add nsw i32 %0, -120
%14 = mul nsw i32 %12, %13
%15 = sdiv i32 %14, 120
%16 = add nsw i32 %15, 120
br label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ %10, %6 ], [ %16, %11 ], [ undef, %2 ]
ret i32 %18
}
void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature) {}


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

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

LLVM IR (-O0):
%struct.ath10k = type opaque
define void @ath10k_thermal_event_temperature(%struct.ath10k* %0, i32 %1) {
%3 = alloca %struct.ath10k*
%4 = alloca i32
store %struct.ath10k* %0, %struct.ath10k** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.ath10k = type opaque
define void @ath10k_thermal_event_temperature(%struct.ath10k* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int bitor_int(uint8_t a, uint8_t b) { return ((int)a << 8) | ((int)b); }


x86 assembly (clang, -O0):
<bitor_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitor_int>:
mov    %rsi,%rax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bitor_int(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 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @bitor_int(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 8
%5 = trunc i64 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, size_t);
int strlen(char *);
void remove_surrounding_quotes(char *str) {
  size_t nlen = strlen(str) - 2;
  memmove(str, str + 1, nlen);
  *(str + nlen) = '\0';
}


x86 assembly (clang, -O0):
<remove_surrounding_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x2,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memmove@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_surrounding_quotes>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%r14
lea    -0x2(%r14),%rdx
lea    0x1(%rbx),%rsi
mov    %rbx,%rdi
call   1040 <memmove@plt>
movb   $0x0,-0x2(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @remove_surrounding_quotes(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 2
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i64, i64* %3
%12 = call i32 @memmove(i8* %8, i8* %10, i64 %11)
%13 = load i8*, i8** %2
%14 = load i64, i64* %3
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @remove_surrounding_quotes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @memmove(i8* %0, i8* %5, i64 %4)
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %7
ret void
}
int main() {
  int a[10] = {100, 200, 300};
  a[0] = 1000;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movl   $0x64,-0x30(%rbp)
movl   $0xc8,-0x2c(%rbp)
movl   $0x12c,-0x28(%rbp)
movl   $0x3e8,-0x30(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = bitcast i8* %3 to [10 x i32]*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 0
store i32 100, i32* %5
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 1
store i32 200, i32* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i32 0, i32 2
store i32 300, i32* %7
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 1000, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
float mus_char_to_bfloat(const unsigned char *inp) {
  float o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[0];
  outp[1] = inp[1];
  outp[2] = inp[2];
  outp[3] = inp[3];
  return (o);
}


x86 assembly (clang, -O0):
<mus_char_to_bfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_char_to_bfloat>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @mus_char_to_bfloat(i8* %0) {
%2 = alloca i8*
%3 = alloca float
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast float* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
%26 = load float, float* %3
ret float %26
}

LLVM IR (-O2):
define float @mus_char_to_bfloat(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
%19 = bitcast i32 %18 to float
ret float %19
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int main() { initialize(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @initialize()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VISIBLESTRING;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_VISIBLESTRING_it;
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_VISIBLESTRING_it);
}


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

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

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

LLVM IR (-O2):
@ASN1_VISIBLESTRING_it = global i32 0
define i32 @i2d_ASN1_VISIBLESTRING(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @ASN1_VISIBLESTRING_it)
ret i32 %3
}
int main() { return 3 - 3; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int weak();
int baz(void) { return weak() + 1; }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <weak@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
push   %rax
xor    %eax,%eax
call   1030 <weak@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @baz() {
%1 = call i32 (...) @weak()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @baz() {
%1 = tail call i32 (...) @weak()
%2 = add nsw i32 %1, 1
ret i32 %2
}
void foo034(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo034(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S_StopStreamingSound(int /*<<< orphan*/);
void S_StopBackgroundTrack(void) { S_StopStreamingSound(0); }


x86 assembly (clang, -O0):
<S_StopBackgroundTrack>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <S_StopStreamingSound@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_StopBackgroundTrack>:
xor    %edi,%edi
jmp    1030 <S_StopStreamingSound@plt>

LLVM IR (-O0):
define void @S_StopBackgroundTrack() {
%1 = call i32 @S_StopStreamingSound(i32 0)
ret void
}

LLVM IR (-O2):
define void @S_StopBackgroundTrack() {
%1 = tail call i32 @S_StopStreamingSound(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char *, int);
void Sys_Cvar_VariableStringBuffer(const char *var_name, char *buffer,
                                   int bufsize) {
  syscall(7, var_name, buffer, bufsize);
}


x86 assembly (clang, -O0):
<Sys_Cvar_VariableStringBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x7,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_Cvar_VariableStringBuffer>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x7,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define void @Sys_Cvar_VariableStringBuffer(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 7, i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void yaml_free(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<yaml_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <yaml_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaml_free>:
test   %rdi,%rdi
je     111a <yaml_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @yaml_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void modbus_ex_write(unsigned char *packet, unsigned char code) {
  (*(packet + 7)) |= 0x80;
  (*(packet + 8)) = code;
  do {
    *(packet + 4) = (unsigned char)(((3) >> 8) & 0xff);
    *(packet + 4 + 1) = (unsigned char)((3) & 0xff);
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<modbus_ex_write>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%ecx
or     $0x80,%ecx
mov    %cl,0x7(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0x3,0x5(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbus_ex_write>:
orb    $0x80,0x7(%rdi)
mov    %sil,0x8(%rdi)
movw   $0x300,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @modbus_ex_write(i8* nocapture %0, i8 zeroext %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 7
%4 = load i8, i8* %3
%5 = or i8 %4, -128
store i8 %5, i8* %3
%6 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %1, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 4
store i8 0, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 5
store i8 3, i8* %8
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t swapbits(uint8_t b) {
  return (b & 0xaa) | ((b & 0x44) >> 2) | ((b & 0x11) << 2);
}


x86 assembly (clang, -O0):
<swapbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaa,%eax
mov    -0x4(%rbp),%ecx
and    $0x44,%ecx
sar    $0x2,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x11,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapbits>:
mov    %edi,%eax
and    $0xaa,%eax
mov    %edi,%ecx
shr    $0x2,%ecx
and    $0x11,%ecx
or     %eax,%ecx
and    $0x11,%edi
lea    (%rcx,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @swapbits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 170
%5 = load i32, i32* %2
%6 = and i32 %5, 68
%7 = ashr i32 %6, 2
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 17
%11 = shl i32 %10, 2
%12 = or i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @swapbits(i32 %0) {
%2 = and i32 %0, 170
%3 = lshr i32 %0, 2
%4 = and i32 %3, 17
%5 = or i32 %4, %2
%6 = shl i32 %0, 2
%7 = and i32 %6, 68
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ smp_test_rbt_create();
void smp_test_rbt_main() {
  smp_test_rbt_create();
  printf("finished test\n");
}


x86 assembly (clang, -O0):
<smp_test_rbt_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <smp_test_rbt_create@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_test_rbt_main>:
push   %rax
xor    %eax,%eax
call   1040 <smp_test_rbt_create@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"finished test\0A\00"
define void @smp_test_rbt_main() {
%1 = call i32 (...) @smp_test_rbt_create()
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"finished test\00"
define void @smp_test_rbt_main() {
%1 = tail call i32 (...) @smp_test_rbt_create()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
void prompt_nothing(void) {
  char input[64];
  printf("Press Enter to continue: ");
  fgets(input, 64, stdin);
}


x86 assembly (clang, -O0):
<prompt_nothing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    $0x40,%esi
call   1040 <fgets@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_nothing>:
sub    $0x48,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x40,%esi
call   1040 <fgets@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Press Enter to continue: \00"
@stdin = global i32 0
define void @prompt_nothing() {
%1 = alloca [64 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 64, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Press Enter to continue: \00"
@stdin = global i32 0
define void @prompt_nothing() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 64, i32 %4)
ret void
}
void redefine_func() {}


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

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

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

LLVM IR (-O2):
define void @redefine_func() {
ret void
}
void soisfdisconnected(so) struct SLIRPsocket *so;
{}


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

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

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

LLVM IR (-O2):
%struct.SLIRPsocket = type opaque
define void @soisfdisconnected(%struct.SLIRPsocket* nocapture %0) {
ret void
}
/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(void) {
  char ch;
  while ((ch = fgetc(stdin)) != EOF)
    fputc(ch, stdout);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e86(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     117e <main+0x4e>
mov    -0x5(%rbp),%al
mov    0x2e61(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1040 <fputc@plt>
jmp    113f <main+0xf>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2eac(%rip),%r14
mov    (%r14),%edi
call   1030 <fgetc@plt>
mov    0x2e95(%rip),%r15
cmp    (%r15),%al
je     1177 <main+0x47>
mov    0x2e79(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
movsbl %al,%edi
call   1040 <fputc@plt>
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    (%r15),%al
jne    1160 <main+0x30>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i8 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* @stdin
%5 = call signext i8 @fgetc(i32 %4)
store i8 %5, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8, i8* %2
%12 = load i32, i32* @stdout
%13 = call i32 @fputc(i8 signext %11, i32 %12)
br label %3
14: ; preds = %3
%15 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i8 0
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @fgetc(i32 %1)
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %13, label %5
5: ; preds = %0, %5
%6 = phi i8 [ %10, %5 ], [ %2, %0 ]
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputc(i8 signext %6, i32 %7)
%9 = load i32, i32* @stdin
%10 = tail call signext i8 @fgetc(i32 %9)
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %5
13: ; preds = %5, %0
%14 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _irc_queue_insert(int, char *, char *);
int irc_who(char *chan) {
  _irc_queue_insert(5, "WHO %s", chan);
  return 0;
}


x86 assembly (clang, -O0):
<irc_who>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x5,%edi
lea    0xed4(%rip),%rsi
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_who>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    $0x5,%edi
call   1030 <_irc_queue_insert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"WHO %s\00"
define i32 @irc_who(i8* %0) {
%2 = tail call i32 @_irc_queue_insert(i32 5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CStrings__transcode_ISO_string_to_UTF8(char *, char *);
void Platform__transcode_ISO_string_to_locale(char *from, char *to) {
  CStrings__transcode_ISO_string_to_UTF8(from, to);
}


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

x86 assembly (clang, -O2):
<Platform__transcode_ISO_string_to_locale>:
jmp    1030 <CStrings__transcode_ISO_string_to_UTF8@plt>

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

LLVM IR (-O2):
define void @Platform__transcode_ISO_string_to_locale(i8* %0, i8* %1) {
%3 = tail call i32 @CStrings__transcode_ISO_string_to_UTF8(i8* %0, i8* %1)
ret void
}
void XtMalloc() {}


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

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

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

LLVM IR (-O2):
define void @XtMalloc() {
ret void
}
/* Variables and functions */
size_t hash(const char *key) {
  unsigned const char *uKey;
  size_t val;
  uKey = (unsigned const char *)key;
  val = 0;
  while (*uKey) {
    val = val * (37) + *uKey;
    ++uKey;
  }
  return val;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <hash+0x49>
imul   $0x25,-0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <hash+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hash+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,8),%rdx
lea    (%rax,%rdx,4),%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 37
%9 = zext i8 %5 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void stack_prefault(void) {
  unsigned char dummy[(1024 * 1024)];
  memset(dummy, 0, (1024 * 1024));
}


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

x86 assembly (clang, -O2):
<stack_prefault>:
sub    $0x100008,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1030 <memset@plt>
add    $0x100008,%rsp
ret

LLVM IR (-O0):
define void @stack_prefault() {
%1 = alloca [1048576 x i8]
%2 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 1048576)
ret void
}

LLVM IR (-O2):
define void @stack_prefault() {
%1 = alloca [1048576 x i8]
%2 = getelementptr inbounds [1048576 x i8], [1048576 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 1048576)
ret void
}
/* Variables and functions */
void *calloc(size_t, int);
int /*<<< orphan*/ fatal(char *, size_t);
void *xcalloc(size_t size) {
  void *r = calloc(size, 1);
  if (r == NULL && size != 0)
    fatal("Failed to malloc %zu bytes.\n", size);
  return r;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <xcalloc+0x44>
cmpq   $0x0,-0x8(%rbp)
je     1164 <xcalloc+0x44>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     114d <xcalloc+0x2d>
test   %r14,%r14
jne    114d <xcalloc+0x2d>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <fatal@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Failed to malloc %zu bytes.\0A\00"
define i8* @xcalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i64 %4, i32 1)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i64, i64* %2
%13 = call i32 @fatal(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %11, %8, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [29 x i8] c"Failed to malloc %zu bytes.\0A\00"
define i8* @xcalloc(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safe_free(void *buf) {
  if (buf)
    free(buf);
}


x86 assembly (clang, -O0):
<safe_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <safe_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_free>:
test   %rdi,%rdi
je     111a <safe_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @safe_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ia_unsetbit8(uint8_t byte, int i) { return byte & ~(1 << i); }


x86 assembly (clang, -O0):
<ia_unsetbit8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ia_unsetbit8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ia_unsetbit8(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
void Lcd_Delay(int a) {
  int j;
  int i;
  for (i = 0; i < a; i++) {
    for (j = 0; j < 100; j++) {
    }
  }
}


x86 assembly (clang, -O0):
<Lcd_Delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <Lcd_Delay+0x51>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    113e <Lcd_Delay+0x3e>
jmp    1130 <Lcd_Delay+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <Lcd_Delay+0x21>
jmp    1143 <Lcd_Delay+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <Lcd_Delay+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Lcd_Delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %5
store i32 0, i32* %3
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 100
br i1 %12, label %13, label %17
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %10
17: ; preds = %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %5
21: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @Lcd_Delay(i32 %0) {
ret void
}
void av_escape() {}


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

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

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

LLVM IR (-O2):
define void @av_escape() {
ret void
}
void f() {
  int icnt;
  sizeof(int[icnt]);
  __alignof__(int[icnt]);
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = zext i32 %2 to i64
%4 = mul nuw i64 4, %3
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
void foo302() {}


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

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

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

LLVM IR (-O2):
define void @foo302() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void LES_MemoryFree(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<LES_MemoryFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @LES_MemoryFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void intReset() {}


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

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

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

LLVM IR (-O2):
define void @intReset() {
ret void
}
void INT_Excep_PERIB_INTB195(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB195() {
ret void
}
unsigned char read_do(int n) { return ((n % 3) != 0); }


x86 assembly (clang, -O0):
<read_do>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_do>:
imul   $0xaaaaaaab,%edi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
setae  %al
ret

LLVM IR (-O0):
define zeroext i8 @read_do(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @read_do(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setstacksize(int /*<<< orphan*/ *, size_t);
int my_pthread_attr_setstacksize(pthread_attr_t *__attr, size_t stack_size) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_setstacksize(realattr, stack_size);
}


x86 assembly (clang, -O0):
<my_pthread_attr_setstacksize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_attr_setstacksize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_setstacksize>:
movslq (%rdi),%rdi
jmp    1030 <pthread_attr_setstacksize@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setstacksize(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i64, i64* %4
%12 = call i32 @pthread_attr_setstacksize(i32* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setstacksize(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_setstacksize(i32* %5, i64 %1)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ WEOF;
wint_t getwc(FILE *stream) {
  ;
  return WEOF;
}


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

x86 assembly (clang, -O2):
<getwc>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@WEOF = global i32 0
define i32 @getwc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @WEOF
ret i32 %3
}

LLVM IR (-O2):
@WEOF = global i32 0
define i32 @getwc(i32* nocapture readnone %0) {
%2 = load i32, i32* @WEOF
ret i32 %2
}
void func8(void) { int array[] = {[0 ... 5] = 1, [6 ... 10] = 10}; }


x86 assembly (clang, -O0):
<func8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x2c,%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.func8.array = [11 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 10, i32 10, i32 10, i32 10, i32 10]
define void @func8() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @func8() {
ret void
}
/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ ungetch(int);
void ungets(char s[]) {
  size_t slen = strlen(s);
  while (slen > 0)
    ungetch((int)s[--slen]);
  s[0] = '\0';
}


x86 assembly (clang, -O0):
<ungets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1166 <ungets+0x46>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
movsbl -0x1(%rax,%rcx,1),%edi
call   1040 <ungetch@plt>
jmp    1139 <ungets+0x19>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %rax,%rax
je     1151 <ungets+0x31>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl -0x1(%r14,%rbx,1),%edi
call   1040 <ungetch@plt>
add    $0xffffffffffffffff,%rbx
jne    1140 <ungets+0x20>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ungets(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ %2, %1 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = tail call i32 @ungetch(i32 %9)
%11 = icmp eq i64 %6, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
store i8 0, i8* %0
ret void
}
/* Variables and functions */
int docmdargs(char *, int);
int DOsite() { return (docmdargs("SITE", 1)); }


x86 assembly (clang, -O0):
<DOsite>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <docmdargs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DOsite>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <docmdargs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"SITE\00"
define i32 @DOsite() {
%1 = call i32 @docmdargs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"SITE\00"
define i32 @DOsite() {
%1 = tail call i32 @docmdargs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XUnmapEvent;

/* Variables and functions */
void set_XUnmapEvent_type(void *_p, int _v) {
  ((XUnmapEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XUnmapEvent_type>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XUnmapEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}