xunge/DecIR huggingface dataset:
/* Type definitions */
struct geometry_struct {
  int dummy;
};

/* Variables and functions */
int A_within_B(struct geometry_struct *, struct geometry_struct *, int);
int cone_within_cone(struct geometry_struct *geometry_child,
                     struct geometry_struct *geometry_parent) {
  return A_within_B(geometry_child, geometry_parent, (int)300);
}


x86 assembly (clang, -O0):
<cone_within_cone>:
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    $0x12c,%edx
call   1030 <A_within_B@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cone_within_cone>:
mov    $0x12c,%edx
jmp    1030 <A_within_B@plt>

LLVM IR (-O0):
%struct.geometry_struct = type { i32 }
define i32 @cone_within_cone(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = alloca %struct.geometry_struct*
%4 = alloca %struct.geometry_struct*
store %struct.geometry_struct* %0, %struct.geometry_struct** %3
store %struct.geometry_struct* %1, %struct.geometry_struct** %4
%5 = load %struct.geometry_struct*, %struct.geometry_struct** %3
%6 = load %struct.geometry_struct*, %struct.geometry_struct** %4
%7 = call i32 @A_within_B(%struct.geometry_struct* %5, %struct.geometry_struct* %6, i32 300)
ret i32 %7
}

LLVM IR (-O2):
%struct.geometry_struct = type { i32 }
define i32 @cone_within_cone(%struct.geometry_struct* %0, %struct.geometry_struct* %1) {
%3 = tail call i32 @A_within_B(%struct.geometry_struct* %0, %struct.geometry_struct* %1, i32 300)
ret i32 %3
}
/* Variables and functions */
scalar_t__ getsockname(int, void *, int *);
int recv(int, void *, int, int);
int recvfrom(int fd, void *a, int n, int flags, void *from, int *fromlen) {
  if (getsockname(fd, from, fromlen) < 0)
    return -1;
  return recv(fd, a, n, flags);
}


