xunge/DecIR huggingface dataset:
void swap(float *x, float *y) {
  float temp;
  temp = *x;
  *x = *y;
  *y = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float, float* %6
store float %7, float* %5
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = load float*, float** %3
store float %9, float* %10
%11 = load float, float* %5
%12 = load float*, float** %4
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @swap(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
store float %4, float* %0
store float %3, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max_down(int *, int, int);
void build_max_heap(int arr[], int n) {
  int i;
  for (i = n / 2; i >= 1; i--)
    max_down(arr, i, n);
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1154 <build_max_heap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <max_down@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <build_max_heap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1146 <build_max_heap+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <max_down@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_max_heap(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* %4
%7 = sdiv i32 %6, 2
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @max_down(i32* %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @max_down(i32* %0, i32 %7, i32 %1)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
int get_XCreateWindowEvent_x(void *_p) {
  return (int)((XCreateWindowEvent *)_p)->x;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCreateWindowEvent_x(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_XCreateWindowEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
void UARTIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  unsigned long ulInt;
  ;
  ulInt = ((ulBase == 0x4000C000) ? 21 : ((ulBase == 0x4000D000) ? 22 : 49));
  IntRegister(ulInt, pfnHandler);
  IntEnable(ulInt);
}


x86 assembly (clang, -O0):
<UARTIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x4000c000,-0x8(%rbp)
40
jne    114b <UARTIntRegister+0x2b>
mov    $0x15,%eax
mov    %eax,-0x1c(%rbp)
jmp    1166 <UARTIntRegister+0x46>
mov    -0x8(%rbp),%rdx
mov    $0x31,%eax
mov    $0x16,%ecx
cmp    $0x4000d000,%rdx
cmove  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntRegister>:
push   %rbx
cmp    $0x4000d000,%rdi
mov    $0x16,%eax
mov    $0x31,%ecx
cmove  %rax,%rcx
cmp    $0x4000c000,%rdi
mov    $0x15,%ebx
cmovne %rcx,%rbx
mov    %rbx,%rdi
call   1040 <IntRegister@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @UARTIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
%5 = alloca i64
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 1073790976
br i1 %7, label %8, label %9
8: ; preds = %2
br label %14
9: ; preds = %2
%10 = load i64, i64* %3
%11 = icmp eq i64 %10, 1073795072
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 22, i32 49
br label %14
14: ; preds = %9, %8
%15 = phi i32 [ 21, %8 ], [ %13, %9 ]
%16 = sext i32 %15 to i64
store i64 %16, i64* %5
%17 = load i64, i64* %5
%18 = load void ()*, void ()** %4
%19 = bitcast void ()* %18 to void (...)*
%20 = call i32 @IntRegister(i64 %17, void (...)* %19)
%21 = load i64, i64* %5
%22 = call i32 @IntEnable(i64 %21)
ret void
}

LLVM IR (-O2):
define void @UARTIntRegister(i64 %0, void ()* %1) {
%3 = icmp eq i64 %0, 1073790976
%4 = icmp eq i64 %0, 1073795072
%5 = select i1 %4, i64 22, i64 49
%6 = select i1 %3, i64 21, i64 %5
%7 = bitcast void ()* %1 to void (...)*
%8 = tail call i32 @IntRegister(i64 %6, void (...)* %7)
%9 = tail call i32 @IntEnable(i64 %6)
ret void
}
int many1(int x, char c, float f) {
  x;
  c;
  f;
  return x;
}


x86 assembly (clang, -O0):
<many1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @many1(i32 returned %0, i8 signext %1, float %2) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void testBitNot() { printf("~%d = %d\n", 10, ~10); }


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

x86 assembly (clang, -O2):
<testBitNot>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0xfffffff5,%edx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"~%d = %d\0A\00"
define void @testBitNot() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 -11)
ret void
}
int test_imm_D1int8_reg(signed char val) {
  return ((val) & (-0xD1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D1int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -209
%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_D1int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -209
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int proximity_open_lcd_ldi(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @proximity_open_lcd_ldi(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sval;
struct attrset {
  int dummy;
};

/* Variables and functions */
int attr_set_str(struct attrset **, char const *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int attr_set_int(struct attrset **setp, const char *key, int val) {
  char sval[sizeof(int) * 3 + 2];
  snprintf(sval, sizeof(sval), "%d", val);
  return attr_set_str(setp, key, sval);
}


x86 assembly (clang, -O0):
<attr_set_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0xe,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x22(%rbp),%rdx
call   1030 <attr_set_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attr_set_int>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec8(%rip),%rdx
lea    0x2(%rsp),%r15
mov    %r15,%rdi
mov    $0xe,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <attr_set_str@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.attrset = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @attr_set_int(%struct.attrset** %0, i8* %1, i32 %2) {
%4 = alloca %struct.attrset**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [14 x i8]
store %struct.attrset** %0, %struct.attrset*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [14 x i8], [14 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %6
%10 = call i32 @snprintf(i8* %8, i32 14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load %struct.attrset**, %struct.attrset*** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [14 x i8], [14 x i8]* %7, i64 0, i64 0
%14 = call i32 @attr_set_str(%struct.attrset** %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.attrset = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @attr_set_int(%struct.attrset** %0, i8* %1, i32 %2) {
%4 = alloca [14 x i8]
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = call i32 @attr_set_str(%struct.attrset** %0, i8* %1, i8* %5)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_wait(void *e,
                                                         uint64_t timeout) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_wait>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_wait(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_wait(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int checkcmp();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ unlink(char *);
int checkbind() {
  int rc;
  unlink("tools/.chk");
  system("gcc tools/chkbind.c -lnsl -ldl -lsocket -o tools/chkbind"
         " 2>tools/.chk ");
  return checkcmp();
}


x86 assembly (clang, -O0):
<checkbind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec0(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1040 <checkcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkbind>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec7(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <checkcmp@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tools/.chk\00"
@.str.1 = [71 x i8] c"gcc tools/chkbind.c -lnsl -ldl -lsocket -o tools/chkbind 2>tools/.chk \00"
define i32 @checkbind() {
%1 = alloca i32
%2 = call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @checkcmp()
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"tools/.chk\00"
@.str.1 = [71 x i8] c"gcc tools/chkbind.c -lnsl -ldl -lsocket -o tools/chkbind 2>tools/.chk \00"
define i32 @checkbind() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @checkcmp()
ret i32 %3
}
int tree2a(int i) { return i + 1; }


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

x86 assembly (clang, -O2):
<tree2a>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @tree2a(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void key(unsigned char k, int x, int y) {
  switch (k) {
  case 27:
    exit(0);
  }
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <key+0x2b>
jmp    1134 <key+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
cmp    $0x1b,%dil
je     1117 <key+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
void mpp_end() {}


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

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

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

LLVM IR (-O2):
define void @mpp_end() {
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
size_t wcslen(const wchar_t *s) {
  const wchar_t *p;
  p = s;
  while (*p)
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<wcslen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     112f <wcslen+0x2f>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <wcslen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcslen>:
mov    $0xfffffffffffffff8,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,1)
lea    0x8(%rax),%rax
jne    1110 <wcslen+0x10>
sar    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @wcslen(i64* %0) {
%2 = alloca i64*
%3 = alloca i64*
store i64* %0, i64** %2
%4 = load i64*, i64** %2
store i64* %4, i64** %3
br label %5
5: ; preds = %9, %1
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i32 1
store i64* %11, i64** %3
br label %5
12: ; preds = %5
%13 = load i64*, i64** %3
%14 = load i64*, i64** %2
%15 = ptrtoint i64* %13 to i64
%16 = ptrtoint i64* %14 to i64
%17 = sub i64 %15, %16
%18 = sdiv exact i64 %17, 8
ret i64 %18
}

LLVM IR (-O2):
define i64 @wcslen(i64* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64* [ %0, %1 ], [ %6, %2 ]
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds i64, i64* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i64* %3 to i64
%9 = ptrtoint i64* %0 to i64
%10 = sub i64 %8, %9
%11 = ashr exact i64 %10, 3
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void ireboot() { syscall(0x4952, 0, 0, 0); }


x86 assembly (clang, -O0):
<ireboot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4952,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ireboot>:
mov    $0x4952,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define void @ireboot() {
%1 = call i32 @syscall(i32 18770, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @ireboot() {
%1 = tail call i32 @syscall(i32 18770, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ errnoThrow(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char const *, struct stat *);
unsigned Sys_FileStat(const char *name) {
  struct stat s;
  errnoThrow(stat(name, &s));
  return s.st_mode;
}


x86 assembly (clang, -O0):
<Sys_FileStat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,%edi
call   1040 <errnoThrow@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_FileStat>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%edi
call   1040 <errnoThrow@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @Sys_FileStat(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = call i32 @errnoThrow(i32 %5)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @Sys_FileStat(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = tail call i32 @errnoThrow(i32 %4)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
size_t atoi(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *);
int main(int argc, char *argv[]) {
  char b[10];
  size_t len = atoi(argv[1]);
  (void)snprintf(b, len, "%s", "0123456789");
  (void)printf("%s\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %rax,-0x28(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    0xe9a(%rip),%rdx
lea    0xe96(%rip),%rcx
call   1040 <snprintf@plt>
lea    -0x1a(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
lea    0xebb(%rip),%rdx
lea    0xeb7(%rip),%rcx
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <snprintf@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"0123456789\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @atoi(i8* %10)
store i64 %11, i64* %7
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%13 = load i64, i64* %7
%14 = call i32 @snprintf(i8* %12, i64 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"0123456789\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @atoi(i8* %6)
%8 = call i32 @snprintf(i8* %4, i64 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int pthread_setcancelstate(int state, int *oldstate) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_setcancelstate(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
swapstk() { ol("ldy\t(s)\nstd\t(s)\n\ttfr\ty,d"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"ldy\09(s)\0Astd\09(s)\0A\09tfr\09y,d\00"
define i32 @swapstk() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [25 x i8] c"ldy\09(s)\0Astd\09(s)\0A\09tfr\09y,d\00"
define i32 @swapstk() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int test_imm_57uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x57 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_57uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 87
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char *);
char *strset(char *old, char *newstr) {
  if (old)
    free(old);
  return strdup(newstr);
}


x86 assembly (clang, -O0):
<strset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <strset+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strset>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     112e <strset+0xe>
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
define i8* @strset(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = call i8* @strdup(i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @strset(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = tail call i8* @strdup(i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ mclInitialize(int);
int /*<<< orphan*/ printf(char *);
int main() {
  mclInitialize(3);
  printf("Program ended succesfully.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <mclInitialize@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <mclInitialize@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Program ended succesfully.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mclInitialize(i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Program ended succesfully.\00"
define i32 @main() {
%1 = tail call i32 @mclInitialize(i32 3)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void f(void) {
#pragma hlt block factor(4)
  while (1)
    ;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f+0x9>
jmp    1109 <f+0x9>

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

LLVM IR (-O0):
define void @f() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @f() {
br label %1
1: ; preds = %0, %1
br label %1
}
int Bematech_FI_EstadoImpressora(Retorno) {
  char *Var[3];
  return Formata("\x1b|19|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_EstadoImpressora>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_EstadoImpressora>:
sub    $0x18,%rsp
mov    %edi,%edx
lea    0xee3(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <Formata@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|19|\1B\00"
define i32 @Bematech_FI_EstadoImpressora(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8*]
store i32 %0, i32* %2
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 (i8*, i8**, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i8**, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|19|\1B\00"
define i32 @Bematech_FI_EstadoImpressora(i32 %0) {
%2 = alloca [3 x i8*]
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%5 = call i32 (i8*, i8**, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i8**, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4, i32 %0)
ret i32 %5
}
/* Variables and functions */
scalar_t__ fmal(long double, long double, long double);
int /*<<< orphan*/ link_failure_fmal();
void test_fmal(long double ld1, long double ld2, long double ld3) {
  if (fmal(ld1, ld2, ld3) != fmal(ld1, ld2, ld3))
    link_failure_fmal();
}


x86 assembly (clang, -O0):
<test_fmal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <fmal@plt>
mov    %rax,-0x38(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <fmal@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
je     1187 <test_fmal+0x67>
mov    $0x0,%al
call   1030 <link_failure_fmal@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmal>:
push   %rbx
sub    $0x60,%rsp
fldt   0x70(%rsp)
fld    %st(0)
fstpt  0x54(%rsp)
fldt   0x80(%rsp)
fld    %st(0)
fstpt  0x48(%rsp)
fldt   0x90(%rsp)
fld    %st(0)
fstpt  0x3c(%rsp)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1040 <fmal@plt>
mov    %rax,%rbx
fldt   0x3c(%rsp)
fstpt  0x20(%rsp)
fldt   0x48(%rsp)
fstpt  0x10(%rsp)
fldt   0x54(%rsp)
fstpt  (%rsp)
call   1040 <fmal@plt>
cmp    %rax,%rbx
jne    1183 <test_fmal+0x63>
add    $0x60,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
jmp    1030 <link_failure_fmal@plt>

LLVM IR (-O0):
define void @test_fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %4
%8 = load x86_fp80, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %6
%10 = call i64 @fmal(x86_fp80 %7, x86_fp80 %8, x86_fp80 %9)
%11 = load x86_fp80, x86_fp80* %4
%12 = load x86_fp80, x86_fp80* %5
%13 = load x86_fp80, x86_fp80* %6
%14 = call i64 @fmal(x86_fp80 %11, x86_fp80 %12, x86_fp80 %13)
%15 = icmp ne i64 %10, %14
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = call i32 (...) @link_failure_fmal()
br label %18
18: ; preds = %16, %3
ret void
}

LLVM IR (-O2):
define void @test_fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = tail call i64 @fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2)
%5 = tail call i64 @fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2)
%6 = icmp eq i64 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (...) @link_failure_fmal()
br label %9
9: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", "hello world!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int isxdigit(int c) {
  return ((c >= 0x30 && c <= 0x39) || (c >= 0x41 && c <= 0x46) ||
          (c >= 0x61 && c <= 0x66));
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x66,-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):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
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, 70
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 102
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 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void _srm_free_suite(struct memSuite *suite) {}


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

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

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

LLVM IR (-O2):
%struct.memSuite = type opaque
define void @_srm_free_suite(%struct.memSuite* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
bool is_valid_id_char(char c) { return isalnum(c) || c == '-' || c == '_'; }


x86 assembly (clang, -O0):
<is_valid_id_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <is_valid_id_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1158 <is_valid_id_char+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_id_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x2d,%bl
sete   %cl
cmp    $0x5f,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_valid_id_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 95
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_valid_id_char(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 45
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 95
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ lircd_client_add();
int lircd_handler(void *id __attribute__((unused))) {
  if (lircd_client_add() != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<lircd_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <lircd_client_add@plt>
cmp    $0x0,%rax
je     1139 <lircd_handler+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1140 <lircd_handler+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lircd_handler>:
push   %rax
xor    %eax,%eax
call   1030 <lircd_client_add@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lircd_handler(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @lircd_client_add()
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
void balance_speed_slow() {}


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

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

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

LLVM IR (-O2):
define void @balance_speed_slow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ tests_alpha();
scalar_t__ tests_beta();
int main(void) {
  int total_tests_failed = 0;
  total_tests_failed += tests_alpha();
  total_tests_failed += tests_beta();
  printf("A total of %d tests have failed\n", total_tests_failed);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <tests_alpha@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <tests_beta@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <tests_alpha@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <tests_beta@plt>
add    %eax,%ebx
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"A total of %d tests have failed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @tests_alpha()
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, %2
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = call i64 (...) @tests_beta()
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"A total of %d tests have failed\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @tests_alpha()
%2 = tail call i64 (...) @tests_beta()
%3 = add i64 %2, %1
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int checker_strcmp_ucs4(const int *s1, const int *s2) {
  while (*s1 == *s2 && *s1) {
    s1++, s2++;
  }
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<checker_strcmp_ucs4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    (%rdx),%ecx
mov    %al,-0x11(%rbp)
jne    1130 <checker_strcmp_ucs4+0x30>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1140 <checker_strcmp_ucs4+0x40>
jmp    115d <checker_strcmp_ucs4+0x5d>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <checker_strcmp_ucs4+0xc>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_strcmp_ucs4>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
test   %eax,%eax
je     1132 <checker_strcmp_ucs4+0x32>
cmp    %ecx,%eax
jne    1132 <checker_strcmp_ucs4+0x32>
mov    $0x4,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rdi,%rdx,1),%eax
mov    (%rsi,%rdx,1),%ecx
test   %eax,%eax
je     1132 <checker_strcmp_ucs4+0x32>
add    $0x4,%rdx
cmp    %ecx,%eax
je     1120 <checker_strcmp_ucs4+0x20>
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @checker_strcmp_ucs4(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %3, %4
%6 = icmp eq i32 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i32* [ %12, %8 ], [ %1, %2 ]
%10 = phi i32* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = getelementptr inbounds i32, i32* %9, i64 1
%13 = load i32, i32* %11
%14 = load i32, i32* %12
%15 = icmp ne i32 %13, %14
%16 = icmp eq i32 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i32 [ %3, %2 ], [ %13, %8 ]
%20 = phi i32 [ %4, %2 ], [ %14, %8 ]
%21 = sub nsw i32 %19, %20
ret i32 %21
}
float sk_scale(float in, float min, float max) {
  return in * (max - min) + min;
}


x86 assembly (clang, -O0):
<sk_scale>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_scale>:
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sk_scale(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = load float, float* %5
%10 = fsub float %8, %9
%11 = load float, float* %5
%12 = call float @llvm.fmuladd.f32(float %7, float %10, float %11)
ret float %12
}

LLVM IR (-O2):
define float @sk_scale(float %0, float %1, float %2) {
%4 = fsub float %2, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %1)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
void outOfMemory(void) { fatal("%s", ("Out of memory")); }


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

x86 assembly (clang, -O2):
<outOfMemory>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"Out of memory\00"
define void @outOfMemory() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [14 x i8] c"Out of memory\00"
define void @outOfMemory() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo657(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo657(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main(void) {
  int *p = malloc(1024 * 1024 * 1024);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x40000000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x40000000,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 1073741824)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @free(i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 1073741824)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("This is foo!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"This is foo!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}