xunge/DecIR huggingface dataset:
void glLineWidthx(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ PUTLONG(int /*<<< orphan*/, int /*<<< orphan*/ *);
void __putlong(u_int32_t l, u_char *msgp) { PUTLONG(l, msgp); }


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

x86 assembly (clang, -O2):
<__putlong>:
jmp    1030 <PUTLONG@plt>

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

LLVM IR (-O2):
define void @__putlong(i32 %0, i32* %1) {
%3 = tail call i32 @PUTLONG(i32 %0, i32* %1)
ret void
}
void renderer_notify_res_change(void) {}


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

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

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

LLVM IR (-O2):
define void @renderer_notify_res_change() {
ret void
}
/* Variables and functions */
double log(void) { return (4.5); }


x86 assembly (clang, -O0):
<log>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @log() {
ret double 4.500000e+00
}

LLVM IR (-O2):
define double @log() {
ret double 4.500000e+00
}
/* Variables and functions */
int /*<<< orphan*/ native_window_create_screen_select();
void window_create_screen_select(void) { native_window_create_screen_select(); }


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

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

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

LLVM IR (-O2):
define void @window_create_screen_select() {
%1 = tail call i32 (...) @native_window_create_screen_select()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int sum(int, int);
int main(void) {
  int a = 2;
  int b = 3;
  int result = sum(a, b);
  if (result == a + b) {
  ERROR:
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <sum@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    1168 <main+0x48>
jmp    1161 <main+0x41>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <sum@plt>
cmp    $0x5,%eax
jne    113c <main+0x1c>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @sum(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %16
13: ; preds = %0
br label %14
14: ; preds = %13
%15 = call i32 (...) @__VERIFIER_error()
br label %16
16: ; preds = %14, %0
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 2, i32 3)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
int test_imm_0Fint16_mem(short *val) {
  return ((*val) & (0x0F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Fint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 15
%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_0Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 15
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void bar(int k) {
  if (k != 16 * 3)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
je     112c <bar+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x30,%edi
jne    1116 <bar+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 48
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = icmp eq i32 %0, 48
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int);
void wl_touch_send_cancel(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 4);
}


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

x86 assembly (clang, -O2):
<wl_touch_send_cancel>:
mov    $0x4,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_touch_send_cancel(%struct.wl_resource* %0) {
%2 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %2
%3 = load %struct.wl_resource*, %struct.wl_resource** %2
%4 = call i32 @wl_resource_post_event(%struct.wl_resource* %3, i32 4)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_touch_send_cancel(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_welcome(char *output) { printf("%s\n", output); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_welcome(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_welcome(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo3();
void foo1() { foo3(); }


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

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

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

LLVM IR (-O2):
define void @foo1() {
%1 = tail call i32 (...) @foo3()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cc_log(char *, char const *);
int /*<<< orphan*/ exit(int);
void fatal(const char *msg) {
  cc_log("FATAL: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <cc_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <cc_log@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"FATAL: %s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cc_log(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"FATAL: %s\0A\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @cc_log(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t clearBit_fun_int32_t(int32_t x, uint32_t i) { return x & ~(1 << i); }


x86 assembly (clang, -O0):
<clearBit_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @clearBit_fun_int32_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
void null_close(void *priv) {}


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

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

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

LLVM IR (-O2):
define void @null_close(i8* nocapture %0) {
ret void
}
int parent_node(int node) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @parent_node(i32 %0) {
ret i32 0
}
void media_snd_device_delete(struct snd_usb_audio *chip) {}


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

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

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

LLVM IR (-O2):
%struct.snd_usb_audio = type opaque
define void @media_snd_device_delete(%struct.snd_usb_audio* nocapture %0) {
ret void
}
struct internal_ibv_qp *ibv_qp_to_internal(struct ibv_qp *qp) {
  return (struct internal_ibv_qp *)qp;
}


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

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

LLVM IR (-O0):
%struct.internal_ibv_qp = type opaque
%struct.ibv_qp = type opaque
define %struct.internal_ibv_qp* @ibv_qp_to_internal(%struct.ibv_qp* %0) {
%2 = alloca %struct.ibv_qp*
store %struct.ibv_qp* %0, %struct.ibv_qp** %2
%3 = load %struct.ibv_qp*, %struct.ibv_qp** %2
%4 = bitcast %struct.ibv_qp* %3 to %struct.internal_ibv_qp*
ret %struct.internal_ibv_qp* %4
}

LLVM IR (-O2):
%struct.internal_ibv_qp = type opaque
%struct.ibv_qp = type opaque
define %struct.internal_ibv_qp* @ibv_qp_to_internal(%struct.ibv_qp* readnone %0) {
%2 = bitcast %struct.ibv_qp* %0 to %struct.internal_ibv_qp*
ret %struct.internal_ibv_qp* %2
}
/* Variables and functions */
int /*<<< orphan*/ asyncaddrinfo_init(int);
void resolve_init() { asyncaddrinfo_init(2); }


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

x86 assembly (clang, -O2):
<resolve_init>:
mov    $0x2,%edi
jmp    1030 <asyncaddrinfo_init@plt>

LLVM IR (-O0):
define void @resolve_init() {
%1 = call i32 @asyncaddrinfo_init(i32 2)
ret void
}

LLVM IR (-O2):
define void @resolve_init() {
%1 = tail call i32 @asyncaddrinfo_init(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getarg(int, char *);
void ndf1Farg(int index, char *value, size_t value_length) {
  getarg(index, value);
}


x86 assembly (clang, -O0):
<ndf1Farg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getarg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndf1Farg>:
jmp    1030 <getarg@plt>

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

LLVM IR (-O2):
define void @ndf1Farg(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @getarg(i32 %0, i8* %1)
ret void
}
void grid_xpull_out(__attribute__((unused)) struct grid_sockbase *self,
                    __attribute__((unused)) struct grid_pipe *pipe) {}


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

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

LLVM IR (-O0):
%struct.grid_sockbase = type opaque
%struct.grid_pipe = type opaque
define void @grid_xpull_out(%struct.grid_sockbase* %0, %struct.grid_pipe* %1) {
%3 = alloca %struct.grid_sockbase*
%4 = alloca %struct.grid_pipe*
store %struct.grid_sockbase* %0, %struct.grid_sockbase** %3
store %struct.grid_pipe* %1, %struct.grid_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.grid_sockbase = type opaque
%struct.grid_pipe = type opaque
define void @grid_xpull_out(%struct.grid_sockbase* nocapture %0, %struct.grid_pipe* nocapture %1) {
ret void
}
/* Variables and functions */
#define SIGINT 128
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void sig_handler(int signo) {
  switch (signo) {
  case SIGINT:
    printf("signo= %d, ctl + c\n", signo);
    break;
    break;
  default:
    printf("signo= %d, SIGRTMAX - 4\n", signo);
    break;
  }
  sleep(5);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1152 <sig_handler+0x32>
jmp    113e <sig_handler+0x1e>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    1161 <sig_handler+0x41>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
cmp    $0x80,%edi
jne    1137 <sig_handler+0x17>
lea    0xed0(%rip),%rdi
mov    $0x80,%esi
jmp    1140 <sig_handler+0x20>
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"signo= %d, ctl + c\0A\00"
@.str.1 = [25 x i8] c"signo= %d, SIGRTMAX - 4\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 128, label %4
]
4: ; preds = %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %4
%11 = call i32 @sleep(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"signo= %d, ctl + c\0A\00"
@.str.1 = [25 x i8] c"signo= %d, SIGRTMAX - 4\0A\00"
define void @sig_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 128)
br label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @sleep(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgand(void) { gen("andl\t%ecx,%eax"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"andl\09%ecx,%eax\00"
define void @cgand() {
%1 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"andl\09%ecx,%eax\00"
define void @cgand() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void to_sign_long_store_n(__float128 a, long *p, long n) { p[n] = (long)a; }


x86 assembly (clang, -O0):
<to_sign_long_store_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movaps -0x10(%rbp),%xmm0
call   1140 <__fixtfdi>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<to_sign_long_store_n>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1120 <__fixtfdi>
mov    %rax,(%rbx,%r14,8)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @to_sign_long_store_n(fp128 %0, i64* %1, i64 %2) {
%4 = alloca fp128
%5 = alloca i64*
%6 = alloca i64
store fp128 %0, fp128* %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%7 = load fp128, fp128* %4
%8 = fptosi fp128 %7 to i64
%9 = load i64*, i64** %5
%10 = load i64, i64* %6
%11 = getelementptr inbounds i64, i64* %9, i64 %10
store i64 %8, i64* %11
ret void
}

LLVM IR (-O2):
define void @to_sign_long_store_n(fp128 %0, i64* nocapture writeonly %1, i64 %2) {
%4 = fptosi fp128 %0 to i64
%5 = getelementptr inbounds i64, i64* %1, i64 %2
store i64 %4, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void init_user_section() { write("ganttproject.gan", "\t<resources>\n", NULL); }


x86 assembly (clang, -O0):
<init_user_section>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_user_section>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [14 x i8] c"\09<resources>\0A\00"
define void @init_user_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [14 x i8] c"\09<resources>\0A\00"
define void @init_user_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
int checkIntervalAndNum(int interval, int num) {
  if (interval < 0 || num < 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkIntervalAndNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <checkIntervalAndNum+0x1e>
cmpl   $0x0,-0xc(%rbp)
jge    112a <checkIntervalAndNum+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1131 <checkIntervalAndNum+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIntervalAndNum>:
mov    %edi,%eax
or     %esi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @checkIntervalAndNum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %13
12: ; preds = %8
store i32 1, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @checkIntervalAndNum(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
void increment_access(int *buf, int n) {
  for (int i = 0; i != n; i++)
    *buf++ = 0;
}


x86 assembly (clang, -O0):
<increment_access>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1141 <increment_access+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x0,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <increment_access+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_access>:
test   %esi,%esi
je     1126 <increment_access+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @increment_access(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %3
store i32 0, i32* %11
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @increment_access(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
char neg(char x) {
  return ((x == '+') ? '-' : (x == '-') ? '+' : (x == '0') ? '0' : '?');
}


x86 assembly (clang, -O0):
<neg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
jne    1124 <neg+0x24>
mov    $0x2d,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <neg+0x5b>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
jne    113e <neg+0x3e>
mov    $0x2b,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <neg+0x55>
movsbl -0x1(%rbp),%edx
mov    $0x3f,%eax
mov    $0x30,%ecx
cmp    $0x30,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg>:
cmp    $0x2b,%dil
je     110f <neg+0xf>
cmp    $0x2d,%dil
jne    1112 <neg+0x12>
mov    $0x2b,%al
ret
mov    $0x2d,%al
ret
cmp    $0x30,%dil
mov    $0x30,%ecx
mov    $0x3f,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @neg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
br i1 %5, label %6, label %7
6: ; preds = %1
br label %20
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %11, label %12
11: ; preds = %7
br label %18
12: ; preds = %7
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 48
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 48, i32 63
br label %18
18: ; preds = %12, %11
%19 = phi i32 [ 43, %11 ], [ %17, %12 ]
br label %20
20: ; preds = %18, %6
%21 = phi i32 [ 45, %6 ], [ %19, %18 ]
%22 = trunc i32 %21 to i8
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @neg(i8 signext %0) {
switch i8 %0, label %2 [
i8 43, label %6
i8 45, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 48
%4 = select i1 %3, i8 48, i8 63
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %2
%7 = phi i8 [ 45, %1 ], [ %4, %2 ], [ 43, %5 ]
ret i8 %7
}
int test_imm_C6int16_reg(short val) {
  return ((val) & (-0xC6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C6int16_reg(i16 signext %0) {
%2 = and i16 %0, -198
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: ssgl_gameserver_example lobbyserver servernick "
                  "gametype gameinst location\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [82 x i8] c"usage: ssgl_gameserver_example lobbyserver servernick gametype gameinst location\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [82 x i8] c"usage: ssgl_gameserver_example lobbyserver servernick gametype gameinst location\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void runTestCase() {}


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

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

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

LLVM IR (-O2):
define void @runTestCase() {
ret void
}
int gges_derivation_edit_distance(struct gges_derivation_tree *a,
                                  struct gges_derivation_tree *b) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.gges_derivation_tree = type opaque
define i32 @gges_derivation_edit_distance(%struct.gges_derivation_tree* nocapture readnone %0, %struct.gges_derivation_tree* nocapture readnone %1) {
ret i32 0
}
void comm_bcast_int(int *p_int, int count) {}


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

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

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

LLVM IR (-O2):
define void @comm_bcast_int(i32* nocapture %0, i32 %1) {
ret void
}
void foo_2_2_1_1_1_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_1_1_1_1() {
ret void
}
unsigned short icrc(unsigned short crc, unsigned char *lin, unsigned int len,
                    short jinit, int jrev) {}


x86 assembly (clang, -O0):
<icrc>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ax,-0x16(%rbp)
mov    %r8d,-0x1c(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @icrc(i16 zeroext %0, i8* %1, i32 %2, i16 signext %3, i32 %4) {
%6 = alloca i16
%7 = alloca i16
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i16
%11 = alloca i32
store i16 %0, i16* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i16 %3, i16* %10
store i32 %4, i32* %11
%12 = load i16, i16* %6
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @icrc(i16 zeroext %0, i8* nocapture readnone %1, i32 %2, i16 signext %3, i32 %4) {
ret i16 undef
}
/* Variables and functions */
int /*<<< orphan*/ getnums();
int /*<<< orphan*/ getoptions();
void doinit() {
  getnums();
  getoptions();
}


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

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

LLVM IR (-O0):
define void @doinit() {
%1 = call i32 (...) @getnums()
%2 = call i32 (...) @getoptions()
ret void
}

LLVM IR (-O2):
define void @doinit() {
%1 = tail call i32 (...) @getnums()
%2 = tail call i32 (...) @getoptions()
ret void
}
int e(int u) {
  int z = u;
  return z;
}


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

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

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

LLVM IR (-O2):
define i32 @e(i32 returned %0) {
ret i32 %0
}
double yardsToMiles(double yards) { return yards / 1760.0; }


x86 assembly (clang, -O0):
<yardsToMiles>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @yardsToMiles(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.760000e+03
ret double %4
}

LLVM IR (-O2):
define double @yardsToMiles(double %0) {
%2 = fdiv double %0, 1.760000e+03
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void output_target(double value) { printf("%g ", value); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%g \00"
define void @output_target(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g \00"
define void @output_target(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n;
  char s[100];
  printf("input n:\n");
  scanf("%d", &n);
  itoa(n, s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1050 <itoa@plt>
lea    -0x70(%rbp),%rsi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <itoa@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input n:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 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 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @itoa(i32 %5, i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [9 x i8] c"input n:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @itoa(i32 %7, i8* %4)
%9 = call i32 @puts(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Sub2() { printf("In Sub2\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"In Sub2\00"
define void @Sub2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void compat_err_func(const char *p, int i, void *voidp) {
  void (*err_func)(const char *, int) = (void (*)(const char *, int))voidp;
  if (err_func)
    (*err_func)(p, i);
}


x86 assembly (clang, -O0):
<compat_err_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1133 <compat_err_func+0x33>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_err_func>:
test   %rdx,%rdx
je     1107 <compat_err_func+0x7>
jmp    *%rdx
ret

LLVM IR (-O0):
define void @compat_err_func(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca void (i8*, i32)*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to void (i8*, i32)*
store void (i8*, i32)* %9, void (i8*, i32)** %7
%10 = load void (i8*, i32)*, void (i8*, i32)** %7
%11 = icmp ne void (i8*, i32)* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load void (i8*, i32)*, void (i8*, i32)** %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
br label %16
16: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @compat_err_func(i8* %0, i32 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = bitcast i8* %2 to void (i8*, i32)*
tail call void %6(i8* %0, i32 %1)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle14() { kprintf("ISR %d.\n", 14); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle14() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle14() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}
__attribute__((constructor)) void myinit() {}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myinit, i8* null }]
define void @myinit() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @myinit() {
ret void
}
/* Variables and functions */
unsigned char GF_log(unsigned char);
unsigned char GF_pow(unsigned char);
unsigned char GF_inv(unsigned char a) {
  unsigned char b, inv_pow;
  b = GF_log(a);
  inv_pow = (254 * b) % 255;
  return GF_pow(inv_pow);
}


x86 assembly (clang, -O0):
<GF_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <GF_log@plt>
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
imul   $0xfe,%eax,%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%edi
call   1040 <GF_pow@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GF_inv>:
push   %rax
call   1030 <GF_log@plt>
movzbl %al,%eax
mov    %eax,%ecx
shl    $0x8,%ecx
sub    %eax,%ecx
sub    %eax,%ecx
movzwl %cx,%eax
imul   $0x8081,%eax,%eax
shr    $0x17,%eax
mov    %eax,%edx
shl    $0x8,%edx
sub    %edx,%eax
add    %ecx,%eax
movzwl %ax,%edi
pop    %rax
jmp    1040 <GF_pow@plt>

LLVM IR (-O0):
define zeroext i8 @GF_inv(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = call zeroext i8 @GF_log(i8 zeroext %5)
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = mul nsw i32 254, %8
%10 = srem i32 %9, 255
%11 = trunc i32 %10 to i8
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = call zeroext i8 @GF_pow(i8 zeroext %12)
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @GF_inv(i8 zeroext %0) {
%2 = tail call zeroext i8 @GF_log(i8 zeroext %0)
%3 = zext i8 %2 to i16
%4 = mul nuw i16 %3, 254
%5 = urem i16 %4, 255
%6 = trunc i16 %5 to i8
%7 = tail call zeroext i8 @GF_pow(i8 zeroext %6)
ret i8 %7
}
void av_buffer_realloc() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_realloc() {
ret void
}
void ShowMessage(void (*ptr)()) { (*ptr)(); }


x86 assembly (clang, -O0):
<ShowMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowMessage>:
xor    %eax,%eax
jmp    *%rdi

LLVM IR (-O0):
define void @ShowMessage(void (...)* %0) {
%2 = alloca void (...)*
store void (...)* %0, void (...)** %2
%3 = load void (...)*, void (...)** %2
ret void
}

LLVM IR (-O2):
define void @ShowMessage(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) foo(int x, int y, int v) {
  if (y < -128 || y > 127)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0xffffff80,-0x8(%rbp)
jl     1135 <foo+0x25>
cmpl   $0x7f,-0x8(%rbp)
jle    113c <foo+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsbl %sil,%eax
cmp    %esi,%eax
jne    1119 <foo+0x9>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(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* %5
%8 = icmp slt i32 %7, -128
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 127
br i1 %11, label %12, label %14
12: ; preds = %9, %3
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, -128
%5 = icmp ult i32 %4, -256
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strv_free(char **);
void strv_freep(char ***l) {
  if (!l)
    return;
  strv_free(*l);
  *l = NULL;
}


x86 assembly (clang, -O0):
<strv_freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <strv_freep+0x1c>
jmp    1143 <strv_freep+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strv_free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_freep>:
test   %rdi,%rdi
je     1129 <strv_freep+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <strv_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @strv_freep(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%4 = icmp ne i8*** %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i8***, i8**** %2
%8 = load i8**, i8*** %7
%9 = call i32 @strv_free(i8** %8)
%10 = load i8***, i8**** %2
store i8** null, i8*** %10
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @strv_freep(i8*** %0) {
%2 = icmp eq i8*** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8**, i8*** %0
%5 = tail call i32 @strv_free(i8** %4)
store i8** null, i8*** %0
br label %6
6: ; preds = %1, %3
ret void
}
/* Type definitions */
struct sStreamCodec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ StreamEncoder_PutU08(struct sStreamCodec *, unsigned char);
void StreamEncoder_PutS08(struct sStreamCodec *p, signed char s8) {
  StreamEncoder_PutU08(p, (unsigned char)s8);
}


x86 assembly (clang, -O0):
<StreamEncoder_PutS08>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1030 <StreamEncoder_PutU08@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StreamEncoder_PutS08>:
movzbl %sil,%esi
jmp    1030 <StreamEncoder_PutU08@plt>

LLVM IR (-O0):
%struct.sStreamCodec = type { i32 }
define void @StreamEncoder_PutS08(%struct.sStreamCodec* %0, i8 signext %1) {
%3 = alloca %struct.sStreamCodec*
%4 = alloca i8
store %struct.sStreamCodec* %0, %struct.sStreamCodec** %3
store i8 %1, i8* %4
%5 = load %struct.sStreamCodec*, %struct.sStreamCodec** %3
%6 = load i8, i8* %4
%7 = call i32 @StreamEncoder_PutU08(%struct.sStreamCodec* %5, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
%struct.sStreamCodec = type { i32 }
define void @StreamEncoder_PutS08(%struct.sStreamCodec* %0, i8 signext %1) {
%3 = tail call i32 @StreamEncoder_PutU08(%struct.sStreamCodec* %0, i8 zeroext %1)
ret void
}
/* Variables and functions */
unsigned char uart_putc(unsigned char);
unsigned char UartPutc(unsigned char ch) { return uart_putc(ch); }


x86 assembly (clang, -O0):
<UartPutc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <uart_putc@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UartPutc>:
jmp    1030 <uart_putc@plt>

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

LLVM IR (-O2):
define zeroext i8 @UartPutc(i8 zeroext %0) {
%2 = tail call zeroext i8 @uart_putc(i8 zeroext %0)
ret i8 %2
}
/* Variables and functions */
double randu53();
double qcs_randu(void) { return randu53(); }


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

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

LLVM IR (-O0):
define double @qcs_randu() {
%1 = call double (...) @randu53()
ret double %1
}

LLVM IR (-O2):
define double @qcs_randu() {
%1 = tail call double (...) @randu53()
ret double %1
}