x86 assembly (clang, -O0):
<recvfrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <getsockname@plt>
cmp    $0x0,%rax
jge    1163 <recvfrom+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <recvfrom+0x58>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <recv@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvfrom>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %r8,%rsi
mov    %r9,%rdx
call   1040 <getsockname@plt>
test   %rax,%rax
js     115c <recvfrom+0x3c>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <recv@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @recvfrom(i32 %0, i8* %1, i32 %2, i32 %3, i8* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32*
store i32 %0, i32* %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32* %5, i32** %13
%14 = load i32, i32* %8
%15 = load i8*, i8** %12
%16 = load i32*, i32** %13
%17 = call i64 @getsockname(i32 %14, i8* %15, i32* %16)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 -1, i32* %7
br label %26
20: ; preds = %6
%21 = load i32, i32* %8
%22 = load i8*, i8** %9
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = call i32 @recv(i32 %21, i8* %22, i32 %23, i32 %24)
store i32 %25, i32* %7
br label %26
26: ; preds = %20, %19
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @recvfrom(i32 %0, i8* %1, i32 %2, i32 %3, i8* %4, i32* %5) {
%7 = tail call i64 @getsockname(i32 %0, i8* %4, i32* %5)
%8 = icmp slt i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 %3)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ %10, %9 ], [ -1, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ verify_v3_kdf(char *, char *, char *, char *, char *);
void test_v3_kdf_One_byte(void) {
  verify_v3_kdf("One byte", "3", "a", "0102030405060708",
                "fc632b0c a6b23eff 9a9dc3e0 e585167f 5a328916 ed19f835 "
                "58be3ba9 828797cd");
}


x86 assembly (clang, -O0):
<test_v3_kdf_One_byte>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee2(%rip),%rdx
lea    0xedd(%rip),%rcx
lea    0xee7(%rip),%r8
call   1030 <verify_v3_kdf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_v3_kdf_One_byte>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xee6(%rip),%rdx
lea    0xee1(%rip),%rcx
lea    0xeeb(%rip),%r8
jmp    1030 <verify_v3_kdf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"One byte\00"
@.str.1 = [2 x i8] c"3\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [17 x i8] c"0102030405060708\00"
@.str.4 = [72 x i8] c"fc632b0c a6b23eff 9a9dc3e0 e585167f 5a328916 ed19f835 58be3ba9 828797cd\00"
define void @test_v3_kdf_One_byte() {
%1 = call i32 @verify_v3_kdf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"One byte\00"
@.str.1 = [2 x i8] c"3\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [17 x i8] c"0102030405060708\00"
@.str.4 = [72 x i8] c"fc632b0c a6b23eff 9a9dc3e0 e585167f 5a328916 ed19f835 58be3ba9 828797cd\00"
define void @test_v3_kdf_One_byte() {
%1 = tail call i32 @verify_v3_kdf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int shlib_shlibcalled();
int shlib_shlibcall() { return shlib_shlibcalled(); }


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

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

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

LLVM IR (-O2):
define i32 @shlib_shlibcall() {
%1 = tail call i32 (...) @shlib_shlibcalled()
ret i32 %1
}
/* Variables and functions */
long rand();
void pick_site_far(long id[2]) {
  id[0] = rand();
  id[1] = rand();
}


x86 assembly (clang, -O0):
<pick_site_far>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick_site_far>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @pick_site_far(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @rand()
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
store i64 %3, i64* %5
%6 = call i64 (...) @rand()
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
store i64 %6, i64* %8
ret void
}

LLVM IR (-O2):
define void @pick_site_far(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @rand()
store i64 %2, i64* %0
%3 = tail call i64 (...) @rand()
%4 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %3, i64* %4
ret void
}
void back(void) {}


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

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

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

LLVM IR (-O2):
define void @back() {
ret void
}
int test_bit(unsigned long *set, int bit) {
  return !!(set[bit / (sizeof(unsigned long) * 8)] &
            (1UL << (bit % (sizeof(unsigned long) * 8))));
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
movslq %esi,%rcx
mov    %rcx,%rax
shr    $0x6,%rax
mov    (%rdi,%rax,8),%rdx
xor    %eax,%eax
bt     %rcx,%rdx
setb   %al
ret

LLVM IR (-O0):
define i32 @test_bit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 64
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load i64, i64* %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = urem i64 %12, 64
%14 = shl i64 1, %13
%15 = and i64 %10, %14
%16 = icmp ne i64 %15, 0
%17 = xor i1 %16, true
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_bit(i64* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = lshr i64 %3, 6
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = and i64 %3, 63
%8 = shl nuw i64 1, %7
%9 = and i64 %6, %8
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
struct wl_resource {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/);
void wl_output_send_scale(struct wl_resource *resource_, int32_t factor) {
  wl_resource_post_event(resource_, 3, factor);
}


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

x86 assembly (clang, -O2):
<wl_output_send_scale>:
mov    %esi,%edx
mov    $0x3,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_output_send_scale(%struct.wl_resource* %0, i32 %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %3
store i32 %1, i32* %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load i32, i32* %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 3, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_output_send_scale(%struct.wl_resource* %0, i32 %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void add_reg32_imm8(unsigned int reg32, unsigned char imm8) {
  put8(0x83);
  put8(0xC0 + reg32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<add_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x83,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xc0,%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x5(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_reg32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x83,%edi
call   1030 <put8@plt>
add    $0xc0,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @add_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -125)
%6 = load i32, i32* %3
%7 = add i32 192, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @put8(i8 zeroext %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @add_reg32_imm8(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -125)
%4 = trunc i32 %0 to i8
%5 = add i8 %4, -64
%6 = tail call i32 @put8(i8 zeroext %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
void CG_PrevItem_f(void) {}


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

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

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

LLVM IR (-O2):
define void @CG_PrevItem_f() {
ret void
}
int test_imm_B9uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xB9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B9uint64_midword_reg>:
test   $0xb90000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B9uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12124160
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int min(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dsvariancepn(int /*<<< orphan*/ const, float const,
                                   float const *, int /*<<< orphan*/ const);
double stdlib_strided_dsvariance(const int64_t N, const float correction,
                                 const float *X, const int64_t stride) {
  return stdlib_strided_dsvariancepn(N, correction, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dsvariance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_dsvariancepn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dsvariance>:
jmp    1030 <stdlib_strided_dsvariancepn@plt>

LLVM IR (-O0):
define double @stdlib_strided_dsvariance(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float* %2, float** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load float*, float** %7
%12 = load i32, i32* %8
%13 = call double @stdlib_strided_dsvariancepn(i32 %9, float %10, float* %11, i32 %12)
ret double %13
}

LLVM IR (-O2):
define double @stdlib_strided_dsvariance(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call double @stdlib_strided_dsvariancepn(i32 %0, float %1, float* %2, i32 %3)
ret double %5
}
void docompletehalt(s) int s;
{ exit(0); }


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

x86 assembly (clang, -O2):
<docompletehalt>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @docompletehalt(i32 %0) {
tail call void @exit(i32 0)
unreachable
}
int test_imm_83int8_reg(signed char val) {
  return ((val) & (0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x83,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_83int8_reg>:
test   $0x83,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_83int8_reg(i8 signext %0) {
%2 = and i8 %0, -125
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int func(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @func(i32 returned %0) {
ret i32 %0
}
int main(int argc, char *argv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ls(char param[]) {
  printf("ls command \n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"ls command \0A\00"
define void @ls(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"ls command \00"
define void @ls(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void gtk_cell_view_new_with_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_view_new_with_pixbuf() {
ret void
}
char *dngettext(const char *domainname, const char *msgid1, const char *msgid2,
                unsigned long n) {
  (void)domainname;
  return (char *)((n == 1) ? msgid1 : msgid2);
}


x86 assembly (clang, -O0):
<dngettext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jne    112c <dngettext+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1134 <dngettext+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dngettext>:
mov    %rsi,%rax
cmp    $0x1,%rcx
cmovne %rdx,%rax
ret

LLVM IR (-O0):
define i8* @dngettext(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %8
%11 = icmp eq i64 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i8*, i8** %6
br label %16
14: ; preds = %4
%15 = load i8*, i8** %7
br label %16
16: ; preds = %14, %12
%17 = phi i8* [ %13, %12 ], [ %15, %14 ]
ret i8* %17
}

LLVM IR (-O2):
define i8* @dngettext(i8* nocapture readnone %0, i8* readnone %1, i8* readnone %2, i64 %3) {
%5 = icmp eq i64 %3, 1
%6 = select i1 %5, i8* %1, i8* %2
ret i8* %6
}
int upnp_get_portmapping_number_of_entries() { return 42; }


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

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

LLVM IR (-O0):
define i32 @upnp_get_portmapping_number_of_entries() {
ret i32 42
}

LLVM IR (-O2):
define i32 @upnp_get_portmapping_number_of_entries() {
ret i32 42
}
int g(int i, int j) {
  int k = i != -512;
  return k;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xfffffe00,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
cmp    $0xfffffe00,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, -512
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void arch(void) { printf("ARCH2\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"ARCH2\00"
define void @arch() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char mychar;
  while (1) {
    printf("Enter a characater:\n");
    scanf("%c", &mychar);
    printf("--%c--\n", mychar);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xecc(%rip),%r14
lea    0xeba(%rip),%r15
lea    0x7(%rsp),%r12
lea    0xeb1(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [21 x i8] c"Enter a characater:\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [8 x i8] c"--%c--\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %7)
br label %3
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [8 x i8] c"--%c--\0A\00"
@str = [20 x i8] c"Enter a characater:\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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* %1)
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %6)
br label %2
}
/* Variables and functions */
int gfx_set_video_upscale(unsigned short, unsigned short, unsigned short,
                          unsigned short);
int sc1200_set_video_scale(unsigned short srcw, unsigned short srch,
                           unsigned short dstw, unsigned short dsth) {
  return gfx_set_video_upscale(srcw, srch, dstw, dsth);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movzwl %dx,%edi
movzwl %cx,%esi
movzwl %ax,%edx
movzwl -0x8(%rbp),%ecx
call   1030 <gfx_set_video_upscale@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sc1200_set_video_scale(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = load i16, i16* %7
%12 = load i16, i16* %8
%13 = call i32 @gfx_set_video_upscale(i16 zeroext %9, i16 zeroext %10, i16 zeroext %11, i16 zeroext %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @sc1200_set_video_scale(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = tail call i32 @gfx_set_video_upscale(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv, char **envp) {
  printf("Hello, World!\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int setecho(int echo) {
  if (echo == 1)
    system("stty echo");
  else if (echo == 0)
    system("stty -echo");
  else
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<setecho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1136 <setecho+0x26>
lea    0xed4(%rip),%rdi
call   1030 <system@plt>
jmp    1162 <setecho+0x52>
cmpl   $0x0,-0x8(%rbp)
jne    1151 <setecho+0x41>
lea    0xec3(%rip),%rdi
call   1030 <system@plt>
jmp    115d <setecho+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1169 <setecho+0x59>
jmp    1162 <setecho+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setecho>:
cmp    $0x1,%edi
je     1124 <setecho+0x14>
xor    %eax,%eax
test   %edi,%edi
jne    113a <setecho+0x2a>
lea    0xee8(%rip),%rdi
jmp    112b <setecho+0x1b>
lea    0xed5(%rip),%rdi
push   %rax
call   1030 <system@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"stty echo\00"
@.str.1 = [11 x i8] c"stty -echo\00"
define i32 @setecho(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %16
14: ; preds = %11
br label %15
15: ; preds = %14, %6
store i32 1, i32* %2
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [10 x i8] c"stty echo\00"
@.str.1 = [11 x i8] c"stty -echo\00"
define i32 @setecho(i32 %0) {
switch i32 %0, label %6 [
i32 1, label %3
i32 0, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %1 ]
%5 = tail call i32 @system(i8* %4)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ 0, %1 ], [ 1, %3 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *clad_gar_free(void *arr) {
  free(arr);
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @clad_gar_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i8* null
}
/* Variables and functions */
unsigned long get_fs();
int prog();
int /*<<< orphan*/ set_fs(void *);
int main(void) {
  int status;
  unsigned long glibc_fs = get_fs();
  status = prog();
  set_fs((void *)glibc_fs);
  return status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_fs@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <prog@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <set_fs@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <get_fs@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <prog@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <set_fs@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
%4 = call i64 (...) @get_fs()
store i64 %4, i64* %3
%5 = call i32 (...) @prog()
store i32 %5, i32* %2
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i8*
%8 = call i32 @set_fs(i8* %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @get_fs()
%2 = tail call i32 (...) @prog()
%3 = inttoptr i64 %1 to i8*
%4 = tail call i32 @set_fs(i8* %3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ stopMonkeying();
void interruptHandler(int signal) { stopMonkeying(); }


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

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

LLVM IR (-O0):
define void @interruptHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @stopMonkeying()
ret void
}

LLVM IR (-O2):
define void @interruptHandler(i32 %0) {
%2 = tail call i32 (...) @stopMonkeying()
ret void
}
/* Variables and functions */
char *_resposta_padrao(int, int, char *);
char *TrocarCodigoDeAtivacao(int sessao, char *codigo_ativacao, int opcao,
                             char *novo_codigo, char *novo_codigo_confirmacao) {
  char *mensagem = "C"
                   "\xc3\xb3"
                   "digo de "
                   "ativa"
                   "\xc3\xa7\xc3\xa3"
                   "o alterado com sucesso";
  return _resposta_padrao(sessao, 18000, mensagem);
}


x86 assembly (clang, -O0):
<TrocarCodigoDeAtivacao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xecf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rdx
mov    $0x4650,%esi
call   1030 <_resposta_padrao@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrocarCodigoDeAtivacao>:
lea    0xee9(%rip),%rdx
mov    $0x4650,%esi
jmp    1030 <_resposta_padrao@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"C\C3\B3digo de ativa\C3\A7\C3\A3o alterado com sucesso\00"
define i8* @TrocarCodigoDeAtivacao(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8** %11
%12 = load i32, i32* %6
%13 = load i8*, i8** %11
%14 = call i8* @_resposta_padrao(i32 %12, i32 18000, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [43 x i8] c"C\C3\B3digo de ativa\C3\A7\C3\A3o alterado com sucesso\00"
define i8* @TrocarCodigoDeAtivacao(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i8* @_resposta_padrao(i32 %0, i32 18000, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char **argv) {
  parse_args(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
ret i32 0
}
void t7() {
  struct tag7 {
    int a;
    int b;
  } x;
  struct tag7 *p = &x;
  x.b = 71;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c",
          54, 71, (*p).b);
  ;
}


x86 assembly (clang, -O0):
<t7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x47,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
lea    0xecb(%rip),%rdi
mov    $0x36,%esi
mov    $0x47,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t7>:
lea    0xee9(%rip),%rdi
mov    $0x36,%esi
mov    $0x47,%edx
mov    $0x47,%ecx
xor    %eax,%eax
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.tag7 = type { i32, i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t7() {
%1 = alloca %struct.tag7
%2 = alloca %struct.tag7*
store %struct.tag7* %1, %struct.tag7** %2
%3 = getelementptr inbounds %struct.tag7, %struct.tag7* %1, i32 0, i32 1
store i32 71, i32* %3
%4 = load %struct.tag7*, %struct.tag7** %2
%5 = getelementptr inbounds %struct.tag7, %struct.tag7* %4, i32 0, i32 1
%6 = load i32, i32* %5
%7 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 54, i32 71, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.tag7 = type { i32, i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t7() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 54, i32 71, i32 71)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *getenv(char *);
main() {
  char *s;
  s = getenv("ABCDE");
  exit(s == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ABCDE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"ABCDE\00"
define i32 @main() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
char *insert_env(char *, int);
char *replace_env(char *replaced, int length) {
  char *env = replaced;
  int old_len = *env++;
  env += old_len;
  old_len += 2 + *env++;
  return insert_env(replaced, length - old_len);
}


x86 assembly (clang, -O0):
<replace_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
add    $0x2,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    -0x1c(%rbp),%esi
call   1030 <insert_env@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_env>:
movsbq (%rdi),%rax
movsbl 0x1(%rdi,%rax,1),%ecx
add    %eax,%ecx
sub    %ecx,%esi
add    $0xfffffffe,%esi
jmp    1030 <insert_env@plt>

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

LLVM IR (-O2):
define i8* @replace_env(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = sext i8 %4 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add i32 %1, -2
%11 = add nsw i32 %5, %9
%12 = sub i32 %10, %11
%13 = tail call i8* @insert_env(i8* %0, i32 %12)
ret i8* %13
}
int create_sensor_update() {}


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

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

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

LLVM IR (-O2):
define i32 @create_sensor_update() {
ret i32 undef
}
void *atomic_ptr_cas(void **ptr, void *old, void *new) {
  void *retval;
  __asm__ volatile("lock cmpxchg %2, %1"
                   : "=a"(retval), "=m"(*ptr)
                   : "r"(new), "m"(*ptr), "0"(old)
                   : "cc");
  return retval;
}


x86 assembly (clang, -O0):
<atomic_ptr_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
lock cmpxchg %rdx,(%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_ptr_cas>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @atomic_ptr_cas(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %6
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %5
%12 = call i8* asm sideeffect "lock cmpxchg $2, $1", "={ax},=*m,r,*m,0,~{cc},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %8, i8* %9, i8** elementtype(i8*) %10, i8* %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
ret i8* %13
}

LLVM IR (-O2):
define i8* @atomic_ptr_cas(i8** %0, i8* %1, i8* %2) {
%4 = tail call i8* asm sideeffect "lock cmpxchg $2, $1", "={ax},=*m,r,*m,0,~{cc},~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %0, i8* %2, i8** elementtype(i8*) %0, i8* %1)
ret i8* %4
}
void foo641(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo641(i32 %0) {
ret void
}
double foo(int a, double b, float c) { return b; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @foo(i32 %0, double %1, float %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca float
store i32 %0, i32* %4
store double %1, double* %5
store float %2, float* %6
%7 = load double, double* %5
ret double %7
}

LLVM IR (-O2):
define double @foo(i32 %0, double returned %1, float %2) {
ret double %1
}
/* Variables and functions */
int mpop();
int /*<<< orphan*/ mpush(int);
void shl() { mpush(mpop() << 1); }


x86 assembly (clang, -O0):
<shl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mpop@plt>
mov    %eax,%edi
shl    $0x1,%edi
call   1040 <mpush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl>:
push   %rax
xor    %eax,%eax
call   1030 <mpop@plt>
lea    (%rax,%rax,1),%edi
pop    %rax
jmp    1040 <mpush@plt>

LLVM IR (-O0):
define void @shl() {
%1 = call i32 (...) @mpop()
%2 = shl i32 %1, 1
%3 = call i32 @mpush(i32 %2)
ret void
}

LLVM IR (-O2):
define void @shl() {
%1 = tail call i32 (...) @mpop()
%2 = shl i32 %1, 1
%3 = tail call i32 @mpush(i32 %2)
ret void
}
__attribute__((no)) void f(unsigned *y) {
  char x;
  char *volatile p = &x;
  char *volatile q = (char *)y;
  assert(p < q);
  assert(q - p < 1024);
  memset(&x, 0xab, q - p + sizeof(*y));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cmp    %rcx,%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x400,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
sub    %rax,%rdx
add    $0x4,%rdx
lea    -0x9(%rbp),%rdi
mov    $0xab,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
lea    0x7(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    %rdi,0x8(%rsp)
mov    0x10(%rsp),%rax
xor    %edi,%edi
cmp    0x8(%rsp),%rax
setb   %dil
xor    %eax,%eax
call   1030 <assert@plt>
mov    0x8(%rsp),%rax
sub    0x10(%rsp),%rax
xor    %edi,%edi
cmp    $0x400,%rax
setl   %dil
xor    %eax,%eax
call   1030 <assert@plt>
mov    0x8(%rsp),%rax
mov    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @f(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %2
store volatile i8* %3, i8** %4
%6 = load i32*, i32** %2
%7 = bitcast i32* %6 to i8*
store volatile i8* %7, i8** %5
%8 = load volatile i8*, i8** %4
%9 = load volatile i8*, i8** %5
%10 = icmp ult i8* %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
%13 = load volatile i8*, i8** %5
%14 = load volatile i8*, i8** %4
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = icmp slt i64 %17, 1024
%19 = zext i1 %18 to i32
%20 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %19)
%21 = load volatile i8*, i8** %5
%22 = load volatile i8*, i8** %4
%23 = ptrtoint i8* %21 to i64
%24 = ptrtoint i8* %22 to i64
%25 = sub i64 %23, %24
%26 = add i64 %25, 4
ret void
}

LLVM IR (-O2):
define void @f(i32* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %3 to i8*
store volatile i8* %2, i8** %3
%6 = bitcast i8** %4 to i8*
%7 = bitcast i32* %0 to i8*
store volatile i8* %7, i8** %4
%8 = load volatile i8*, i8** %3
%9 = load volatile i8*, i8** %4
%10 = icmp ult i8* %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
%13 = load volatile i8*, i8** %4
%14 = load volatile i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = icmp slt i64 %17, 1024
%19 = zext i1 %18 to i32
%20 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %19)
%21 = load volatile i8*, i8** %4
%22 = load volatile i8*, i8** %3
ret void
}