xunge/DecIR huggingface dataset:
int convert5To8(int b) {
  int c = b & 0x1f;
  return (c << 3) | (c >> 2);
}


x86 assembly (clang, -O0):
<convert5To8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    -0x8(%rbp),%ecx
sar    $0x2,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert5To8>:
and    $0x1f,%edi
mov    %edi,%eax
shr    $0x2,%eax
lea    (%rax,%rdi,8),%eax
ret

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

LLVM IR (-O2):
define i32 @convert5To8(i32 %0) {
%2 = and i32 %0, 31
%3 = shl nuw nsw i32 %2, 3
%4 = lshr i32 %2, 2
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int cleanup() { exit(0); }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define i32 @cleanup() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @cleanup() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M114_f(char *s) {
  debug("M114_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M114_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M114_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M114_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M114_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M114_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M114_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_int9(void) { print("!! Coprocessor segment overrun "); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"!! Coprocessor segment overrun \00"
define void @idt_int9() {
%1 = call i32 @print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"!! Coprocessor segment overrun \00"
define void @idt_int9() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int rejected() {
  printf("Go away!");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Go away!\00"
define i32 @rejected() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"Go away!\00"
define i32 @rejected() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cel_to_fahr();
int /*<<< orphan*/ fahr_to_cel();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse_fahr_to_cel();
int main() {
  fahr_to_cel();
  printf("\n");
  cel_to_fahr();
  printf("\n");
  reverse_fahr_to_cel();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <fahr_to_cel@plt>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <cel_to_fahr@plt>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <reverse_fahr_to_cel@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fahr_to_cel@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <cel_to_fahr@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <reverse_fahr_to_cel@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = call i32 (...) @fahr_to_cel()
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @cel_to_fahr()
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @reverse_fahr_to_cel()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fahr_to_cel()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (...) @cel_to_fahr()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @reverse_fahr_to_cel()
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hweight_next64(uint64_t a) {
  uint64_t c = a & -a;
  uint64_t r = a + c;
  return (((r ^ a) >> 2) / c) | r;
}


x86 assembly (clang, -O0):
<hweight_next64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x4(%rbp),%eax
sar    $0x2,%eax
cltd
idivl  -0x8(%rbp)
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight_next64>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
and    %edi,%ecx
lea    (%rcx,%rax,1),%esi
xor    %esi,%eax
sar    $0x2,%eax
cltd
idiv   %ecx
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @hweight_next64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = and i32 %5, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = xor i32 %12, %13
%15 = ashr i32 %14, 2
%16 = load i32, i32* %3
%17 = sdiv i32 %15, %16
%18 = load i32, i32* %4
%19 = or i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @hweight_next64(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = add nsw i32 %3, %0
%5 = xor i32 %4, %0
%6 = ashr i32 %5, 2
%7 = sdiv i32 %6, %3
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int GetCommonVertex(int);
int SameSide(int pCount) {
  int v1, v2;
  v1 = GetCommonVertex(pCount - 1);
  v2 = GetCommonVertex(pCount);
  return (v1 == v2);
}


x86 assembly (clang, -O0):
<SameSide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <GetCommonVertex@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetCommonVertex@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SameSide>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <GetCommonVertex@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <GetCommonVertex@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SameSide(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
%7 = call i32 @GetCommonVertex(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @GetCommonVertex(i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @SameSide(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @GetCommonVertex(i32 %2)
%4 = tail call i32 @GetCommonVertex(i32 %0)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *init_list();
struct node *insert(struct node *, int);
int /*<<< orphan*/ printf(char *, struct node *);
int /*<<< orphan*/ travel_list(struct node *);
int main(void) {
  struct node *head;
  head = init_list();
  head = insert(head, 10);
  travel_list(head);
  printf("%p\n", head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init_list@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1050 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <travel_list@plt>
mov    -0x10(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <init_list@plt>
mov    %rax,%rdi
mov    $0xa,%esi
call   1050 <insert@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <travel_list@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
%3 = call %struct.node* (...) @init_list()
store %struct.node* %3, %struct.node** %2
%4 = load %struct.node*, %struct.node** %2
%5 = call %struct.node* @insert(%struct.node* %4, i32 10)
store %struct.node* %5, %struct.node** %2
%6 = load %struct.node*, %struct.node** %2
%7 = call i32 @travel_list(%struct.node* %6)
%8 = load %struct.node*, %struct.node** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.node* %8)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call %struct.node* (...) @init_list()
%2 = tail call %struct.node* @insert(%struct.node* %1, i32 10)
%3 = tail call i32 @travel_list(%struct.node* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.node* %2)
ret i32 0
}
void ff_me_cmp_init_ppc() {}


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

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

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

LLVM IR (-O2):
define void @ff_me_cmp_init_ppc() {
ret void
}
/* Type definitions */
typedef int u_char;

/* Variables and functions */
u_char pack(u_char a, u_char b) {
  u_char result;
  if ((a > 0x0f) || (b > 0x0f))
    return (u_char)-1;
  result = a << 4;
  result += b;
  return result;
}


x86 assembly (clang, -O0):
<pack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xf,-0x8(%rbp)
jg     111e <pack+0x1e>
cmpl   $0xf,-0xc(%rbp)
jle    112a <pack+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1142 <pack+0x42>
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack>:
mov    %edi,%eax
shl    $0x4,%eax
add    %esi,%eax
cmp    $0x10,%esi
mov    $0xffffffff,%ecx
cmovge %ecx,%eax
cmp    $0x10,%edi
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pack(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 15
%4 = icmp sgt i32 %1, 15
%5 = or i1 %3, %4
%6 = shl i32 %0, 4
%7 = add nsw i32 %6, %1
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
float Factorial(float X) {
  float val = 1.0;
  int k, j;
  for (k = 1; k < 5; k++) {
    val += 1.0;
  }
  return (val);
}


x86 assembly (clang, -O0):
<Factorial>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1153 <Factorial+0x53>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <Factorial+0x1d>
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Factorial>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @Factorial(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store float %0, float* %2
store float 1.000000e+00, float* %3
store i32 1, i32* %4
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fadd double %11, 1.000000e+00
%13 = fptrunc double %12 to float
store float %13, float* %3
br label %14
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = load float, float* %3
ret float %18
}

LLVM IR (-O2):
define float @Factorial(float %0) {
ret float 5.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printnl() { printf("\n"); }


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

x86 assembly (clang, -O2):
<printnl>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printnl() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
unsigned getIndex(char data) {
  if (data == 95) {
    return 0;
  }
  return data - 32;
  if (data >= '0' && data <= '9') {
    return data - 48;
  }
  if (data >= 'A' && data <= 'Z') {
    return data - 45;
  }
  if (data >= 'a' && data <= 'z') {
    return data - 51;
  }
}


x86 assembly (clang, -O0):
<getIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    1123 <getIndex+0x23>
movl   $0x0,-0x4(%rbp)
jmp    112d <getIndex+0x2d>
movsbl -0x5(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIndex>:
lea    -0x20(%rdi),%ecx
xor    %eax,%eax
cmp    $0x5f,%dil
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getIndex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 95
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %12
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @getIndex(i8 signext %0) {
%2 = icmp eq i8 %0, 95
%3 = sext i8 %0 to i32
%4 = add nsw i32 %3, -32
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tls_new() {
  printf("NOT IMPLEMENTED:"
         "pa_tls_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"NOT IMPLEMENTED:pa_tls_new\0A\00"
define i32 @pa_tls_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [27 x i8] c"NOT IMPLEMENTED:pa_tls_new\00"
define i32 @pa_tls_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
unsigned int enterChoice(void) {
  unsigned int menuChoice;
  printf("%s", "\nEnter your choice\n"
               "1 - store a formatted text file of accounts called\n"
               "      \"accounts.txt\"  for printing.\n"
               "2 - update an account\n"
               "3 - add a new account\n"
               "4 - delete an account\n"
               "5 - end program\n? ");
  scanf("%u", &menuChoice);
  return menuChoice;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [191 x i8] c"\0AEnter your choice\0A1 - store a formatted text file of accounts called\0A \22accounts.txt\22 for printing.\0A2 - update an account\0A3 - add a new account\0A4 - delete an account\0A5 - end program\0A? \00"
@.str.2 = [3 x i8] c"%u\00"
define i32 @enterChoice() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [191 x i8] c"\0AEnter your choice\0A1 - store a formatted text file of accounts called\0A \22accounts.txt\22 for printing.\0A2 - update an account\0A3 - add a new account\0A4 - delete an account\0A5 - end program\0A? \00"
@.str.2 = [3 x i8] c"%u\00"
define i32 @enterChoice() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRDE_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_statusbar_set_has_resize_grip() {
ret void
}
void EXTI15_10_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @EXTI15_10_IRQHandler() {
ret void
}
int test_imm_64uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x64 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_64uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 100
%7 = icmp ne i64 %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_64uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 429496729600
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double log(double x) { return 0; }


x86 assembly (clang, -O0):
<log>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @log(double %0) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct syslog_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void vsyslog_ss(int priority, struct syslog_data *data, const char *fmt,
                va_list ap) {
  vsyslog(priority, fmt, ap);
}


x86 assembly (clang, -O0):
<vsyslog_ss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <vsyslog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsyslog_ss>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vsyslog@plt>

LLVM IR (-O0):
%struct.syslog_data = type { i32 }
define void @vsyslog_ss(i32 %0, %struct.syslog_data* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.syslog_data*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store %struct.syslog_data* %1, %struct.syslog_data** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @vsyslog(i32 %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.syslog_data = type { i32 }
define void @vsyslog_ss(i32 %0, %struct.syslog_data* nocapture readnone %1, i8* %2, i32 %3) {
%5 = tail call i32 @vsyslog(i32 %0, i8* %2, i32 %3)
ret void
}
void *pa2kva(unsigned long x) {
  return (void *)(((0x8000000000000000 + 0x1800000000000000) + (x)));
}


x86 assembly (clang, -O0):
<pa2kva>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x9800000000000000,%rax
add    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa2kva>:
movabs $0x9800000000000000,%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @pa2kva(i64 %0) {
%2 = add i64 %0, -7493989779944505344
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
int MIN(int a, int b) {
  a -= b;
  return (b + (a & (a >> 31)));
}


x86 assembly (clang, -O0):
<MIN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
sar    $0x1f,%edx
and    %edx,%ecx
add    %ecx,%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
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 31
%12 = and i32 %9, %11
%13 = add nsw i32 %8, %12
ret i32 %13
}

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
}
/* Variables and functions */
double quanor_(double *, double *);
double cquanor(double *f, double *para) { return quanor_(f, para); }


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

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

LLVM IR (-O0):
define double @cquanor(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call double @quanor_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @cquanor(double* %0, double* %1) {
%3 = tail call double @quanor_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
scalar_t__ isspace(char);
void strip_blank_front(char **p) {
  char *s = *p;
  while (isspace(*s))
    s++;
  *p = s;
}


x86 assembly (clang, -O0):
<strip_blank_front>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     114e <strip_blank_front+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <strip_blank_front+0x17>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_blank_front>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
add    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <strip_blank_front+0x10>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strip_blank_front(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
store i8* %4, i8** %0
ret void
}
/* Variables and functions */
int hexdigit_value(char);
int is_hex_digit(char c) { return -1 != hexdigit_value(c); }


x86 assembly (clang, -O0):
<is_hex_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <hexdigit_value@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_digit>:
push   %rax
call   1030 <hexdigit_value@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_hex_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @hexdigit_value(i8 signext %3)
%5 = icmp ne i32 -1, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_hex_digit(i8 signext %0) {
%2 = tail call i32 @hexdigit_value(i8 signext %0)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
long double cosl(long double x) {
  long double r;
  if (isinf(x))
    return __domain_error();
  __asm__ __volatile__("fcos" : "=t"(r) : "0"(x));
  return r;
}


x86 assembly (clang, -O0):
<cosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
xor    %eax,%eax
call   1040 <isinf@plt>
cmp    $0x0,%eax
je     115b <cosl+0x3b>
xor    %eax,%eax
call   1030 <__domain_error@plt>
mov    %eax,-0x34(%rbp)
fildl  -0x34(%rbp)
fstpt  -0x10(%rbp)
jmp    1169 <cosl+0x49>
fldt   -0x20(%rbp)
fcos
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
xor    %eax,%eax
call   1040 <isinf@plt>
test   %eax,%eax
je     1150 <cosl+0x30>
xor    %eax,%eax
call   1030 <__domain_error@plt>
mov    %eax,0x18(%rsp)
fildl  0x18(%rsp)
add    $0x28,%rsp
ret
fldt   0x1c(%rsp)
fcos
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @cosl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %3
%6 = call i32 (x86_fp80, ...) bitcast (i32 (...)* @isinf to i32 (x86_fp80, ...)*)(x86_fp80 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 (...) @__domain_error()
%10 = sitofp i32 %9 to x86_fp80
store x86_fp80 %10, x86_fp80* %2
br label %15
11: ; preds = %1
%12 = load x86_fp80, x86_fp80* %3
%13 = call x86_fp80 asm sideeffect "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %12)
store x86_fp80 %13, x86_fp80* %4
%14 = load x86_fp80, x86_fp80* %4
store x86_fp80 %14, x86_fp80* %2
br label %15
15: ; preds = %11, %8
%16 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %16
}

LLVM IR (-O2):
define x86_fp80 @cosl(x86_fp80 %0) {
%2 = tail call i32 (x86_fp80, ...) bitcast (i32 (...)* @isinf to i32 (x86_fp80, ...)*)(x86_fp80 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (...) @__domain_error()
%6 = sitofp i32 %5 to x86_fp80
br label %9
7: ; preds = %1
%8 = tail call x86_fp80 asm sideeffect "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
br label %9
9: ; preds = %7, %4
%10 = phi x86_fp80 [ %6, %4 ], [ %8, %7 ]
ret x86_fp80 %10
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__3__GeneralIO__makeInput();
void CC2420TransmitP__CCA__makeInput(void) {
  Msp430GpioC__3__GeneralIO__makeInput();
}


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

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

LLVM IR (-O0):
define void @CC2420TransmitP__CCA__makeInput() {
%1 = call i32 (...) @Msp430GpioC__3__GeneralIO__makeInput()
ret void
}

LLVM IR (-O2):
define void @CC2420TransmitP__CCA__makeInput() {
%1 = tail call i32 (...) @Msp430GpioC__3__GeneralIO__makeInput()
ret void
}
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
int queue_is_empty_locked(struct queue *);
int /*<<< orphan*/ queue_lock_pop(struct queue *);
int /*<<< orphan*/ queue_unlock_pop(struct queue *);
bool queue_is_empty(struct queue *q) {
  bool ret;
  queue_lock_pop(q);
  ret = queue_is_empty_locked(q);
  queue_unlock_pop(q);
  return ret;
}


x86 assembly (clang, -O0):
<queue_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <queue_lock_pop@plt>
mov    -0x8(%rbp),%rdi
call   1030 <queue_is_empty_locked@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <queue_unlock_pop@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_is_empty>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <queue_lock_pop@plt>
mov    %rbx,%rdi
call   1030 <queue_is_empty_locked@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <queue_unlock_pop@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
define i32 @queue_is_empty(%struct.queue* %0) {
%2 = alloca %struct.queue*
%3 = alloca i32
store %struct.queue* %0, %struct.queue** %2
%4 = load %struct.queue*, %struct.queue** %2
%5 = call i32 @queue_lock_pop(%struct.queue* %4)
%6 = load %struct.queue*, %struct.queue** %2
%7 = call i32 @queue_is_empty_locked(%struct.queue* %6)
store i32 %7, i32* %3
%8 = load %struct.queue*, %struct.queue** %2
%9 = call i32 @queue_unlock_pop(%struct.queue* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.queue = type { i32 }
define i32 @queue_is_empty(%struct.queue* %0) {
%2 = tail call i32 @queue_lock_pop(%struct.queue* %0)
%3 = tail call i32 @queue_is_empty_locked(%struct.queue* %0)
%4 = tail call i32 @queue_unlock_pop(%struct.queue* %0)
ret i32 %3
}
__attribute__((visibility("hidden"))) int colour_to_blue(const int colour) {
  int return_val = 0;
  switch (colour) {
  case 8:
  case 1:
  case 2:
  case 3:
    return_val = 255;
    break;
  }
  return return_val;
}


x86 assembly (clang, -O0):
<colour_to_blue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x3,%eax
jb     1136 <colour_to_blue+0x36>
jmp    1125 <colour_to_blue+0x25>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
jne    113d <colour_to_blue+0x3d>
jmp    1136 <colour_to_blue+0x36>
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colour_to_blue>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1117 <colour_to_blue+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define hidden i32 @colour_to_blue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 8, label %5
i32 1, label %5
i32 2, label %5
i32 3, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 255, i32* %3
br label %6
6: ; preds = %1, %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@switch.table.colour_to_blue = [8 x i32] [i32 255, i32 255, i32 255, i32 0, i32 0, i32 0, i32 0, i32 255]
define hidden i32 @colour_to_blue(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.colour_to_blue, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int W_OK;
int X_OK;
int access(char *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  if (access("/home/shmiluyu/.abcdefg", W_OK | X_OK) == -1) {
    printf("folder doesn't exist");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    0x2ea1(%rip),%rax
or     (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    1162 <main+0x42>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xec6(%rip),%rdi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    1150 <main+0x30>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"/home/shmiluyu/.abcdefg\00"
@W_OK = global i32 0
@X_OK = global i32 0
@.str.1 = [21 x i8] c"folder doesn't exist\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @W_OK
%3 = load i32, i32* @X_OK
%4 = or i32 %2, %3
%5 = call i32 @access(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"/home/shmiluyu/.abcdefg\00"
@W_OK = global i32 0
@X_OK = global i32 0
@.str.1 = [21 x i8] c"folder doesn't exist\00"
define i32 @main() {
%1 = load i32, i32* @W_OK
%2 = load i32, i32* @X_OK
%3 = or i32 %2, %1
%4 = tail call i32 @access(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

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


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

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

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

LLVM IR (-O2):
define i32 @hci_event_master_link_key_complete_get_key_flag(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos3s(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void RasterPos3s(GLshort x, GLshort y, GLshort z) { glRasterPos3s(x, y, z); }


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

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

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

LLVM IR (-O2):
define void @RasterPos3s(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glRasterPos3s(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
char *shex2(char *, int);
char *shex8(char *buf, int val) {
  buf = shex2(buf, val >> 24);
  buf = shex2(buf, val >> 16);
  buf = shex2(buf, val >> 8);
  return shex2(buf, val);
}


x86 assembly (clang, -O0):
<shex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x18,%esi
call   1030 <shex2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x10,%esi
call   1030 <shex2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
call   1030 <shex2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <shex2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shex8>:
push   %rbx
mov    %esi,%ebx
sar    $0x18,%esi
call   1030 <shex2@plt>
mov    %ebx,%esi
sar    $0x10,%esi
mov    %rax,%rdi
call   1030 <shex2@plt>
mov    %ebx,%esi
sar    $0x8,%esi
mov    %rax,%rdi
call   1030 <shex2@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <shex2@plt>

LLVM IR (-O0):
define i8* @shex8(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 = ashr i32 %6, 24
%8 = call i8* @shex2(i8* %5, i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = call i8* @shex2(i8* %9, i32 %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = ashr i32 %14, 8
%16 = call i8* @shex2(i8* %13, i32 %15)
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = call i8* @shex2(i8* %17, i32 %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @shex8(i8* %0, i32 %1) {
%3 = ashr i32 %1, 24
%4 = tail call i8* @shex2(i8* %0, i32 %3)
%5 = ashr i32 %1, 16
%6 = tail call i8* @shex2(i8* %4, i32 %5)
%7 = ashr i32 %1, 8
%8 = tail call i8* @shex2(i8* %6, i32 %7)
%9 = tail call i8* @shex2(i8* %8, i32 %1)
ret i8* %9
}
void f() { const unsigned char G___152598331 = 0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int write(int, char *, int);
int g_omfp_write_nl(int fd, char *buffer, size_t max_size, void *arg) {
  if (-1 == write(fd, buffer, max_size)) {
    return -1;
  }
  return write(fd, "\n", 1);
}


x86 assembly (clang, -O0):
<g_omfp_write_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1154 <g_omfp_write_nl+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <g_omfp_write_nl+0x5b>
mov    -0x8(%rbp),%edi
lea    0xea2(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_omfp_write_nl>:
push   %rbx
mov    %edi,%ebx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     1131 <g_omfp_write_nl+0x21>
lea    0xedc(%rip),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @g_omfp_write_nl(i32 %0, i8* nocapture %1, i64 %2, i8* nocapture readnone %3) {
%5 = trunc i64 %2 to i32
%6 = tail call i32 @write(i32 %0, i8* %1, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void add_two(uint32_t *p) {
  p = (uint64_t *)p;
  *p = *p + 2;
}


x86 assembly (clang, -O0):
<add_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_two>:
addq   $0x2,(%rdi)
ret

LLVM IR (-O0):
define void @add_two(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
store i64* %3, i64** %2
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
%6 = add nsw i64 %5, 2
%7 = load i64*, i64** %2
store i64 %6, i64* %7
ret void
}

LLVM IR (-O2):
define void @add_two(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = add nsw i64 %2, 2
store i64 %3, i64* %0
ret void
}
int max(int a, int b) {
  int c;
  c = a > b ? a : b;
  return (c);
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned lifted_a(unsigned *x) { return *x; }


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

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

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

LLVM IR (-O2):
define i32 @lifted_a(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}