xunge/DecIR huggingface dataset:
int test_imm_5Dint16_reg(short val) {
  return ((val) & (-0x5D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffa3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Dint16_reg(i16 signext %0) {
%2 = and i16 %0, -93
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void sysDelay_us(uint16_t us) {
  struct timespec usec;
  usec.tv_sec = 0;
  usec.tv_nsec = us * 1000;
  nanosleep(&usec, NULL);
}


x86 assembly (clang, -O0):
<sysDelay_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysDelay_us>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edi,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @sysDelay_us(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @sysDelay_us(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul nsw i32 %0, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
unsigned int streq(const char *string1, const char *string2) {
  return (*string1 == *string2 && strcmp(string1, string2) == 0);
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1152 <streq+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1129 <streq+0x19>
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(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* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %7, %10
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i64 @strcmp(i8* %13, i8* %14)
%16 = icmp eq i64 %15, 0
br label %17
17: ; preds = %12, %2
%18 = phi i1 [ false, %2 ], [ %16, %12 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
float test_fdimf(float x, float y) { return __builtin_fdimf(x, y); }


x86 assembly (clang, -O0):
<test_fdimf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fdimf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @test_fdimf(float %0, float %1) {
%3 = tail call float @fdimf(float %0, float %1)
ret float %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
int get_XButtonEvent_send_event(void *_p) {
  return (int)((XButtonEvent *)_p)->send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XButtonEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int irq_set_affinity(unsigned int irq, const struct cpumask *m) { return -22; }


x86 assembly (clang, -O0):
<irq_set_affinity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffea,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.cpumask = type opaque
define i32 @irq_set_affinity(i32 %0, %struct.cpumask* nocapture readnone %1) {
ret i32 -22
}
int InterruptControl(unsigned interrupt) {
  int type = 2;
  int v = 0;
  __asm__("movl %2,%%eax;						"
          "	 movl	%1,%%ebx;					"
          "		 int $0x64;					"
          "				 movl %%eax,%0;		"
          : "=r"(v)
          : "r"(interrupt), "r"(type)
          : "%eax", "%ebx");
  return v;
}


x86 assembly (clang, -O0):
<InterruptControl>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
mov    %edx,%eax
mov    %ecx,%ebx
int    $0x64
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<InterruptControl>:
push   %rbx
mov    $0x2,%ecx
mov    %ecx,%eax
mov    %edi,%ebx
int    $0x64
mov    %eax,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @InterruptControl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 asm "movl $2,%eax;\09\09\09\09\09\09\09 movl\09$1,%ebx;\09\09\09\09\09\09\09 int $$0x64;\09\09\09\09\09\09\09\09\09 movl %eax,$0;\09\09", "=r,r,r,~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @InterruptControl(i32 %0) {
%2 = tail call i32 asm "movl $2,%eax;\09\09\09\09\09\09\09 movl\09$1,%ebx;\09\09\09\09\09\09\09 int $$0x64;\09\09\09\09\09\09\09\09\09 movl %eax,$0;\09\09", "=r,r,r,~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 2)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ SysCtlDelay(int);
void _EEPROMSectorMaskClear(void) {
  SysCtlDelay(10);
  (*((volatile uint32_t *)(0x400FD0FC))) = 3;
  SysCtlDelay(10);
  (*((volatile uint32_t *)(0x400AE2C0))) = 0;
  SysCtlDelay(10);
  (*((volatile uint32_t *)(0x400FD0FC))) = 0;
  SysCtlDelay(10);
}


x86 assembly (clang, -O0):
<_EEPROMSectorMaskClear>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movl   $0x3,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400ae2c0,%eax
movl   $0x0,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movl   $0x0,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EEPROMSectorMaskClear>:
push   %rax
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movl   $0x3,0x400fd0fc
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movl   $0x0,0x400ae2c0
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movl   $0x0,0x400fd0fc
mov    $0xa,%edi
pop    %rax
jmp    1030 <SysCtlDelay@plt>

LLVM IR (-O0):
define void @_EEPROMSectorMaskClear() {
%1 = call i32 @SysCtlDelay(i32 10)
store volatile i32 3, i32* inttoptr (i64 1074778364 to i32*)
%2 = call i32 @SysCtlDelay(i32 10)
store volatile i32 0, i32* inttoptr (i64 1074455232 to i32*)
%3 = call i32 @SysCtlDelay(i32 10)
store volatile i32 0, i32* inttoptr (i64 1074778364 to i32*)
%4 = call i32 @SysCtlDelay(i32 10)
ret void
}

LLVM IR (-O2):
define void @_EEPROMSectorMaskClear() {
%1 = tail call i32 @SysCtlDelay(i32 10)
store volatile i32 3, i32* inttoptr (i64 1074778364 to i32*)
%2 = tail call i32 @SysCtlDelay(i32 10)
store volatile i32 0, i32* inttoptr (i64 1074455232 to i32*)
%3 = tail call i32 @SysCtlDelay(i32 10)
store volatile i32 0, i32* inttoptr (i64 1074778364 to i32*)
%4 = tail call i32 @SysCtlDelay(i32 10)
ret void
}
p_query(msg) char *msg;
{}


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

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

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

LLVM IR (-O2):
define i32 @p_query(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ rig_service(void *);
void *service(void *p) {
  rig_service(p);
  return p;
}


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

x86 assembly (clang, -O2):
<service>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rig_service@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @service(i8* returned %0) {
%2 = tail call i32 @rig_service(i8* %0)
ret i8* %0
}
/* Variables and functions */
scalar_t__ COLS;
scalar_t__ LINES;
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mvcur(int /*<<< orphan*/, scalar_t__, scalar_t__,
                         int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
endp() {
  (void)signal(SIGINT, SIG_IGN);
  (void)signal(SIGHUP, SIG_IGN);
  mvcur(0, COLS - 1, LINES - 1, 0);
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<endp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%rsi
sub    $0x1,%rsi
mov    0x2e51(%rip),%rax
mov    (%rax),%rdx
sub    $0x1,%rdx
xor    %ecx,%ecx
mov    %ecx,%edi
call   1030 <mvcur@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<endp>:
push   %rbx
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e7f(%rip),%rbx
mov    (%rbx),%esi
call   1040 <signal@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
call   1040 <signal@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%rsi
add    $0xffffffffffffffff,%rsi
mov    0x2e5b(%rip),%rax
mov    (%rax),%rdx
add    $0xffffffffffffffff,%rdx
xor    %edi,%edi
xor    %ecx,%ecx
call   1030 <mvcur@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGHUP = global i32 0
@COLS = global i64 0
@LINES = global i64 0
define i32 @endp() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGHUP
%5 = load i32, i32* @SIG_IGN
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = load i64, i64* @COLS
%8 = sub nsw i64 %7, 1
%9 = load i64, i64* @LINES
%10 = sub nsw i64 %9, 1
%11 = call i32 @mvcur(i32 0, i64 %8, i64 %10, i32 0)
%12 = call i32 (...) @endwin()
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@SIGHUP = global i32 0
@COLS = global i64 0
@LINES = global i64 0
define i32 @endp() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGHUP
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = load i64, i64* @COLS
%8 = add nsw i64 %7, -1
%9 = load i64, i64* @LINES
%10 = add nsw i64 %9, -1
%11 = tail call i32 @mvcur(i32 0, i64 %8, i64 %10, i32 0)
%12 = tail call i32 (...) @endwin()
%13 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_EDuint16_reg(unsigned short val) {
  return ((val) & (-0xED << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EDuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EDuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -237
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct snd_mask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snd_mask_leave(struct snd_mask *, int /*<<< orphan*/);
int /*<<< orphan*/ snd_mask_max(struct snd_mask *);
scalar_t__ snd_mask_single(struct snd_mask *);
int snd_mask_refine_last(struct snd_mask *mask) {
  if (snd_mask_single(mask))
    return 0;
  snd_mask_leave(mask, snd_mask_max(mask));
  return 1;
}


x86 assembly (clang, -O0):
<snd_mask_refine_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <snd_mask_single@plt>
cmp    $0x0,%rax
je     115b <snd_mask_refine_last+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    117e <snd_mask_refine_last+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <snd_mask_max@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <snd_mask_leave@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_mask_refine_last>:
push   %rbx
mov    %rdi,%rbx
call   1050 <snd_mask_single@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1145 <snd_mask_refine_last+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <snd_mask_max@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <snd_mask_leave@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.snd_mask = type { i32 }
define i32 @snd_mask_refine_last(%struct.snd_mask* %0) {
%2 = alloca i32
%3 = alloca %struct.snd_mask*
store %struct.snd_mask* %0, %struct.snd_mask** %3
%4 = load %struct.snd_mask*, %struct.snd_mask** %3
%5 = call i64 @snd_mask_single(%struct.snd_mask* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %13
8: ; preds = %1
%9 = load %struct.snd_mask*, %struct.snd_mask** %3
%10 = load %struct.snd_mask*, %struct.snd_mask** %3
%11 = call i32 @snd_mask_max(%struct.snd_mask* %10)
%12 = call i32 @snd_mask_leave(%struct.snd_mask* %9, i32 %11)
store i32 1, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.snd_mask = type { i32 }
define i32 @snd_mask_refine_last(%struct.snd_mask* %0) {
%2 = tail call i64 @snd_mask_single(%struct.snd_mask* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @snd_mask_max(%struct.snd_mask* %0)
%6 = tail call i32 @snd_mask_leave(%struct.snd_mask* %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %8
}
int sgn(long double x) {
  if (x > 0)
    return +1;
  if (x < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    112c <sgn+0x2c>
jmp    1120 <sgn+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1153 <sgn+0x53>
fldt   -0x20(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    114c <sgn+0x4c>
jmp    1140 <sgn+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <sgn+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
fldt   0x8(%rsp)
fldz
xor    %ecx,%ecx
fucomi %st(1),%st
seta   %cl
neg    %ecx
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sgn(x86_fp80 %0) {
%2 = alloca i32
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %3
%5 = fcmp ogt x86_fp80 %4, 0xK00000000000000000000
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
%8 = load x86_fp80, x86_fp80* %3
%9 = fcmp olt x86_fp80 %8, 0xK00000000000000000000
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -1, i32* %2
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sgn(x86_fp80 %0) {
%2 = fcmp ogt x86_fp80 %0, 0xK00000000000000000000
%3 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void *__psi_alloca(size_t count, size_t align) {
  void *p = malloc(count);
  if (!p) {
    raise(SIGSEGV);
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<__psi_alloca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <__psi_alloca+0x3d>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__psi_alloca>:
push   %rax
call   1050 <malloc@plt>
test   %rax,%rax
je     113d <__psi_alloca+0xd>
pop    %rcx
ret
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@SIGSEGV = global i32 0
define i8* @__psi_alloca(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @SIGSEGV
%12 = call i32 @raise(i32 %11)
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
define noalias i8* @__psi_alloca(i64 %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @SIGSEGV
%7 = tail call i32 @raise(i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct mutex {
  int dummy;
};
struct i40e_spinlock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mutex_lock(struct mutex *);
void i40e_acquire_spinlock_d(struct i40e_spinlock *sp) {
  mutex_lock((struct mutex *)sp);
}


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

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

LLVM IR (-O0):
%struct.i40e_spinlock = type { i32 }
%struct.mutex = type { i32 }
define void @i40e_acquire_spinlock_d(%struct.i40e_spinlock* %0) {
%2 = alloca %struct.i40e_spinlock*
store %struct.i40e_spinlock* %0, %struct.i40e_spinlock** %2
%3 = load %struct.i40e_spinlock*, %struct.i40e_spinlock** %2
%4 = bitcast %struct.i40e_spinlock* %3 to %struct.mutex*
%5 = call i32 @mutex_lock(%struct.mutex* %4)
ret void
}

LLVM IR (-O2):
%struct.i40e_spinlock = type { i32 }
%struct.mutex = type { i32 }
define void @i40e_acquire_spinlock_d(%struct.i40e_spinlock* %0) {
%2 = bitcast %struct.i40e_spinlock* %0 to %struct.mutex*
%3 = tail call i32 @mutex_lock(%struct.mutex* %2)
ret void
}
void trap_startCamera(int camNum, int time) {}


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

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

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

LLVM IR (-O2):
define void @trap_startCamera(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _sl_destroy(void *data) { free((data)); }


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

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

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

LLVM IR (-O2):
define void @_sl_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void nothing(__attribute__((unused)) char *arg) {}


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

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

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

LLVM IR (-O2):
define void @nothing(i8* nocapture %0) {
ret void
}
int unix_announce(const char *path) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @unix_announce(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRBB_get(void) { return U_WMRCORENONE_get("U_WMRBB"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRBB\00"
define i32 @U_WMRBB_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
long bar1(long *next) { return (long)(*next)++; }


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

x86 assembly (clang, -O2):
<bar1>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i64 @bar1(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = add nsw i64 %2, 1
store i64 %3, i64* %0
ret i64 %2
}
int IsAlphaNum(int c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
          (c >= '0' && c <= '9'));
}


x86 assembly (clang, -O0):
<IsAlphaNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <IsAlphaNum+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <IsAlphaNum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <IsAlphaNum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <IsAlphaNum+0x58>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <IsAlphaNum+0x52>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsAlphaNum>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @IsAlphaNum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 48
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 57
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @IsAlphaNum(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int data_in_callback(int sock, char *buff, int bytes, void *param) {
  printf("data in\n");
  return send(sock, buff, bytes, 0) < 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<data_in_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_in_callback>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
sar    $0x3f,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"data in\0A\00"
define i32 @data_in_callback(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i64 @send(i32 %10, i8* %11, i32 %12, i32 0)
%14 = icmp slt i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 -1, i32 0
ret i32 %16
}

LLVM IR (-O2):
@str = [8 x i8] c"data in\00"
define i32 @data_in_callback(i32 %0, i8* %1, i32 %2, i8* nocapture readnone %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%6 = tail call i64 @send(i32 %0, i8* %1, i32 %2, i32 0)
%7 = ashr i64 %6, 63
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
bool isPrime(int number) {
  int factor;
  for (factor = 2; factor < number; factor++) {
    if (number % factor == 0) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isPrime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isPrime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isPrime+0x50>
jmp    113b <isPrime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isPrime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isPrime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isPrime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isPrime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
void fa76(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    p01C:
      goto p01C;
      goto a;
    P01C:
      goto P01C;
      0;
  });
a:
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa76>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa76+0x4>

x86 assembly (clang, -O2):
<fa76>:
jmp    1100 <fa76>

LLVM IR (-O0):
define void @fa76() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa76() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Cvar_SetWithFlag_f(int);
void Cvar_Setas_f(void) { Cvar_SetWithFlag_f(1 | 4); }


x86 assembly (clang, -O0):
<Cvar_Setas_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <Cvar_SetWithFlag_f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cvar_Setas_f>:
mov    $0x5,%edi
jmp    1030 <Cvar_SetWithFlag_f@plt>

LLVM IR (-O0):
define void @Cvar_Setas_f() {
%1 = call i32 @Cvar_SetWithFlag_f(i32 5)
ret void
}

LLVM IR (-O2):
define void @Cvar_Setas_f() {
%1 = tail call i32 @Cvar_SetWithFlag_f(i32 5)
ret void
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int compare_string_pointers(const void *a_, const void *b_) {
  const char *const *a = a_;
  const char *const *b = b_;
  return strcmp(*a, *b);
}


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

x86 assembly (clang, -O2):
<compare_string_pointers>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_string_pointers(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_string_pointers(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void usage(FILE *fp, const char *program) {
  fprintf(fp, "usage: %s [options] FILE\n", program);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"usage: %s [options] FILE\0A\00"
define void @usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"usage: %s [options] FILE\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add(struct list *, int);
struct list *create_list();
int /*<<< orphan*/ dispose(struct list *);
int list_length(struct list *);
int main() {
  struct list *l = create_list();
  add(l, 1);
  add(l, 2);
  add(l, 2);
  add(l, 4);
  int tmp = list_length(l);
  dispose(l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <create_list@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <add@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <add@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <add@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <add@plt>
mov    -0x10(%rbp),%rdi
call   1060 <list_length@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <dispose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <create_list@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
call   1040 <add@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <add@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <add@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <add@plt>
mov    %rbx,%rdi
call   1060 <list_length@plt>
mov    %rbx,%rdi
call   1030 <dispose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.list*
%3 = alloca i32
store i32 0, i32* %1
%4 = call %struct.list* (...) @create_list()
store %struct.list* %4, %struct.list** %2
%5 = load %struct.list*, %struct.list** %2
%6 = call i32 @add(%struct.list* %5, i32 1)
%7 = load %struct.list*, %struct.list** %2
%8 = call i32 @add(%struct.list* %7, i32 2)
%9 = load %struct.list*, %struct.list** %2
%10 = call i32 @add(%struct.list* %9, i32 2)
%11 = load %struct.list*, %struct.list** %2
%12 = call i32 @add(%struct.list* %11, i32 4)
%13 = load %struct.list*, %struct.list** %2
%14 = call i32 @list_length(%struct.list* %13)
store i32 %14, i32* %3
%15 = load %struct.list*, %struct.list** %2
%16 = call i32 @dispose(%struct.list* %15)
ret i32 0
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @main() {
%1 = tail call %struct.list* (...) @create_list()
%2 = tail call i32 @add(%struct.list* %1, i32 1)
%3 = tail call i32 @add(%struct.list* %1, i32 2)
%4 = tail call i32 @add(%struct.list* %1, i32 2)
%5 = tail call i32 @add(%struct.list* %1, i32 4)
%6 = tail call i32 @list_length(%struct.list* %1)
%7 = tail call i32 @dispose(%struct.list* %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int const *, size_t const);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void norx_pad(uint8_t *out, const uint8_t *in, const size_t inlen) {
  memset(out, 0, (((((8 * 16) - (8 * 11))) + 7) / 8));
  memcpy(out, in, inlen);
  out[inlen] = 0x01;
  out[(((((8 * 16) - (8 * 11))) + 7) / 8) - 1] |= 0x80;
}


x86 assembly (clang, -O0):
<norx_pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
or     $0x80,%ecx
mov    %ecx,0x10(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norx_pad>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movl   $0x1,(%rbx,%r15,4)
orb    $0x80,0x10(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @norx_pad(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = call i32 @memset(i32* %7, i32 0, i32 5)
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = load i64, i64* %6
%12 = call i32 @memcpy(i32* %9, i32* %10, i64 %11)
%13 = load i32*, i32** %4
%14 = load i64, i64* %6
%15 = getelementptr inbounds i32, i32* %13, i64 %14
store i32 1, i32* %15
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 4
%18 = load i32, i32* %17
%19 = or i32 %18, 128
store i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @norx_pad(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @memset(i32* %0, i32 0, i32 5)
%5 = tail call i32 @memcpy(i32* %0, i32* %1, i64 %2)
%6 = getelementptr inbounds i32, i32* %0, i64 %2
store i32 1, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 4
%8 = load i32, i32* %7
%9 = or i32 %8, 128
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int syscall(int, int, int);
int setns(int fd, int nstype) { return syscall(375, fd, nstype); }


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

x86 assembly (clang, -O2):
<setns>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x177,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @setns(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 @syscall(i32 375, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @setns(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 375, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ myfoo(int *);
void mallocEscapeFreeFree() {
  int *p = malloc(12);
  myfoo(p);
  free(p);
  free(p);
}


x86 assembly (clang, -O0):
<mallocEscapeFreeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <myfoo@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocEscapeFreeFree>:
push   %rbx
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <myfoo@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mallocEscapeFreeFree() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @myfoo(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @free(i32* %7)
ret void
}

LLVM IR (-O2):
define void @mallocEscapeFreeFree() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32 @myfoo(i32* %1)
%3 = tail call i32 @free(i32* %1)
%4 = tail call i32 @free(i32* %1)
ret void
}
float sq_area_sperimeter(float semiperimeter) {
  float area = (semiperimeter / 2) * (semiperimeter / 2);
  return area;
}


x86 assembly (clang, -O0):
<sq_area_sperimeter>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xed9(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @sq_area_sperimeter(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fdiv float %4, 2.000000e+00
%6 = load float, float* %2
%7 = fdiv float %6, 2.000000e+00
%8 = fmul float %5, %7
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @sq_area_sperimeter(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = fmul float %2, %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, int);
int strcmp(char const *, char const *);
int ext_strcmp(const char *a, const char *b) {
  int ret = strcmp(a, b);
  printf("compare [%s] and [%s] => [%d]\n", a, b, ret);
  return ret;
}


x86 assembly (clang, -O0):
<ext_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_strcmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strcmp@plt>
mov    %eax,%ebp
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"compare [%s] and [%s] => [%d]\0A\00"
define i32 @ext_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @strcmp(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [31 x i8] c"compare [%s] and [%s] => [%d]\0A\00"
define i32 @ext_strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %3)
ret i32 %3
}