xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int /*<<< orphan*/ xcb_atom_t;

/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ XCB_ATOM_WINDOW;
int /*<<< orphan*/
xcb_get_property_unchecked(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
xcb_get_property_cookie_t xcb_icccm_get_wm_colormap_windows_unchecked(
    xcb_connection_t *c, xcb_window_t window,
    xcb_atom_t wm_colormap_windows_atom) {
  return xcb_get_property_unchecked(c, 0, window, wm_colormap_windows_atom,
                                    XCB_ATOM_WINDOW, 0, UINT_MAX);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_colormap_windows_unchecked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x2ec5(%rip),%rax
mov    (%rax),%r8d
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %eax,(%rsp)
call   1030 <xcb_get_property_unchecked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_colormap_windows_unchecked>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2edc(%rip),%rax
mov    (%rax),%r8d
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property_unchecked@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_WINDOW = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_wm_colormap_windows_unchecked(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @XCB_ATOM_WINDOW
%11 = load i32, i32* @UINT_MAX
%12 = call i32 @xcb_get_property_unchecked(i32* %7, i32 0, i32 %8, i32 %9, i32 %10, i32 0, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@XCB_ATOM_WINDOW = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_wm_colormap_windows_unchecked(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @XCB_ATOM_WINDOW
%5 = load i32, i32* @UINT_MAX
%6 = tail call i32 @xcb_get_property_unchecked(i32* %0, i32 0, i32 %1, i32 %2, i32 %4, i32 0, i32 %5)
ret i32 %6
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_keyboard {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/);
void wl_keyboard_release(struct wl_keyboard *wl_keyboard) {
  wl_proxy_marshal((struct wl_proxy *)wl_keyboard, 0);
  wl_proxy_destroy((struct wl_proxy *)wl_keyboard);
}


x86 assembly (clang, -O0):
<wl_keyboard_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wl_proxy_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_keyboard_release>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <wl_proxy_marshal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_keyboard = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_keyboard_release(%struct.wl_keyboard* %0) {
%2 = alloca %struct.wl_keyboard*
store %struct.wl_keyboard* %0, %struct.wl_keyboard** %2
%3 = load %struct.wl_keyboard*, %struct.wl_keyboard** %2
%4 = bitcast %struct.wl_keyboard* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 0)
%6 = load %struct.wl_keyboard*, %struct.wl_keyboard** %2
%7 = bitcast %struct.wl_keyboard* %6 to %struct.wl_proxy*
%8 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_keyboard = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_keyboard_release(%struct.wl_keyboard* %0) {
%2 = bitcast %struct.wl_keyboard* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 0)
%4 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
long double test_remquol(long double x, long double y, int *z) {
  return __builtin_remquol(x, y, z);
}


x86 assembly (clang, -O0):
<test_remquol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %rdi,-0x28(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    -0x28(%rbp),%rdi
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <remquol@plt>
fld    %st(0)
fstp   %st(0)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_remquol>:
jmp    1030 <remquol@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_remquol(x86_fp80 %0, x86_fp80 %1, i32* %2) {
%4 = tail call x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %2)
ret x86_fp80 %4
}
void glutSetMenu(int menu) {}


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

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

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

LLVM IR (-O2):
define void @glutSetMenu(i32 %0) {
ret void
}
int main() {
  int p1, p2;
  int x1, y1;
  {
    if (p1)
      x1 = 3;
    else
      x1 = 3;
  };
  {
    if (p2)
      y1 = 0;
    else
      y1 = 23456789;
  };
  while (x1 <= y1) {
    x1 = x1 << 15;
  }
  return x1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
movl   $0x3,-0x10(%rbp)
jmp    1128 <main+0x28>
movl   $0x3,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <main+0x3e>
movl   $0x0,-0x14(%rbp)
jmp    1145 <main+0x45>
movl   $0x165ec15,-0x14(%rbp)
jmp    114a <main+0x4a>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1164 <main+0x64>
mov    -0x10(%rbp),%eax
shl    $0xf,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <main+0x4a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x3,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
shl    $0xf,%ecx
cmp    $0x165ec16,%eax
jl     1110 <main+0x10>
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 3, %0 ], [ %4, %1 ]
%3 = icmp slt i32 %2, 23456790
%4 = shl i32 %2, 15
br i1 %3, label %1, label %5
5: ; preds = %1
ret i32 %2
}
void CRCCU_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @CRCCU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_session_is_remote(const char *session) {
  return -EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_session_is_remote(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int misael() { printf("Hola mundo xD\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hola mundo xD\00"
define i32 @misael() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int ll_back_merge_fn(struct request_queue *q, struct request *req,
                     struct bio *bio) {
  int a;
  return a;
}


x86 assembly (clang, -O0):
<ll_back_merge_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.request_queue = type opaque
%struct.request = type opaque
%struct.bio = type opaque
define i32 @ll_back_merge_fn(%struct.request_queue* %0, %struct.request* %1, %struct.bio* %2) {
%4 = alloca %struct.request_queue*
%5 = alloca %struct.request*
%6 = alloca %struct.bio*
%7 = alloca i32
store %struct.request_queue* %0, %struct.request_queue** %4
store %struct.request* %1, %struct.request** %5
store %struct.bio* %2, %struct.bio** %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.request = type opaque
%struct.bio = type opaque
define i32 @ll_back_merge_fn(%struct.request_queue* nocapture readnone %0, %struct.request* nocapture readnone %1, %struct.bio* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rob(int *, int);
int main(void) {
  int nums[] = {1, 2, 3, 4, 5};
  printf("%d\n", rob(nums, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <rob@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <rob@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @rob(i32* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @rob(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
double exp(double);
double tosReal_expE(double x) { return exp(x); }


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

x86 assembly (clang, -O2):
<tosReal_expE>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @tosReal_expE(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler_sigint() {
  printf("Para salir del shell use el comando \"logout\"\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"Para salir del shell use el comando \22logout\22\0A\00"
define void @handler_sigint() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"Para salir del shell use el comando \22logout\22\00"
define void @handler_sigint() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int exibe(void *dado) {
  int *num;
  num = (int *)dado;
  printf("dado = %d, \n", *num);
  return 1;
}


x86 assembly (clang, -O0):
<exibe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exibe>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"dado = %d, \0A\00"
define i32 @exibe(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"dado = %d, \0A\00"
define i32 @exibe(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 1
}
unsigned int getbe16(const unsigned char *p) {
  return (p[0] << 8) | (p[1] << 0);
}


x86 assembly (clang, -O0):
<getbe16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbe16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @getbe16(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 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 0
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @getbe16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t direct_clear32(volatile uint32_t *addr, uint32_t dat) {
  *addr &= ~dat;
  return dat;
}


x86 assembly (clang, -O0):
<direct_clear32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_clear32>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,(%rdi)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @direct_clear32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = xor i32 %5, -1
%7 = load i32*, i32** %3
%8 = load volatile i32, i32* %7
%9 = and i32 %8, %6
store volatile i32 %9, i32* %7
%10 = load volatile i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @direct_clear32(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = xor i32 %4, -1
%6 = load volatile i32, i32* %0
%7 = and i32 %6, %5
store volatile i32 %7, i32* %0
%8 = load volatile i32, i32* %3
ret i32 %8
}
unsigned int unused_integer_underflow2_Bad() {
  unsigned int n = 0;
  return --n;
}


x86 assembly (clang, -O0):
<unused_integer_underflow2_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unused_integer_underflow2_Bad() {
ret i32 -1
}
void ff_hevc_put_hevc_epel_h12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h12_12_sse4() {
ret void
}
/* Variables and functions */
char *memchr(char const *, char const, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const, char *);
int /*<<< orphan*/ strlen(char const *);
int main() {
  const char str[] = "http://www.Linkerist.com";
  const char ch = '.';
  char *ret;
  ret = memchr(str, ch, strlen(str));
  printf("String after |%c| is - |%s|\n", ch, ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x8(%rbp)
movb   $0x2e,-0x21(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%edx
mov    $0x2e,%esi
call   1050 <memchr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
lea    0xe7c(%rip),%rdi
mov    $0x2e,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xecd(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
mov    %eax,%edx
call   1050 <memchr@plt>
lea    0xeac(%rip),%rdi
mov    $0x2e,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [25 x i8] c"http://www.Linkerist.com\00"
@.str = [29 x i8] c"String after |%c| is - |%s|\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = alloca i8
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [25 x i8]* %2 to i8*
store i8 46, i8* %3
%6 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @memchr(i8* %6, i8 signext 46, i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 46, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [25 x i8] c"http://www.Linkerist.com\00"
@.str = [29 x i8] c"String after |%c| is - |%s|\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i8* @memchr(i8* %2, i8 signext 46, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 46, i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ nondet();
int main() {
  int x = 0;
  int y = 0;
  while (nondet()) {
    x += 1;
    y += 1;
  }
  while (x > 0) {
    x = x - 1;
    y = y - 1;
  }
  if (y <= -1)
    goto ERROR;
  return 1;
ERROR:;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <nondet@plt>
cmp    $0x0,%rax
je     1155 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
jmp    115a <main+0x4a>
cmpl   $0x0,-0x8(%rbp)
jle    117b <main+0x6b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <main+0x4a>
cmpl   $0xffffffff,-0xc(%rbp)
jg     118a <main+0x7a>
jmp    1196 <main+0x86>
movl   $0x1,-0x4(%rbp)
jmp    119b <main+0x8b>
jmp    119b <main+0x8b>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <nondet@plt>
test   %rax,%rax
jne    1120 <main+0x10>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %0
%5 = call i64 (...) @nondet()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
br label %13
13: ; preds = %16, %12
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %2
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %2
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %3
br label %13
21: ; preds = %13
%22 = load i32, i32* %3
%23 = icmp sle i32 %22, -1
br i1 %23, label %24, label %25
24: ; preds = %21
br label %26
25: ; preds = %21
store i32 1, i32* %1
br label %27
26: ; preds = %24
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @nondet()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @nondet()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3, %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ do_test();
int module_init() {
  do_test();
  return 42;
}


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

x86 assembly (clang, -O2):
<module_init>:
push   %rax
xor    %eax,%eax
call   1030 <do_test@plt>
mov    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @module_init() {
%1 = call i32 (...) @do_test()
ret i32 42
}

LLVM IR (-O2):
define i32 @module_init() {
%1 = tail call i32 (...) @do_test()
ret i32 42
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("The value of foo is %d", foo(1));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"The value of foo is %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"The value of foo is %d\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *parbake_emalloc(size_t size) {
  void *p = malloc(size);
  if (!p) {
    fprintf(stderr,
            "parbake: "
            "could not allocate (%u bytes)",
            (unsigned int)size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<parbake_emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1179 <parbake_emalloc+0x49>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parbake_emalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <parbake_emalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"parbake: could not allocate (%u bytes)\00"
define i8* @parbake_emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = trunc i64 %10 to i32
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"parbake: could not allocate (%u bytes)\00"
define noalias i8* @parbake_emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = trunc i64 %0 to i32
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i8* %2
}
int remove_core_from_monitor(__attribute__((unused)) int core) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @remove_core_from_monitor(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: kbdlight [up|down|off|max|get|set <value>]\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Usage: kbdlight [up|down|off|max|get|set <value>]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [50 x i8] c"Usage: kbdlight [up|down|off|max|get|set <value>]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void I2CInit(unsigned int I2cMode) {
  (*(volatile unsigned long *)(0xE0028000 + 0x08)) |= 0x0C;
  (*(volatile unsigned long *)(0xE0028000 + 0x04)) = 0x0C;
  (*(volatile unsigned long *)(0xE001C000 + 0x18)) =
      0x00000004 | 0x00000008 | 0x00000020 | 0x00000040;
  (*(volatile unsigned long *)(0xE001C000 + 0x14)) = 0x00000080;
  (*(volatile unsigned long *)(0xE001C000 + 0x10)) = 0x00000080;
}


x86 assembly (clang, -O0):
<I2CInit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe0028008,%eax
mov    (%rax),%rcx
or     $0xc,%rcx
mov    $0xe0028008,%eax
mov    %rcx,(%rax)
mov    $0xe0028004,%eax
movq   $0xc,(%rax)
mov    $0xe001c018,%eax
movq   $0x6c,(%rax)
mov    $0xe001c014,%eax
movq   $0x80,(%rax)
mov    $0xe001c010,%eax
movq   $0x80,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CInit>:
mov    $0xe0028008,%eax
orq    $0xc,(%rax)
movq   $0xc,-0x4(%rax)
movq   $0x6c,-0xbff0(%rax)
movq   $0x80,-0xbff4(%rax)
movq   $0x80,-0xbff8(%rax)
ret

LLVM IR (-O0):
define void @I2CInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%4 = or i64 %3, 12
store volatile i64 %4, i64* inttoptr (i64 3758260232 to i64*)
store volatile i64 12, i64* inttoptr (i64 3758260228 to i64*)
store volatile i64 108, i64* inttoptr (i64 3758211096 to i64*)
store volatile i64 128, i64* inttoptr (i64 3758211092 to i64*)
store volatile i64 128, i64* inttoptr (i64 3758211088 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2CInit(i32 %0) {
%2 = load volatile i64, i64* inttoptr (i64 3758260232 to i64*)
%3 = or i64 %2, 12
store volatile i64 %3, i64* inttoptr (i64 3758260232 to i64*)
store volatile i64 12, i64* inttoptr (i64 3758260228 to i64*)
store volatile i64 108, i64* inttoptr (i64 3758211096 to i64*)
store volatile i64 128, i64* inttoptr (i64 3758211092 to i64*)
store volatile i64 128, i64* inttoptr (i64 3758211088 to i64*)
ret void
}
void *rpmtsAcquireLock(void *ts) {
  static char lock[2048];
  return &lock;
}


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

x86 assembly (clang, -O2):
<rpmtsAcquireLock>:
lea    0x2f29(%rip),%rax
ret

LLVM IR (-O0):
@rpmtsAcquireLock.lock = internal global [2048 x i8] zeroinitializer
define i8* @rpmtsAcquireLock(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @rpmtsAcquireLock.lock, i32 0, i32 0)
}

LLVM IR (-O2):
@rpmtsAcquireLock.lock = internal global [2048 x i8] zeroinitializer
define i8* @rpmtsAcquireLock(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @rpmtsAcquireLock.lock, i64 0, i64 0)
}
/* Variables and functions */
int count(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  int dearrangements = count(number);
  printf("The number of dearrangements is %d", dearrangements);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <count@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <count@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [35 x i8] c"The number of dearrangements is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @count(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [35 x i8] c"The number of dearrangements is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @count(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned long flub_yoink_compact(struct flub *flub) {
  return (unsigned long)flub;
}


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

x86 assembly (clang, -O2):
<flub_yoink_compact>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.flub = type opaque
define i64 @flub_yoink_compact(%struct.flub* %0) {
%2 = alloca %struct.flub*
store %struct.flub* %0, %struct.flub** %2
%3 = load %struct.flub*, %struct.flub** %2
%4 = ptrtoint %struct.flub* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
%struct.flub = type opaque
define i64 @flub_yoink_compact(%struct.flub* %0) {
%2 = ptrtoint %struct.flub* %0 to i64
ret i64 %2
}
double foo(double a, double b) { return 2 * a + b; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %1)
ret double %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t pixel_b(uint32_t pixel) { return (pixel >> 0) & 0xff; }


x86 assembly (clang, -O0):
<pixel_b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_b>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @pixel_b(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
void ADCAutoInjectedDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~0x00000400;
}


x86 assembly (clang, -O0):
<ADCAutoInjectedDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    $0xfffffffffffffbff,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCAutoInjectedDisable>:
andq   $0xfffffffffffffbff,0x4(%rdi)
ff
ret

LLVM IR (-O0):
define void @ADCAutoInjectedDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -1025
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @ADCAutoInjectedDisable(i64 %0) {
%2 = add i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -1025
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int arc, char **argv) {
  char *input = "let a = '2';";
  struct point {
    int x;
    int y;
  };
  struct point b;
  printf("%d\n", b.x);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%struct.point = type { i32, i32 }
@.str = [13 x i8] c"let a = '2';\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca %struct.point
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = getelementptr inbounds %struct.point, %struct.point* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SIGSTOP;
int SIGTSTP;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ tty_restore();
void cleanup(int sig) {
  tty_restore();
  fflush(stdout);
  if (sig != SIGTSTP)
    exit(128 + sig);
  raise(SIGSTOP);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <tty_restore@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%eax
je     1180 <cleanup+0x40>
mov    -0x4(%rbp),%edi
add    $0x80,%edi
call   1060 <exit@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <tty_restore@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e89(%rip),%rax
cmp    %ebx,(%rax)
jne    1172 <cleanup+0x32>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1030 <raise@plt>
sub    $0xffffff80,%ebx
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@SIGTSTP = global i32 0
@SIGSTOP = global i32 0
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @tty_restore()
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* %2
%7 = load i32, i32* @SIGTSTP
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = add nsw i32 128, %10
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i32, i32* @SIGSTOP
%15 = call i32 @raise(i32 %14)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@SIGTSTP = global i32 0
@SIGSTOP = global i32 0
define void @cleanup(i32 %0) {
%2 = tail call i32 (...) @tty_restore()
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @SIGTSTP
%6 = icmp eq i32 %5, %0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = add nsw i32 %0, 128
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = load i32, i32* @SIGSTOP
%12 = tail call i32 @raise(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  printf("You entered %d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"You entered %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"You entered %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
void glmMakeVector3d(double result[3], const double p1[3], const double p2[3]) {
  result[0] = p2[0] - p1[0];
  result[1] = p2[1] - p1[1];
  result[2] = p2[2] - p1[2];
}


x86 assembly (clang, -O0):
<glmMakeVector3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMakeVector3d>:
movsd  (%rdx),%xmm0
subsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rdx),%xmm0
subsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rdx),%xmm0
subsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @glmMakeVector3d(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @glmMakeVector3d(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = load double, double* %1
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %2, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %2, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
indirect(typeobj) char typeobj;
{
  if (typeobj == 1)
    callrts("ccgchar");
  else
    callrts("ccgint");
}


x86 assembly (clang, -O0):
<indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x1,%eax
jne    113e <indirect+0x2e>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <callrts@plt>
jmp    114c <indirect+0x3c>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect>:
cmp    $0x1,%dil
lea    0xee5(%rip),%rax
lea    0xee6(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <callrts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ccgchar\00"
@.str.1 = [7 x i8] c"ccgint\00"
define i32 @indirect(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"ccgchar\00"
@.str.1 = [7 x i8] c"ccgint\00"
define i32 @indirect(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @callrts to i32 (i8*, ...)*)(i8* %4)
ret i32 undef
}