xunge/DecIR huggingface dataset:
unsigned char getBit(unsigned char byte, int position) {
  return (byte >> position) & 0x01;
}


x86 assembly (clang, -O0):
<getBit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @getBit(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = and i32 %8, 1
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @getBit(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = lshr i32 %3, %1
%5 = trunc i32 %4 to i8
%6 = and i8 %5, 1
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ bson_find_field(char *, char *, int);
int bson_find_field_as_int32(char *buffer, char *field, int32_t *data) {
  char *tmp = (char *)bson_find_field(buffer, field, 0x10);
  if (tmp) {
    *data = ((int32_t *)tmp)[0];
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bson_find_field_as_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <bson_find_field@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     115d <bson_find_field_as_int32+0x4d>
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1164 <bson_find_field_as_int32+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_find_field_as_int32>:
push   %rbx
mov    %rdx,%rbx
mov    $0x10,%edx
call   1030 <bson_find_field@plt>
test   %rax,%rax
je     112e <bson_find_field_as_int32+0x1e>
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bson_find_field_as_int32(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = tail call i64 @bson_find_field(i8* %0, i8* %1, i32 16)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = inttoptr i64 %4 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %2
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int monitor(int argc, char **argv) {
  if (argc) {
  }
  if (argv) {
  }
  fprintf(stderr,
          "tup error: The file monitor is not supported on this platform.\n");
  return -1;
}


x86 assembly (clang, -O0):
<monitor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112e <monitor+0x1e>
jmp    112e <monitor+0x1e>
cmpq   $0x0,-0x10(%rbp)
je     113e <monitor+0x2e>
jmp    113e <monitor+0x2e>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monitor>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"tup error: The file monitor is not supported on this platform.\0A\00"
define i32 @monitor(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %8
8: ; preds = %7, %2
%9 = load i8**, i8*** %4
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %12
11: ; preds = %8
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"tup error: The file monitor is not supported on this platform.\0A\00"
define i32 @monitor(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
struct ev_loop *ev_default_loop_uc_(void) {
  extern struct ev_loop *ev_default_loop_ptr;
  return ev_default_loop_ptr;
}


x86 assembly (clang, -O0):
<ev_default_loop_uc_>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ev_loop = type opaque
@ev_default_loop_ptr = external global %struct.ev_loop*
define %struct.ev_loop* @ev_default_loop_uc_() {
%1 = load %struct.ev_loop*, %struct.ev_loop** @ev_default_loop_ptr
ret %struct.ev_loop* %1
}

LLVM IR (-O2):
%struct.ev_loop = type opaque
@ev_default_loop_ptr = external global %struct.ev_loop*
define %struct.ev_loop* @ev_default_loop_uc_() {
%1 = load %struct.ev_loop*, %struct.ev_loop** @ev_default_loop_ptr
ret %struct.ev_loop* %1
}
/* Variables and functions */
int /*<<< orphan*/ flick_mem(char *, int, int, int /*<<< orphan*/, int);
void i_rxx_mem(void) { flick_mem("rc", 1, 1, 0, 1); }


x86 assembly (clang, -O0):
<i_rxx_mem>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%r8d
xor    %ecx,%ecx
mov    %r8d,%esi
mov    %r8d,%edx
call   1030 <flick_mem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_rxx_mem>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <flick_mem@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rc\00"
define void @i_rxx_mem() {
%1 = call i32 @flick_mem(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"rc\00"
define void @i_rxx_mem() {
%1 = tail call i32 @flick_mem(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ video_init(int, int);
void fly_init(int argc, char **argv, char **envp) { video_init(80, 24); }


x86 assembly (clang, -O0):
<fly_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x50,%edi
mov    $0x18,%esi
call   1030 <video_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fly_init>:
mov    $0x50,%edi
mov    $0x18,%esi
jmp    1030 <video_init@plt>

LLVM IR (-O0):
define void @fly_init(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 @video_init(i32 80, i32 24)
ret void
}

LLVM IR (-O2):
define void @fly_init(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @video_init(i32 80, i32 24)
ret void
}
void RTStrmOpenF(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmOpenF() {
ret void
}
void display_grid() {}


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

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

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

LLVM IR (-O2):
define void @display_grid() {
ret void
}
/* Variables and functions */
size_t strlen(char *);
char *trimLastSlash(char *str) {
  size_t slen = strlen(str);
  if (slen > 0 && str[slen - 1] == '/') {
    str[slen - 1] = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<trimLastSlash>:
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    115d <trimLastSlash+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    115d <trimLastSlash+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimLastSlash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     112a <trimLastSlash+0x1a>
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    112a <trimLastSlash+0x1a>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @trimLastSlash(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
%6 = load i64, i64* %3
%7 = icmp ugt i64 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i64, i64* %3
%11 = sub i64 %10, 1
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 47
br i1 %15, label %16, label %21
16: ; preds = %8
%17 = load i8*, i8** %2
%18 = load i64, i64* %3
%19 = sub i64 %18, 1
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
br label %21
21: ; preds = %16, %8, %1
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @trimLastSlash(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %9, label %10
9: ; preds = %4
store i8 0, i8* %6
br label %10
10: ; preds = %9, %4, %1
ret i8* %0
}
int redhttp_negotiate_round(double d) {
  if (d >= 0)
    return (int)(d + 0.5);
  else
    return (int)(d - 0.5);
}


x86 assembly (clang, -O0):
<redhttp_negotiate_round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <redhttp_negotiate_round+0x34>
movsd  0xedd(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <redhttp_negotiate_round+0x4c>
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<redhttp_negotiate_round>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @redhttp_negotiate_round(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fsub double %11, 5.000000e-01
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @redhttp_negotiate_round(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
const char *vde_chain_nm7_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  case 2:
    return "o2";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<vde_chain_nm7_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <vde_chain_nm7_name_out+0x3c>
jmp    111a <vde_chain_nm7_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <vde_chain_nm7_name_out+0x4c>
jmp    112b <vde_chain_nm7_name_out+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <vde_chain_nm7_name_out+0x5c>
jmp    116c <vde_chain_nm7_name_out+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm7_name_out+0x74>
lea    0xeb0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm7_name_out+0x74>
lea    0xea3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm7_name_out+0x74>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm7_name_out>:
cmp    $0x2,%edi
ja     1117 <vde_chain_nm7_name_out+0x17>
movslq %edi,%rax
lea    0xefd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
@.str.2 = [3 x i8] c"o2\00"
define i8* @vde_chain_nm7_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* null, i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
@.str.2 = [3 x i8] c"o2\00"
@reltable.vde_chain_nm7_name_out = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.vde_chain_nm7_name_out to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.vde_chain_nm7_name_out to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.vde_chain_nm7_name_out to i64)) to i32)]
define i8* @vde_chain_nm7_name_out(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.vde_chain_nm7_name_out to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int strspn(char *, char *);
int countLeadingBlanks(char *string, int position) {
  static char blanks[] = " ";
  return strspn(&string[position], blanks);
}


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

x86 assembly (clang, -O2):
<countLeadingBlanks>:
movslq %esi,%rax
add    %rax,%rdi
lea    0x2f0b(%rip),%rsi
jmp    1030 <strspn@plt>

LLVM IR (-O0):
@countLeadingBlanks.blanks = internal global [2 x i8] c" \00"
define i32 @countLeadingBlanks(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = call i32 @strspn(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @countLeadingBlanks.blanks, i64 0, i64 0))
ret i32 %9
}

LLVM IR (-O2):
@countLeadingBlanks.blanks = internal global [2 x i8] c" \00"
define i32 @countLeadingBlanks(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @strspn(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @countLeadingBlanks.blanks, i64 0, i64 0))
ret i32 %5
}
/* Variables and functions */
int close(int);
int std_close(int socket, void *ssl) { return close(socket); }


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

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

LLVM IR (-O0):
define i32 @std_close(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 = call i32 @close(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @std_close(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @close(i32 %0)
ret i32 %3
}
void Zero_Buffer_nommx(void *buf, unsigned int length) {
  int i;
  for (i = 0; i < length >> 2; i++)
    ((int *)buf)[i] = 0;
}


x86 assembly (clang, -O0):
<Zero_Buffer_nommx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
cmp    %ecx,%eax
jae    1140 <Zero_Buffer_nommx+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <Zero_Buffer_nommx+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Zero_Buffer_nommx>:
cmp    $0x4,%esi
jb     1126 <Zero_Buffer_nommx+0x16>
push   %rax
mov    %esi,%edx
and    $0xfffffffc,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @Zero_Buffer_nommx(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp ult i32 %1, 4
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = and i32 %1, -4
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: grdc [-st] [n]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"usage: grdc [-st] [n]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: grdc [-st] [n]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
OP(dd, f8) {
  illegal_1();
  op_f8();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_f8@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f8()
ret i32 undef
}
void iommu_group_set_iommudata(struct iommu_group *group, void *iommu_data,
                               void (*release)(void *iommu_data)) {}


x86 assembly (clang, -O0):
<iommu_group_set_iommudata>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.iommu_group = type opaque
define void @iommu_group_set_iommudata(%struct.iommu_group* %0, i8* %1, void (i8*)* %2) {
%4 = alloca %struct.iommu_group*
%5 = alloca i8*
%6 = alloca void (i8*)*
store %struct.iommu_group* %0, %struct.iommu_group** %4
store i8* %1, i8** %5
store void (i8*)* %2, void (i8*)** %6
ret void
}

LLVM IR (-O2):
%struct.iommu_group = type opaque
define void @iommu_group_set_iommudata(%struct.iommu_group* nocapture %0, i8* nocapture %1, void (i8*)* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_synchronous_connection_complete_get_transmission_interval(
    const uint8_t *event) {
  return event[12];
}


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

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

LLVM IR (-O0):
define i32 @hci_event_synchronous_connection_complete_get_transmission_interval(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 12
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_synchronous_connection_complete_get_transmission_interval(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
ret i32 %3
}
int f2(int a, int b) { return a * b; }


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

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

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

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *test6(char *a1, const char *a2) { return strcpy(a1, a2); }


x86 assembly (clang, -O0):
<test6>:
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 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test6(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 i8* @strcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @test6(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int custom_ext_2_srv_add_cb(SSL *s, unsigned int ext_type,
                            const unsigned char **out, size_t *outlen, int *al,
                            void *arg) {
  *out = NULL;
  *outlen = 0;
  return 1;
}


x86 assembly (clang, -O0):
<custom_ext_2_srv_add_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_ext_2_srv_add_cb>:
movq   $0x0,(%rdx)
movq   $0x0,(%rcx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @custom_ext_2_srv_add_cb(i32* %0, i32 %1, i8** %2, i64* %3, i32* %4, i8* %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i64*
%11 = alloca i32*
%12 = alloca i8*
store i32* %0, i32** %7
store i32 %1, i32* %8
store i8** %2, i8*** %9
store i64* %3, i64** %10
store i32* %4, i32** %11
store i8* %5, i8** %12
%13 = load i8**, i8*** %9
store i8* null, i8** %13
%14 = load i64*, i64** %10
store i64 0, i64* %14
ret i32 1
}

LLVM IR (-O2):
define i32 @custom_ext_2_srv_add_cb(i32* nocapture readnone %0, i32 %1, i8** nocapture writeonly %2, i64* nocapture writeonly %3, i32* nocapture readnone %4, i8* nocapture readnone %5) {
store i8* null, i8** %2
store i64 0, i64* %3
ret i32 1
}
/* Type definitions */
struct string {
  int dummy;
};
struct dict {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dict_set(struct dict *, struct string *,
                            struct string const *);
int /*<<< orphan*/ string_destroy(struct string *);
struct string *string_init(char const *);
void sets(struct dict *dict, const char *key,
          const struct string *value_string) {
  struct string *key_string = string_init(key);
  dict_set(dict, key_string, value_string);
  string_destroy(key_string);
}


x86 assembly (clang, -O0):
<sets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <string_init@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <dict_set@plt>
mov    -0x20(%rbp),%rdi
call   1040 <string_destroy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sets>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <string_init@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1050 <dict_set@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <string_destroy@plt>

LLVM IR (-O0):
%struct.dict = type { i32 }
%struct.string = type { i32 }
define void @sets(%struct.dict* %0, i8* %1, %struct.string* %2) {
%4 = alloca %struct.dict*
%5 = alloca i8*
%6 = alloca %struct.string*
%7 = alloca %struct.string*
store %struct.dict* %0, %struct.dict** %4
store i8* %1, i8** %5
store %struct.string* %2, %struct.string** %6
%8 = load i8*, i8** %5
%9 = call %struct.string* @string_init(i8* %8)
store %struct.string* %9, %struct.string** %7
%10 = load %struct.dict*, %struct.dict** %4
%11 = load %struct.string*, %struct.string** %7
%12 = load %struct.string*, %struct.string** %6
%13 = call i32 @dict_set(%struct.dict* %10, %struct.string* %11, %struct.string* %12)
%14 = load %struct.string*, %struct.string** %7
%15 = call i32 @string_destroy(%struct.string* %14)
ret void
}

LLVM IR (-O2):
%struct.dict = type { i32 }
%struct.string = type { i32 }
define void @sets(%struct.dict* %0, i8* %1, %struct.string* %2) {
%4 = tail call %struct.string* @string_init(i8* %1)
%5 = tail call i32 @dict_set(%struct.dict* %0, %struct.string* %4, %struct.string* %2)
%6 = tail call i32 @string_destroy(%struct.string* %4)
ret void
}
/* Type definitions */
struct lframe {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lframe *machine_get_pause(struct lemon *);
struct lframe *lemon_machine_get_pause(struct lemon *lemon) {
  return machine_get_pause(lemon);
}


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

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

LLVM IR (-O0):
%struct.lframe = type { i32 }
%struct.lemon = type { i32 }
define %struct.lframe* @lemon_machine_get_pause(%struct.lemon* %0) {
%2 = alloca %struct.lemon*
store %struct.lemon* %0, %struct.lemon** %2
%3 = load %struct.lemon*, %struct.lemon** %2
%4 = call %struct.lframe* @machine_get_pause(%struct.lemon* %3)
ret %struct.lframe* %4
}

LLVM IR (-O2):
%struct.lframe = type { i32 }
%struct.lemon = type { i32 }
define %struct.lframe* @lemon_machine_get_pause(%struct.lemon* %0) {
%2 = tail call %struct.lframe* @machine_get_pause(%struct.lemon* %0)
ret %struct.lframe* %2
}
/* Variables and functions */
scalar_t__ EINVAL;
scalar_t__ ERANGE;
scalar_t__ errno;
int strtol(char *, int /*<<< orphan*/, int);
int getNumberOfChanges(char *command) {
  int toRet;
  toRet = strtol(command + 4, 0, 10);
  if (errno == EINVAL || errno == ERANGE) {
    toRet = -1;
  }
  return toRet;
}


x86 assembly (clang, -O0):
<getNumberOfChanges>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%rax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
je     1167 <getNumberOfChanges+0x57>
mov    0x2e84(%rip),%rax
mov    (%rax),%rax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
jne    116e <getNumberOfChanges+0x5e>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumberOfChanges>:
push   %rax
add    $0x4,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x2eb0(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2eb6(%rip),%rdx
cmp    (%rdx),%rcx
mov    0x2e94(%rip),%rdx
mov    $0xffffffff,%esi
cmove  %esi,%eax
cmp    (%rdx),%rcx
cmove  %esi,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@EINVAL = global i64 0
@ERANGE = global i64 0
define i32 @getNumberOfChanges(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 4
%6 = call i32 @strtol(i8* %5, i32 0, i32 10)
store i32 %6, i32* %3
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINVAL
%9 = icmp eq i64 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i64, i64* @errno
%12 = load i64, i64* @ERANGE
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10, %1
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@errno = global i64 0
@EINVAL = global i64 0
@ERANGE = global i64 0
define i32 @getNumberOfChanges(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = tail call i32 @strtol(i8* %2, i32 0, i32 10)
%4 = load i64, i64* @errno
%5 = load i64, i64* @EINVAL
%6 = icmp eq i64 %4, %5
%7 = load i64, i64* @ERANGE
%8 = icmp eq i64 %4, %7
%9 = select i1 %6, i1 true, i1 %8
%10 = select i1 %9, i32 -1, i32 %3
ret i32 %10
}
/* Variables and functions */
int smbus_read_byte(unsigned int, unsigned int);
int spd_read_byte(unsigned device, unsigned address) {
  return smbus_read_byte(device, address);
}


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

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

LLVM IR (-O0):
define i32 @spd_read_byte(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 = call i32 @smbus_read_byte(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @spd_read_byte(i32 %0, i32 %1) {
%3 = tail call i32 @smbus_read_byte(i32 %0, i32 %1)
ret i32 %3
}
int main() { return 2 > 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
}
Abort(msg) char *msg;
{
  printf("%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<Abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @Abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
unreachable
}

LLVM IR (-O2):
define i32 @Abort(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
tail call void @exit(i32 1)
unreachable
}
void gentrunc_w_d() {}


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

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

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

LLVM IR (-O2):
define void @gentrunc_w_d() {
ret void
}
/* Type definitions */
struct Continuation_cell {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Continuation_freeCell(struct Continuation_cell *);
void Continuation_deleteCell(struct Continuation_cell *cell) {
  Continuation_freeCell(cell);
}


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

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

LLVM IR (-O0):
%struct.Continuation_cell = type { i32 }
define void @Continuation_deleteCell(%struct.Continuation_cell* %0) {
%2 = alloca %struct.Continuation_cell*
store %struct.Continuation_cell* %0, %struct.Continuation_cell** %2
%3 = load %struct.Continuation_cell*, %struct.Continuation_cell** %2
%4 = call i32 @Continuation_freeCell(%struct.Continuation_cell* %3)
ret void
}

LLVM IR (-O2):
%struct.Continuation_cell = type { i32 }
define void @Continuation_deleteCell(%struct.Continuation_cell* %0) {
%2 = tail call i32 @Continuation_freeCell(%struct.Continuation_cell* %0)
ret void
}
unsigned int parity_check(unsigned int flit) {
  unsigned int parity = 0;
  while (flit) {
    parity = !parity;
    flit = flit & (flit - 1);
  }
  return parity;
}


x86 assembly (clang, -O0):
<parity_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <parity_check+0x3c>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <parity_check+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity_check>:
xor    %eax,%eax
test   %edi,%edi
je     111c <parity_check+0x1c>
cs nopw 0x0(%rax,%rax,1)
xor    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <parity_check+0x10>
ret

LLVM IR (-O0):
define i32 @parity_check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = sub i32 %13, 1
%15 = and i32 %12, %14
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @parity_check(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = xor i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char const *);
int strtol(char const *, char **, int /*<<< orphan*/);
int parse_int(const char *str) {
  char *eptr = NULL;
  int n = strtol(str, &eptr, 0);
  if ((eptr == NULL) || (*eptr != '\0'))
    fatal("invalid integer: %s", str);
  return n;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <parse_int+0x41>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1171 <parse_int+0x51>
mov    -0x8(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%ebp
mov    (%rsp),%rax
test   %rax,%rax
je     1148 <parse_int+0x28>
cmpb   $0x0,(%rax)
je     1157 <parse_int+0x37>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <fatal@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"invalid integer: %s\00"
define i32 @parse_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %2
%6 = call i32 @strtol(i8* %5, i8** %3, i32 0)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9, %1
%15 = load i8*, i8** %2
%16 = call i32 @fatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %9
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [20 x i8] c"invalid integer: %s\00"
define i32 @parse_int(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = call i32 @strtol(i8* %0, i8** %2, i32 0)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7, %1
%11 = tail call i32 @fatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %10, %7
ret i32 %4
}
int test_imm_F4int16_mem(short *val) {
  return ((*val) & (-0xF4 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F4int16_mem>:
movzwl (%rdi),%eax
test   $0xff0c,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F4int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -244
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__typeof__(ispunct("")) test_ispunct_50(void) { return ispunct(""); }


x86 assembly (clang, -O0):
<test_ispunct_50>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <ispunct@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_ispunct_50() {
%1 = call i32 @ispunct(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_ispunct_50() {
%1 = tail call i32 @ispunct(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int gen_FPE(void) {
  kill(getpid(), SIGFPE);
  return 0;
}


x86 assembly (clang, -O0):
<gen_FPE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_FPE>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGFPE = global i32 0
define i32 @gen_FPE() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGFPE
%3 = call i32 @kill(i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGFPE = global i32 0
define i32 @gen_FPE() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGFPE
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(void) { foo(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_time(char *buf) {
  time_t rawtime;
  struct tm *info;
  time(&rawtime);
  info = localtime(&rawtime);
  strftime(buf, 21, "\x03%a %d %b\x02%H:%M/%S", info);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x15,%esi
lea    0xe9a(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x15,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [19 x i8] c"\03%a %d %b\02%H:%M/%S\00"
define void @get_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 21, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [19 x i8] c"\03%a %d %b\02%H:%M/%S\00"
define void @get_time(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 21, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int ler_dados(void) {
  int dado;
  printf("Digite a matrícula:\t");
  scanf(" %d", &dado);
  return dado;
}


x86 assembly (clang, -O0):
<ler_dados>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ler_dados>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Digite a matr\C3\ADcula:\09\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @ler_dados() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [22 x i8] c"Digite a matr\C3\ADcula:\09\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @ler_dados() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
float tbhDummyEstimator(float target) {
  (void)(target);
  return 0;
}


x86 assembly (clang, -O0):
<tbhDummyEstimator>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbhDummyEstimator>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tbhDummyEstimator(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @tbhDummyEstimator(float %0) {
ret float 0.000000e+00
}