xunge/DecIR huggingface dataset:
void fillcol(int *blk, int val) {
  blk[0 * 8] = blk[1 * 8] = blk[2 * 8] = blk[3 * 8] = blk[4 * 8] = blk[5 * 8] =
      blk[6 * 8] = blk[7 * 8] = val;
}


x86 assembly (clang, -O0):
<fillcol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xe0(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0xc0(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0xa0(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x80(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x60(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x40(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillcol>:
mov    %esi,0xe0(%rdi)
mov    %esi,0xc0(%rdi)
mov    %esi,0xa0(%rdi)
mov    %esi,0x80(%rdi)
mov    %esi,0x60(%rdi)
mov    %esi,0x40(%rdi)
mov    %esi,0x20(%rdi)
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @fillcol(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 56
store i32 %5, i32* %7
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 48
store i32 %5, i32* %9
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 40
store i32 %5, i32* %11
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 32
store i32 %5, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 24
store i32 %5, i32* %15
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 16
store i32 %5, i32* %17
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 8
store i32 %5, i32* %19
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 0
store i32 %5, i32* %21
ret void
}

LLVM IR (-O2):
define void @fillcol(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 56
store i32 %1, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 48
store i32 %1, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 40
store i32 %1, i32* %5
%6 = getelementptr inbounds i32, i32* %0, i64 32
store i32 %1, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 24
store i32 %1, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 16
store i32 %1, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 8
store i32 %1, i32* %9
store i32 %1, i32* %0
ret void
}
float plus(float a, float b) { return a + b; }


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

x86 assembly (clang, -O2):
<plus>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @plus(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 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @plus(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
int test_imm_B4int16_mem(short *val) {
  return ((*val) & (-0xB4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B4int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -180
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
reg0adr1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ r0 = (*((float *)11111111)); }


x86 assembly (clang, -O0):
<reg0adr1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa98ac7,%eax
movss  (%rax),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reg0adr1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* inttoptr (i64 11111111 to float*)
store float %16, float* %8
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @reg0adr1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
ret i32 undef
}
int get_interface_ip(const char *iface, struct sockaddr_in *sin) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.sockaddr_in = type opaque
define i32 @get_interface_ip(i8* nocapture readnone %0, %struct.sockaddr_in* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_loopPosition();
int /*<<< orphan*/ test_setPosition();
int main(int argc, char *argv[]) {
  test_setPosition();
  test_loopPosition();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_setPosition@plt>
mov    $0x0,%al
call   1040 <test_loopPosition@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_setPosition@plt>
xor    %eax,%eax
call   1040 <test_loopPosition@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_setPosition()
%4 = tail call i32 (...) @test_loopPosition()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TCIFLUSH;
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ tcflush(int /*<<< orphan*/, int /*<<< orphan*/);
char do_getch(void) {
  char ch;
  int cnt = 1;
  cnt = read(STDIN_FILENO, &ch, cnt);
  tcflush(STDIN_FILENO, TCIFLUSH);
  if (cnt < 0)
    return -1;
  return ch;
}


x86 assembly (clang, -O0):
<do_getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    -0x2(%rbp),%rsi
call   1040 <read@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1171 <do_getch+0x51>
movb   $0xff,-0x1(%rbp)
jmp    1177 <do_getch+0x57>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_getch>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    %eax,%ebx
mov    (%r14),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
test   %ebx,%ebx
movzbl 0x7(%rsp),%ecx
mov    $0xff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@TCIFLUSH = global i32 0
define signext i8 @do_getch() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
store i32 1, i32* %3
%4 = load i32, i32* @STDIN_FILENO
%5 = load i32, i32* %3
%6 = call i32 @read(i32 %4, i8* %2, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @STDIN_FILENO
%8 = load i32, i32* @TCIFLUSH
%9 = call i32 @tcflush(i32 %7, i32 %8)
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %0
store i8 -1, i8* %1
br label %15
13: ; preds = %0
%14 = load i8, i8* %2
store i8 %14, i8* %1
br label %15
15: ; preds = %13, %12
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@TCIFLUSH = global i32 0
define signext i8 @do_getch() {
%1 = alloca i8
%2 = load i32, i32* @STDIN_FILENO
%3 = call i32 @read(i32 %2, i8* %1, i32 1)
%4 = load i32, i32* @STDIN_FILENO
%5 = load i32, i32* @TCIFLUSH
%6 = tail call i32 @tcflush(i32 %4, i32 %5)
%7 = icmp slt i32 %3, 0
%8 = load i8, i8* %1
%9 = select i1 %7, i8 -1, i8 %8
ret i8 %9
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int ReceiveSocketData(int sock, char *buf, int len) {
  return recv(sock, buf, len, 0);
}


x86 assembly (clang, -O0):
<ReceiveSocketData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReceiveSocketData>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @ReceiveSocketData(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ror32(uint32_t x, int r) { return (x >> r) | (x << (32 - r)); }


x86 assembly (clang, -O0):
<ror32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror32>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror32(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror32(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcrossing_x(void *_p, int _v) {
  ((XEvent *)_p)->xcrossing.x = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcrossing_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcrossing_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcrossing_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
float sqrtf(float);
float __ocl_half_sqrt_float(float src) { return sqrtf(src); }


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

x86 assembly (clang, -O2):
<__ocl_half_sqrt_float>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <__ocl_half_sqrt_float+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @__ocl_half_sqrt_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__ocl_half_sqrt_float(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, int);
int /*<<< orphan*/ print_type(char *, int);
void gen_int64() {
  if (sizeof(long) == 8)
    print_type("long", 64);
  else if (sizeof(long long) == 8)
    print_type("long long", 64);
  else
    print_error("long long", sizeof(long long));
}


x86 assembly (clang, -O0):
<gen_int64>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x40,%esi
call   1030 <print_type@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_int64>:
lea    0xee9(%rip),%rdi
mov    $0x40,%esi
jmp    1030 <print_type@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"long\00"
define void @gen_int64() {
%1 = call i32 @print_type(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 64)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"long\00"
define void @gen_int64() {
%1 = tail call i32 @print_type(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 64)
ret void
}
short int shortint_ignoring_unsignedint(short int x, unsigned int y) {
  return x;
}


x86 assembly (clang, -O0):
<shortint_ignoring_unsignedint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @shortint_ignoring_unsignedint(i16 returned signext %0, i32 %1) {
ret i16 %0
}
int count() {
  static int c = 0;
  return ++c;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@count.c = internal global i32 0
define i32 @count() {
%1 = load i32, i32* @count.c
%2 = add nsw i32 %1, 1
store i32 %2, i32* @count.c
ret i32 %2
}

LLVM IR (-O2):
@count.c = internal unnamed_addr global i32 0
define i32 @count() {
%1 = load i32, i32* @count.c
%2 = add nsw i32 %1, 1
store i32 %2, i32* @count.c
ret i32 %2
}
void chartest(char d) { printf("%s with arg %d\n", __FUNCTION__, (int)d); }


x86 assembly (clang, -O0):
<chartest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
lea    0xed7(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chartest>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s with arg %d\0A\00"
@__FUNCTION__.chartest = [9 x i8] c"chartest\00"
define void @chartest(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.chartest, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s with arg %d\0A\00"
@__FUNCTION__.chartest = [9 x i8] c"chartest\00"
define void @chartest(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.chartest, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ nrerror(char *);
void free_ivector(int *v, long nl, long nh) {
  if (nh < 0)
    nrerror("free_ivector: nh must be >=0");
  free((char *)(v + nl - 1));
}


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    114b <free_ivector+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <nrerror@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdx,%rdx
jns    113b <free_ivector+0x1b>
lea    0xeca(%rip),%rdi
call   1040 <nrerror@plt>
lea    (%rbx,%r14,4),%rdi
add    $0xfffffffffffffffc,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"free_ivector: nh must be >=0\00"
define void @free_ivector(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @nrerror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
%12 = load i32*, i32** %4
%13 = load i64, i64* %5
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = getelementptr inbounds i32, i32* %14, i64 -1
%16 = bitcast i32* %15 to i8*
%17 = call i32 @free(i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"free_ivector: nh must be >=0\00"
define void @free_ivector(i32* nocapture %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @nrerror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = getelementptr inbounds i32, i32* %0, i64 %1
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = bitcast i32* %9 to i8*
%11 = tail call i32 @free(i8* %10)
ret void
}
/* Variables and functions */
int FALSE;
int /*<<< orphan*/ isalpha(int);
int step_ok(int ch) {
  switch (ch) {
  case ' ':
  case '|':
  case '-':
    return FALSE;
  default:
    return (!isalpha(ch));
  }
}


x86 assembly (clang, -O0):
<step_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x20,%eax
je     1151 <step_ok+0x41>
jmp    112f <step_ok+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     1151 <step_ok+0x41>
jmp    1140 <step_ok+0x30>
mov    -0xc(%rbp),%eax
sub    $0x7c,%eax
jne    1162 <step_ok+0x52>
jmp    1151 <step_ok+0x41>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <step_ok+0x6a>
mov    -0x8(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<step_ok>:
push   %rax
cmp    $0x20,%edi
je     1120 <step_ok+0x10>
cmp    $0x7c,%edi
je     1120 <step_ok+0x10>
cmp    $0x2d,%edi
jne    112b <step_ok+0x1b>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
call   1030 <isalpha@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @step_ok(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 32, label %5
i32 124, label %5
i32 45, label %5
]
5: ; preds = %1, %1, %1
%6 = load i32, i32* @FALSE
store i32 %6, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @isalpha(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @step_ok(i32 %0) {
switch i32 %0, label %4 [
i32 32, label %2
i32 124, label %2
i32 45, label %2
]
2: ; preds = %1, %1, %1
%3 = load i32, i32* @FALSE
br label %8
4: ; preds = %1
%5 = tail call i32 @isalpha(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ %3, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_variadic(int *, int);
void f_variadic_unp_unv(void) {
  int t;
  int v;
  int *tp = &t;
  doStuff_variadic(tp, v);
}


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

x86 assembly (clang, -O2):
<f_variadic_unp_unv>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <doStuff_variadic@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f_variadic_unp_unv() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32* %1, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %2
%6 = call i32 @doStuff_variadic(i32* %4, i32 %5)
ret void
}

LLVM IR (-O2):
define void @f_variadic_unp_unv() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @doStuff_variadic(i32* %1, i32 undef)
ret void
}
/* Variables and functions */
scalar_t__ exist_argument(char *);
char *get_argument_str(char *);
char *get_metaserver() {
  char *result = "www.ufoot.org/metaserver/";
  if (exist_argument("metaserver")) {
    result = get_argument_str("metaserver");
  }
  return result;
}


x86 assembly (clang, -O0):
<get_metaserver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xee0(%rip),%rdi
call   1040 <exist_argument@plt>
cmp    $0x0,%rax
je     1159 <get_metaserver+0x39>
lea    0xeca(%rip),%rdi
call   1030 <get_argument_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_metaserver>:
push   %rax
lea    0xef2(%rip),%rdi
call   1040 <exist_argument@plt>
test   %rax,%rax
je     113f <get_metaserver+0x1f>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <get_argument_str@plt>
lea    0xeba(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"www.ufoot.org/metaserver/\00"
@.str.1 = [11 x i8] c"metaserver\00"
define i8* @get_metaserver() {
%1 = alloca i8*
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i64 @exist_argument(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i8* @get_argument_str(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %1
br label %6
6: ; preds = %4, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [26 x i8] c"www.ufoot.org/metaserver/\00"
@.str.1 = [11 x i8] c"metaserver\00"
define i8* @get_metaserver() {
%1 = tail call i64 @exist_argument(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i8* @get_argument_str(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %0 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double mp_bswap_double(double);
double mp_decode_double(const char **data) {
  unsigned char c = (unsigned char)**data;
  assert(c == 0xcb);
  (void)c;
  *data += 1;
  double val = mp_bswap_double(*(double *)*data);
  *data += sizeof(double);
  return val;
}


x86 assembly (clang, -O0):
<mp_decode_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0xcb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
call   1040 <mp_bswap_double@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_double>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
xor    %edi,%edi
cmpb   $0xcb,(%rax)
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsd  0x1(%rax),%xmm0
call   1040 <mp_bswap_double@plt>
addq   $0x8,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define double @mp_decode_double(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
%4 = alloca double
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 203
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8, i8* %3
%14 = load i8**, i8*** %2
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %14
%17 = load i8**, i8*** %2
%18 = load i8*, i8** %17
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = call double @mp_bswap_double(double %20)
store double %21, double* %4
%22 = load i8**, i8*** %2
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 8
store i8* %24, i8** %22
%25 = load double, double* %4
ret double %25
}

LLVM IR (-O2):
define double @mp_decode_double(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, -53
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = tail call double @mp_bswap_double(double %10)
%12 = load i8*, i8** %0
%13 = getelementptr inbounds i8, i8* %12, i64 8
store i8* %13, i8** %0
ret double %11
}
/* Variables and functions */
double MBtoPSI(double);
double KPAtoPSI(double KPA) {
  double PSI = MBtoPSI(KPA * 10);
  return PSI;
}


x86 assembly (clang, -O0):
<KPAtoPSI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <MBtoPSI@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KPAtoPSI>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <MBtoPSI@plt>

LLVM IR (-O0):
define double @KPAtoPSI(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+01
%6 = call double @MBtoPSI(double %5)
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @KPAtoPSI(double %0) {
%2 = fmul double %0, 1.000000e+01
%3 = tail call double @MBtoPSI(double %2)
ret double %3
}
int isLabel(const char *op) { return op[0] == '_' && op[1] == '$'; }


x86 assembly (clang, -O0):
<isLabel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5f,%ecx
mov    %al,-0x9(%rbp)
jne    112e <isLabel+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x24,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLabel>:
xor    %eax,%eax
cmpb   $0x5f,(%rdi)
jne    1110 <isLabel+0x10>
xor    %eax,%eax
cmpb   $0x24,0x1(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isLabel(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 95
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 36
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void swapi(int *a, int *b) {
  int w;
  w = *a;
  *a = *b;
  *b = w;
  return;
}


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

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

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

LLVM IR (-O2):
define void @swapi(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main(void) {
  char x, y;
  x = 'a';
  y = 'b';
  printf("x= %c \t y= %c\n", x, y);
  {
    char _z;
    _z = x;
    x = y;
    y = _z;
  };
  printf("x=%c \t y=%c\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x1(%rbp)
movb   $0x62,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed6(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xebd(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x61,%esi
mov    $0x62,%edx
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x62,%esi
mov    $0x61,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"x= %c \09 y= %c\0A\00"
@.str.1 = [13 x i8] c"x=%c \09 y=%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext 97, i8 signext 98)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext 98, i8 signext 97)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(int *, int, int, int /*<<< orphan*/ *);
int write_blsize(FILE *f, int *size) { return fwrite(size, sizeof(int), 1, f); }


x86 assembly (clang, -O0):
<write_blsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_blsize>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define i32 @write_blsize(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fwrite(i32* %1, i32 4, i32 1, i32* %0)
ret i32 %3
}
/* Variables and functions */
int g_is_term();
int xrdp_is_term(void) { return g_is_term(); }


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

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

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

LLVM IR (-O2):
define i32 @xrdp_is_term() {
%1 = tail call i32 (...) @g_is_term()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void write_stderr() { fprintf(stderr, "testing output to stderr\n"); }


x86 assembly (clang, -O0):
<write_stderr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_stderr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"testing output to stderr\0A\00"
define void @write_stderr() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"testing output to stderr\0A\00"
define void @write_stderr() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cfree(void *_ptr) { free(_ptr); }


x86 assembly (clang, -O0):
<cfree>:
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):
<cfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @cfree(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 @cfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
double negation(double n) { return -n; }


x86 assembly (clang, -O0):
<negation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<negation>:
xorps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @negation(double %0) {
%2 = fneg double %0
ret double %2
}
/* Variables and functions */
double log10(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double x, ret;
  x = 10000;
  ret = log10(x);
  printf("log10(%lf) = %lf\n", x, ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"log10(%lf) = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 1.000000e+04, double* %2
%4 = load double, double* %2
%5 = call double @log10(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"log10(%lf) = %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double 1.000000e+04, double 4.000000e+00)
ret i32 0
}
/* Variables and functions */
int bar5();
int foobar5() { return bar5(); }


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

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

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

LLVM IR (-O2):
define i32 @foobar5() {
%1 = tail call i32 (...) @bar5()
ret i32 %1
}
void PMClose() {}


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

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

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

LLVM IR (-O2):
define void @PMClose() {
ret void
}
long _computeFib(long EV_input) {
  if ((EV_input == 0)) {
    return 0;
  } else {
    if ((EV_input <= 2)) {
      return 1;
    } else {
      return (_computeFib((EV_input - 1)) + _computeFib((EV_input - 2)));
    }
  }
}


x86 assembly (clang, -O0):
<_computeFib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <_computeFib+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1178 <_computeFib+0x68>
cmpq   $0x2,-0x10(%rbp)
jg     114c <_computeFib+0x3c>
movq   $0x1,-0x8(%rbp)
jmp    1178 <_computeFib+0x68>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <_computeFib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <_computeFib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_computeFib>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114c <_computeFib+0x3c>
mov    %rdi,%rbx
mov    $0x1,%r14d
cmp    $0x3,%rdi
jl     114f <_computeFib+0x3f>
add    $0x2,%rbx
xor    %r14d,%r14d
nop
lea    -0x3(%rbx),%rdi
call   1030 <_computeFib@plt>
add    %rax,%r14
add    $0xfffffffffffffffe,%rbx
cmp    $0x4,%rbx
jg     1130 <_computeFib+0x20>
add    $0x1,%r14
jmp    114f <_computeFib+0x3f>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @_computeFib(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp slt i64 %0, 3
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = phi i64 [ %10, %5 ], [ %0, %3 ]
%8 = add nsw i64 %7, -1
%9 = tail call i64 @_computeFib(i64 %8)
%10 = add nsw i64 %7, -2
%11 = add nsw i64 %9, %6
%12 = icmp slt i64 %7, 5
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = add i64 %11, 1
br label %15
15: ; preds = %3, %13, %1
%16 = phi i64 [ 0, %1 ], [ %14, %13 ], [ 1, %3 ]
ret i64 %16
}
int iceil(float f) { return (int)(f + 0.9999999); }


x86 assembly (clang, -O0):
<iceil>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iceil>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @iceil(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 0x3FEFFFFFCA501ACB
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @iceil(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 0x3FEFFFFFCA501ACB
%4 = fptosi double %3 to i32
ret i32 %4
}
int pointer_comparison() {
  char a[10];
  char b[10];
  return b < a;
}


x86 assembly (clang, -O0):
<pointer_comparison>:
push   %rbp
mov    %rsp,%rbp
lea    -0x14(%rbp),%rax
lea    -0xa(%rbp),%rcx
cmp    %rcx,%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointer_comparison>:
lea    -0xa(%rsp),%rcx
lea    -0x14(%rsp),%rdx
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret

LLVM IR (-O0):
define i32 @pointer_comparison() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = icmp ult i8* %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @pointer_comparison() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = icmp ult [10 x i8]* %2, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
void av_register_input_format() {}


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

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

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

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

/* Variables and functions */
int futex_down_timeout_fairness(struct semaphore *, struct timespec *,
                                int /*<<< orphan*/);
int futex_down_timeout(struct semaphore *sem, struct timespec *rel) {
  return futex_down_timeout_fairness(sem, rel, 0);
}


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

x86 assembly (clang, -O2):
<futex_down_timeout>:
xor    %edx,%edx
jmp    1030 <futex_down_timeout_fairness@plt>

LLVM IR (-O0):
%struct.semaphore = type { i32 }
%struct.timespec = type { i32 }
define i32 @futex_down_timeout(%struct.semaphore* %0, %struct.timespec* %1) {
%3 = alloca %struct.semaphore*
%4 = alloca %struct.timespec*
store %struct.semaphore* %0, %struct.semaphore** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.semaphore*, %struct.semaphore** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @futex_down_timeout_fairness(%struct.semaphore* %5, %struct.timespec* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.semaphore = type { i32 }
%struct.timespec = type { i32 }
define i32 @futex_down_timeout(%struct.semaphore* %0, %struct.timespec* %1) {
%3 = tail call i32 @futex_down_timeout_fairness(%struct.semaphore* %0, %struct.timespec* %1, i32 0)
ret i32 %3
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ev_unloop(struct ev_loop *, int);
void x_loopexit_cb(int revents, void *base) {
  struct ev_loop *loop = (struct ev_loop *)base;
  ev_unloop(loop, 1);
}


x86 assembly (clang, -O0):
<x_loopexit_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1030 <ev_unloop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_loopexit_cb>:
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <ev_unloop@plt>

LLVM IR (-O0):
%struct.ev_loop = type { i32 }
define void @x_loopexit_cb(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.ev_loop*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.ev_loop*
store %struct.ev_loop* %7, %struct.ev_loop** %5
%8 = load %struct.ev_loop*, %struct.ev_loop** %5
%9 = call i32 @ev_unloop(%struct.ev_loop* %8, i32 1)
ret void
}

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define void @x_loopexit_cb(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.ev_loop*
%4 = tail call i32 @ev_unloop(%struct.ev_loop* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showUsage(char *progname) {
  printf("usage: %s [-2] [-s seconds] <ifile> <ofile>\n"
         " -2   use 2400 baud as output baudrate\n"
         " -s   define gap time (in seconds) between blocks (default 2)\n",
         progname);
}


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

x86 assembly (clang, -O2):
<showUsage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [146 x i8] c"usage: %s [-2] [-s seconds] <ifile> <ofile>\0A -2 use 2400 baud as output baudrate\0A -s define gap time (in seconds) between blocks (default 2)\0A\00"
define void @showUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [146 x i8] c"usage: %s [-2] [-s seconds] <ifile> <ofile>\0A -2 use 2400 baud as output baudrate\0A -s define gap time (in seconds) between blocks (default 2)\0A\00"
define void @showUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}