xunge/DecIR huggingface dataset:
/* Variables and functions */
int bitOr(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 60;
  int b = 13;
  int c = bitOr(a, b);
  printf("%d|%d should be %d\n", a, b, 61);
  printf("bitOr(%d, %d) -> %d\n", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3c,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <bitOr@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeaf(%rip),%rdi
mov    $0x3d,%ecx
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3c,%edi
mov    $0xd,%esi
call   1040 <bitOr@plt>
mov    %eax,%ebx
lea    0xec7(%rip),%rdi
mov    $0x3c,%esi
mov    $0xd,%edx
mov    $0x3d,%ecx
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x3c,%esi
mov    $0xd,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%d|%d should be %d\0A\00"
@.str.1 = [21 x i8] c"bitOr(%d, %d) -> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 60, i32* %1
store i32 13, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @bitOr(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 61)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d|%d should be %d\0A\00"
@.str.1 = [21 x i8] c"bitOr(%d, %d) -> %d\0A\00"
define i32 @main() {
%1 = tail call i32 @bitOr(i32 60, i32 13)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 60, i32 13, i32 61)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 60, i32 13, i32 %1)
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
struct sockaddr_in *malloc(int);
struct sockaddr_in *sockaddr_in_set(struct sockaddr_in *, char const *, int);
struct sockaddr_in *sockaddr_in_new(const char *ipaddr, int port) {
  struct sockaddr_in *sa = malloc(sizeof(*sa));
  sa = sockaddr_in_set(sa, ipaddr, port);
  return sa;
}


x86 assembly (clang, -O0):
<sockaddr_in_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <sockaddr_in_set@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockaddr_in_new>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sockaddr_in_set@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define %struct.sockaddr_in* @sockaddr_in_new(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.sockaddr_in*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call %struct.sockaddr_in* @malloc(i32 4)
store %struct.sockaddr_in* %6, %struct.sockaddr_in** %5
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call %struct.sockaddr_in* @sockaddr_in_set(%struct.sockaddr_in* %7, i8* %8, i32 %9)
store %struct.sockaddr_in* %10, %struct.sockaddr_in** %5
%11 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
ret %struct.sockaddr_in* %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define %struct.sockaddr_in* @sockaddr_in_new(i8* %0, i32 %1) {
%3 = tail call %struct.sockaddr_in* @malloc(i32 4)
%4 = tail call %struct.sockaddr_in* @sockaddr_in_set(%struct.sockaddr_in* %3, i8* %0, i32 %1)
ret %struct.sockaddr_in* %4
}
/* Variables and functions */
float circleIn(int, float, float, float);
float circleOut(float fraction, float start, float delta, float slope) {
  return circleIn(1 - fraction, start + delta, -delta, slope);
}


x86 assembly (clang, -O0):
<circleOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  0xecc(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <circleIn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circleOut>:
movss  0xee8(%rip),%xmm4
subss  %xmm0,%xmm4
cvttss2si %xmm4,%edi
movaps %xmm1,%xmm0
addss  %xmm2,%xmm0
xorps  0xee2(%rip),%xmm2
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <circleIn@plt>

LLVM IR (-O0):
define float @circleOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = fsub float 1.000000e+00, %9
%11 = fptosi float %10 to i32
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fadd float %12, %13
%15 = load float, float* %7
%16 = fneg float %15
%17 = load float, float* %8
%18 = call float @circleIn(i32 %11, float %14, float %16, float %17)
ret float %18
}

LLVM IR (-O2):
define float @circleOut(float %0, float %1, float %2, float %3) {
%5 = fsub float 1.000000e+00, %0
%6 = fptosi float %5 to i32
%7 = fadd float %1, %2
%8 = fneg float %2
%9 = tail call float @circleIn(i32 %6, float %7, float %8, float %3)
ret float %9
}
void gtk_paned_set_position() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paned_set_position() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printb(int);
int /*<<< orphan*/ printd(int);
void right(int a, int b) {
  printb(a);
  print(" >> ");
  printd(b);
  print(" -> ");
  printb(a >> b);
  print("\r\n");
}


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <printb@plt>
lea    0xeb3(%rip),%rdi
call   1050 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printd@plt>
lea    0xea4(%rip),%rdi
call   1050 <print@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
sar    %cl,%edi
call   1030 <printb@plt>
lea    0xe90(%rip),%rdi
call   1050 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <printb@plt>
lea    0xebd(%rip),%rdi
call   1050 <print@plt>
mov    %ebx,%edi
call   1040 <printd@plt>
lea    0xeaf(%rip),%rdi
call   1050 <print@plt>
mov    %ebx,%ecx
sar    %cl,%ebp
mov    %ebp,%edi
call   1030 <printb@plt>
lea    0xe9d(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <print@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" >> \00"
@.str.1 = [5 x i8] c" -> \00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @right(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 = call i32 @printb(i32 %5)
%7 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @printd(i32 %8)
%10 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = call i32 @printb(i32 %13)
%15 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" >> \00"
@.str.1 = [5 x i8] c" -> \00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @right(i32 %0, i32 %1) {
%3 = tail call i32 @printb(i32 %0)
%4 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printd(i32 %1)
%6 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = ashr i32 %0, %1
%8 = tail call i32 @printb(i32 %7)
%9 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void fftw_assertion_failed(const char *s, int line, const char *file) {
  fflush(stdout);
  fprintf(stderr, "fftw: %s:%d: assertion failed: %s\n", file, line, s);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fftw_assertion_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fftw_assertion_failed>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %r14,%r8
call   1030 <fprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [35 x i8] c"fftw: %s:%d: assertion failed: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fftw_assertion_failed(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i32, i32* %5
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [35 x i8] c"fftw: %s:%d: assertion failed: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @fftw_assertion_failed(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %1, i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Variables and functions */
char *emalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *estrdup(const char *oldstring) {
  char *s;
  s = emalloc(strlen(oldstring) + 4 + 1);
  strcpy(s, oldstring);
  return s;
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x4,%rdi
add    $0x1,%rdi
call   1050 <emalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x5(%rax),%rdi
call   1050 <emalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @estrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 4
%7 = add nsw i64 %6, 1
%8 = call i8* @emalloc(i64 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @estrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 5
%4 = tail call i8* @emalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
struct wl_shm_listener {
  int dummy;
};
struct wl_shm {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int wl_shm_add_listener(struct wl_shm *wl_shm,
                        const struct wl_shm_listener *listener, void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)wl_shm,
                               (void (**)(void))listener, data);
}


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

x86 assembly (clang, -O2):
<wl_shm_add_listener>:
jmp    1030 <wl_proxy_add_listener@plt>

LLVM IR (-O0):
%struct.wl_shm = type { i32 }
%struct.wl_shm_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_shm_add_listener(%struct.wl_shm* %0, %struct.wl_shm_listener* %1, i8* %2) {
%4 = alloca %struct.wl_shm*
%5 = alloca %struct.wl_shm_listener*
%6 = alloca i8*
store %struct.wl_shm* %0, %struct.wl_shm** %4
store %struct.wl_shm_listener* %1, %struct.wl_shm_listener** %5
store i8* %2, i8** %6
%7 = load %struct.wl_shm*, %struct.wl_shm** %4
%8 = bitcast %struct.wl_shm* %7 to %struct.wl_proxy*
%9 = load %struct.wl_shm_listener*, %struct.wl_shm_listener** %5
%10 = bitcast %struct.wl_shm_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.wl_shm = type { i32 }
%struct.wl_shm_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_shm_add_listener(%struct.wl_shm* %0, %struct.wl_shm_listener* %1, i8* %2) {
%4 = bitcast %struct.wl_shm* %0 to %struct.wl_proxy*
%5 = bitcast %struct.wl_shm_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ glutMainLoopEvent();
void checkKeyPressed() { glutMainLoopEvent(); }


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

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

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

LLVM IR (-O2):
define void @checkKeyPressed() {
%1 = tail call i32 (...) @glutMainLoopEvent()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void StopLength(double boardLength) {
  printf("Menzurka szyjki wynosi: %lf\n Menzurka plyty wynosi: %lf\n\n",
         boardLength * 0.181 * 2, boardLength * 0.181 * 3);
}


x86 assembly (clang, -O0):
<StopLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeb5(%rip),%xmm2
mulsd  %xmm2,%xmm1
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StopLength>:
movapd %xmm0,%xmm1
mulsd  0xee4(%rip),%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xedc(%rip),%xmm1
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"Menzurka szyjki wynosi: %lf\0A Menzurka plyty wynosi: %lf\0A\0A\00"
define void @StopLength(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.810000e-01
%5 = fmul double %4, 2.000000e+00
%6 = load double, double* %2
%7 = fmul double %6, 1.810000e-01
%8 = fmul double %7, 3.000000e+00
%9 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), double %5, double %8)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"Menzurka szyjki wynosi: %lf\0A Menzurka plyty wynosi: %lf\0A\0A\00"
define void @StopLength(double %0) {
%2 = fmul double %0, 1.810000e-01
%3 = fmul double %2, 2.000000e+00
%4 = fmul double %2, 3.000000e+00
%5 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), double %3, double %4)
ret void
}
/* Variables and functions */
bool hasMatched(int reti) { return !reti; }


x86 assembly (clang, -O0):
<hasMatched>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasMatched>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @hasMatched(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hasMatched(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void loopagain(void) {}


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

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

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

LLVM IR (-O2):
define void @loopagain() {
ret void
}
double correct_position(double c, double r, double l) {
  double d;
  d = r - c;
  if (d > 0.5 * l)
    return r - l;
  else if (d < -0.5 * l)
    return r + l;
  else
    return r;
}


x86 assembly (clang, -O0):
<correct_position>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    1152 <correct_position+0x52>
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118c <correct_position+0x8c>
movsd  -0x28(%rbp),%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1182 <correct_position+0x82>
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118c <correct_position+0x8c>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<correct_position>:
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
movsd  0xef0(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm3
jbe    1123 <correct_position+0x23>
subsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xedd(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm3,%xmm0
jbe    1139 <correct_position+0x39>
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @correct_position(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%9 = load double, double* %6
%10 = load double, double* %5
%11 = fsub double %9, %10
store double %11, double* %8
%12 = load double, double* %8
%13 = load double, double* %7
%14 = fmul double 5.000000e-01, %13
%15 = fcmp ogt double %12, %14
br i1 %15, label %16, label %20
16: ; preds = %3
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fsub double %17, %18
store double %19, double* %4
br label %31
20: ; preds = %3
%21 = load double, double* %8
%22 = load double, double* %7
%23 = fmul double -5.000000e-01, %22
%24 = fcmp olt double %21, %23
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = load double, double* %6
%27 = load double, double* %7
%28 = fadd double %26, %27
store double %28, double* %4
br label %31
29: ; preds = %20
%30 = load double, double* %6
store double %30, double* %4
br label %31
31: ; preds = %29, %25, %16
%32 = load double, double* %4
ret double %32
}

LLVM IR (-O2):
define double @correct_position(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fmul double %2, 5.000000e-01
%6 = fcmp ogt double %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = fsub double %1, %2
br label %14
9: ; preds = %3
%10 = fmul double %2, -5.000000e-01
%11 = fcmp olt double %4, %10
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = fadd double %1, %2
br label %14
14: ; preds = %9, %12, %7
%15 = phi double [ %8, %7 ], [ %13, %12 ], [ %1, %9 ]
ret double %15
}
int Foo(void) {
  return 11;
  return 12;
  return 13;
}


x86 assembly (clang, -O0):
<Foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Foo() {
ret i32 11
}

LLVM IR (-O2):
define i32 @Foo() {
ret i32 11
}
int test_imm_EBint8_mem(signed char *val) {
  return ((*val) & (0xEB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EBint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 235
%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_EBint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -21
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int cp8_emu_exec();
int /*<<< orphan*/ cp8_emu_set_argc_argv(int, char **);
int main(int argc, char **argv) {
  cp8_emu_set_argc_argv(argc, argv);
  return cp8_emu_exec();
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cp8_emu_set_argc_argv@plt>
mov    $0x0,%al
call   1040 <cp8_emu_exec@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @cp8_emu_set_argc_argv(i32 %6, i8** %7)
%9 = call i32 (...) @cp8_emu_exec()
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @cp8_emu_set_argc_argv(i32 %0, i8** %1)
%4 = tail call i32 (...) @cp8_emu_exec()
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t uint32p_comparator(const void *pl, const void *pr) {
  uint32_t lv = *(const uint32_t *)pl;
  uint32_t rv = *(const uint32_t *)pr;
  if (lv < rv)
    return -1;
  else if (lv == rv)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<uint32p_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <uint32p_comparator+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <uint32p_comparator+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <uint32p_comparator+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <uint32p_comparator+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32p_comparator>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @uint32p_comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void CmdThe(int code) {}


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

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

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

LLVM IR (-O2):
define void @CmdThe(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void parse_error(const int c, const char *msg) {
  if (msg)
    (void)fprintf(stderr, "getopt[%d]: %s\n", c, msg);
  (void)fprintf(stderr, "Try `getopt --help' for more information\n");
}


x86 assembly (clang, -O0):
<parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <parse_error+0x38>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_error>:
push   %rax
test   %rsi,%rsi
je     1132 <parse_error+0x22>
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"getopt[%d]: %s\0A\00"
@.str.1 = [42 x i8] c"Try `getopt --help' for more information\0A\00"
define void @parse_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i32, i32* %3
%10 = load i8*, i8** %4
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
br label %12
12: ; preds = %7, %2
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"getopt[%d]: %s\0A\00"
@.str.1 = [42 x i8] c"Try `getopt --help' for more information\0A\00"
define void @parse_error(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
br label %7
7: ; preds = %4, %2
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void mem_put_le16_as_int(void *vmem, int val) {
  unsigned char *mem = (unsigned char *)vmem;
  mem[0] = (unsigned char)((val >> 0) & 0xff);
  mem[1] = (unsigned char)((val >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<mem_put_le16_as_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_le16_as_int>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @mem_put_le16_as_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = ashr i32 %7, 0
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @mem_put_le16_as_int(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_puts(char *);
int /*<<< orphan*/ sim_exit(int);
int main() {
  debug_puts("\n"
             "This program tests the simulator magic exit port.\n"
             "There should be no more messages after this one.\n");
  sim_exit(4);
  debug_puts("ERROR - Simulation did not exit?\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <debug_puts@plt>
mov    $0x4,%edi
call   1030 <sim_exit@plt>
lea    0xf27(%rip),%rdi
call   1040 <debug_puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [101 x i8] c"\0AThis program tests the simulator magic exit port.\0AThere should be no more messages after this one.\0A\00"
@.str.1 = [34 x i8] c"ERROR - Simulation did not exit?\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @debug_puts(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sim_exit(i32 4)
%4 = call i32 @debug_puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [101 x i8] c"\0AThis program tests the simulator magic exit port.\0AThere should be no more messages after this one.\0A\00"
@.str.1 = [34 x i8] c"ERROR - Simulation did not exit?\0A\00"
define i32 @main() {
%1 = tail call i32 @debug_puts(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sim_exit(i32 4)
%3 = tail call i32 @debug_puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_ECuint8_mem(unsigned char *val) {
  return ((*val) & (0xEC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ECuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 236
%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_ECuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -20
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int unmailboxX(int i) { return (i % 12) - 2; }


x86 assembly (clang, -O0):
<unmailboxX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmailboxX>:
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x21,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @unmailboxX(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 12
%5 = sub nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @unmailboxX(i32 %0) {
%2 = srem i32 %0, 12
%3 = add nsw i32 %2, -2
ret i32 %3
}
/* Variables and functions */
scalar_t__ sin(int /*<<< orphan*/);
int main(void) { return (int)sin(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <sin@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @sin(i32 0)
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @sin(i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ a_barrier();
int a_ll(int volatile *);
int /*<<< orphan*/ a_post_llsc();
int /*<<< orphan*/ a_sc(int volatile *, unsigned int);
int a_fetch_add(volatile int *p, int v) {
  int old;
  a_barrier();
  do
    old = a_ll(p);
  while (!a_sc(p, (unsigned)old + v));
  a_post_llsc();
  return old;
}


x86 assembly (clang, -O0):
<a_fetch_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <a_barrier@plt>
mov    -0x8(%rbp),%rdi
call   1060 <a_ll@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
add    -0xc(%rbp),%esi
call   1050 <a_sc@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1156 <a_fetch_add+0x16>
mov    $0x0,%al
call   1030 <a_post_llsc@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_fetch_add>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <a_barrier@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
call   1060 <a_ll@plt>
mov    %eax,%ebx
lea    (%rbx,%r14,1),%esi
mov    %r15,%rdi
call   1050 <a_sc@plt>
test   %eax,%eax
je     1160 <a_fetch_add+0x20>
xor    %eax,%eax
call   1030 <a_post_llsc@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @a_fetch_add(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (...) @a_barrier()
br label %7
7: ; preds = %10, %2
%8 = load i32*, i32** %3
%9 = call i32 @a_ll(i32* %8)
store i32 %9, i32* %5
br label %10
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = add i32 %12, %13
%15 = call i32 @a_sc(i32* %11, i32 %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %7, label %18
18: ; preds = %10
%19 = call i32 (...) @a_post_llsc()
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @a_fetch_add(i32* %0, i32 %1) {
%3 = tail call i32 (...) @a_barrier()
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @a_ll(i32* %0)
%6 = add i32 %5, %1
%7 = tail call i32 @a_sc(i32* %0, i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4
%10 = tail call i32 (...) @a_post_llsc()
ret i32 %5
}
/* Variables and functions */
unsigned char *Z_NULL;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned int crc32(int, unsigned char *, int);
unsigned int _tc_getcrc_impl(const char *ptr, int size) {
  assert(ptr && size >= 0);
  int crc = crc32(0, Z_NULL, 0);
  return crc32(crc, (unsigned char *)ptr, size);
}


x86 assembly (clang, -O0):
<_tc_getcrc_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1149 <_tc_getcrc_impl+0x29>
cmpl   $0x0,-0xc(%rbp)
setge  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%rsi
xor    %edx,%edx
mov    %edx,%edi
call   1030 <crc32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <crc32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tc_getcrc_impl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %esi,%esi
setns  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1030 <crc32@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <crc32@plt>

LLVM IR (-O0):
@Z_NULL = global i8* null
define i32 @_tc_getcrc_impl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 0
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ false, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** @Z_NULL
%16 = call i32 @crc32(i32 0, i8* %15, i32 0)
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = call i32 @crc32(i32 %17, i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
@Z_NULL = global i8* null
define i32 @_tc_getcrc_impl(i8* %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp sgt i32 %1, -1
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i8*, i8** @Z_NULL
%9 = tail call i32 @crc32(i32 0, i8* %8, i32 0)
%10 = tail call i32 @crc32(i32 %9, i8* %0, i32 %1)
ret i32 %10
}
/* Variables and functions */
int epoll_create(int);
int do_epoll_create(int size) { return epoll_create(size); }


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

x86 assembly (clang, -O2):
<do_epoll_create>:
jmp    1030 <epoll_create@plt>

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

LLVM IR (-O2):
define i32 @do_epoll_create(i32 %0) {
%2 = tail call i32 @epoll_create(i32 %0)
ret i32 %2
}
void pipe_close() { return; }


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

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

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

LLVM IR (-O2):
define void @pipe_close() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

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


x86 assembly (clang, -O0):
<sd_event_run>:
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_run>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_run(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_run(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
double vec3_len(double *);
int /*<<< orphan*/ vec3_sub3(double *, double const *, double const *);
double vec3_dist(const double *v1, const double *v2) {
  double tmp[3];
  vec3_sub3(tmp, v1, v2);
  return vec3_len(tmp);
}


x86 assembly (clang, -O0):
<vec3_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <vec3_sub3@plt>
lea    -0x30(%rbp),%rdi
call   1040 <vec3_len@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_dist>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <vec3_sub3@plt>
mov    %rbx,%rdi
call   1040 <vec3_len@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @vec3_dist(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [3 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%7 = load double*, double** %3
%8 = load double*, double** %4
%9 = call i32 @vec3_sub3(double* %6, double* %7, double* %8)
%10 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%11 = call double @vec3_len(double* %10)
ret double %11
}

LLVM IR (-O2):
define double @vec3_dist(double* %0, double* %1) {
%3 = alloca [3 x double]
%4 = bitcast [3 x double]* %3 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%6 = call i32 @vec3_sub3(double* %5, double* %0, double* %1)
%7 = call double @vec3_len(double* %5)
ret double %7
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
scalar_t__ UINT32_C(int);
bool uid_is_dynamic(uid_t uid) {
  return ((uid_t)UINT32_C(0x0000EF00)) <= uid &&
         uid <= ((uid_t)UINT32_C(0x0000FFEF));
}


x86 assembly (clang, -O0):
<uid_is_dynamic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xef00,%edi
call   1030 <UINT32_C@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x9(%rbp)
jg     115a <uid_is_dynamic+0x4a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0xffef,%edi
call   1030 <UINT32_C@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uid_is_dynamic>:
push   %rbx
mov    %rdi,%rbx
mov    $0xef00,%edi
call   1030 <UINT32_C@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jg     113d <uid_is_dynamic+0x2d>
mov    $0xffef,%edi
call   1030 <UINT32_C@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
setge  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @uid_is_dynamic(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 @UINT32_C(i32 61184)
%4 = load i64, i64* %2
%5 = icmp sle i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i64 @UINT32_C(i32 65519)
%9 = icmp sle i64 %7, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @uid_is_dynamic(i64 %0) {
%2 = tail call i64 @UINT32_C(i32 61184)
%3 = icmp sgt i64 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @UINT32_C(i32 65519)
%6 = icmp sge i64 %5, %0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
char *formatSize(unsigned long);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ replace(char **, char const *, char *);
void replaceWithSize(char **where, const char *what, unsigned long int bytes) {
  char *replacement = formatSize(bytes);
  replace(where, what, replacement);
  free(replacement);
}


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

x86 assembly (clang, -O2):
<replaceWithSize>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <formatSize@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1050 <replace@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @replaceWithSize(i8** %0, i8* %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i8* @formatSize(i64 %8)
store i8* %9, i8** %7
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %7
%13 = call i32 @replace(i8** %10, i8* %11, i8* %12)
%14 = load i8*, i8** %7
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
define void @replaceWithSize(i8** %0, i8* %1, i64 %2) {
%4 = tail call i8* @formatSize(i64 %2)
%5 = tail call i32 @replace(i8** %0, i8* %1, i8* %4)
%6 = tail call i32 @free(i8* %4)
ret void
}
void multi_o() {
  register int out0 = 0;
  register int index = 1;
}


x86 assembly (clang, -O0):
<multi_o>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @multi_o() {
ret void
}
__typeof__(puts("")) test_puts_204(void) { return puts(""); }


x86 assembly (clang, -O0):
<test_puts_204>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_puts_204() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_puts_204() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int floor(int);
int parent(int child) { int parent = floor(child / 2); }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <floor@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @parent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 2
%7 = call i32 @floor(i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @floor(i32 %2)
ret i32 undef
}