xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int clr_trail_1s(int);
uint64_t set_low_0s(uint64_t u) { return u | (clr_trail_1s(u) - 1); }


x86 assembly (clang, -O0):
<set_low_0s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <clr_trail_1s@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    $0x1,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_low_0s>:
push   %rbx
mov    %edi,%ebx
call   1030 <clr_trail_1s@plt>
add    $0xffffffff,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @set_low_0s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @clr_trail_1s(i32 %4)
%6 = sub nsw i32 %5, 1
%7 = or i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @set_low_0s(i32 %0) {
%2 = tail call i32 @clr_trail_1s(i32 %0)
%3 = add nsw i32 %2, -1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(char *name) {
  printf("Usage: name <ip address> <port>\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%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 = [33 x i8] c"Usage: name <ip address> <port>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage: name <ip address> <port>\00"
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ECHILD;
int /*<<< orphan*/ errno;
__attribute__((__weak__)) int _wait(int *status __attribute__((unused))) {
  errno = ECHILD;
  return -1;
}


x86 assembly (clang, -O0):
<_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wait>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ECHILD = global i32 0
@errno = global i32 0
define weak i32 @_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ECHILD
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ECHILD = global i32 0
@errno = global i32 0
define weak i32 @_wait(i32* %0) {
%2 = load i32, i32* @ECHILD
store i32 %2, i32* @errno
ret i32 -1
}
void lgtd_lifx_gateway_handle_tags(struct lgtd_lifx_gateway *gw,
                                   const struct lgtd_lifx_packet_header *hdr,
                                   const struct lgtd_lifx_packet_tags *pkt) {
  (void)gw;
  (void)hdr;
  (void)pkt;
}


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_tags = type opaque
define void @lgtd_lifx_gateway_handle_tags(%struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_tags* %2) {
%4 = alloca %struct.lgtd_lifx_gateway*
%5 = alloca %struct.lgtd_lifx_packet_header*
%6 = alloca %struct.lgtd_lifx_packet_tags*
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %4
store %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_header** %5
store %struct.lgtd_lifx_packet_tags* %2, %struct.lgtd_lifx_packet_tags** %6
%7 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %4
%8 = load %struct.lgtd_lifx_packet_header*, %struct.lgtd_lifx_packet_header** %5
%9 = load %struct.lgtd_lifx_packet_tags*, %struct.lgtd_lifx_packet_tags** %6
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_tags = type opaque
define void @lgtd_lifx_gateway_handle_tags(%struct.lgtd_lifx_gateway* nocapture %0, %struct.lgtd_lifx_packet_header* nocapture %1, %struct.lgtd_lifx_packet_tags* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t_find(void (*)(void *), void const *);
int libt_timeout_exist(void (*fn)(void *), const void *dat) {
  return !!t_find(fn, dat);
}


x86 assembly (clang, -O0):
<libt_timeout_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <t_find@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libt_timeout_exist>:
push   %rax
call   1030 <t_find@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @libt_timeout_exist(void (i8*)* %0, i8* %1) {
%3 = alloca void (i8*)*
%4 = alloca i8*
store void (i8*)* %0, void (i8*)** %3
store i8* %1, i8** %4
%5 = load void (i8*)*, void (i8*)** %3
%6 = load i8*, i8** %4
%7 = call i32 @t_find(void (i8*)* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @libt_timeout_exist(void (i8*)* %0, i8* %1) {
%3 = tail call i32 @t_find(void (i8*)* %0, i8* %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void bail(char *s) {
  fprintf(stderr, "%s", s);
  exit(1);
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @bail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void test() { exit(1); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int count_bit_set(unsigned int, int /*<<< orphan*/);
int find_in_power_serise_of_2_no_loop(unsigned int number) {
  if (count_bit_set(number, 0) == 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<find_in_power_serise_of_2_no_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <count_bit_set@plt>
cmp    $0x1,%eax
jne    113a <find_in_power_serise_of_2_no_loop+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <find_in_power_serise_of_2_no_loop+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_in_power_serise_of_2_no_loop>:
push   %rax
xor    %esi,%esi
call   1030 <count_bit_set@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @find_in_power_serise_of_2_no_loop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @count_bit_set(i32 %4, i32 0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @find_in_power_serise_of_2_no_loop(i32 %0) {
%2 = tail call i32 @count_bit_set(i32 %0, i32 0)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memmove_impl(void *dest, const void *src, size_t n) {
  memmove(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memmove_impl>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memmove_impl(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int chmod(const char *path, mode_t mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @chmod(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int send_str(int socket, char *str) {
  return send(socket, str, strlen(str), 0);
}


x86 assembly (clang, -O0):
<send_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
define i32 @send_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @send(i32 %5, i8* %6, i32 %8, i32 0)
ret i32 %9
}

LLVM IR (-O2):
define i32 @send_str(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
ret i32 %4
}
void PBISTRinfoLSelect(unsigned long ulRINFOL) {
  (*((volatile unsigned long *)(0x400FB000 + 0x000001C8))) = ulRINFOL;
}


x86 assembly (clang, -O0):
<PBISTRinfoLSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fb1c8,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PBISTRinfoLSelect>:
mov    %rdi,0x400fb1c8
40
ret

LLVM IR (-O0):
define void @PBISTRinfoLSelect(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074770376 to i64*)
ret void
}

LLVM IR (-O2):
define void @PBISTRinfoLSelect(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074770376 to i64*)
ret void
}
int test_imm_5Fuint8_mem(unsigned char *val) {
  return ((*val) & (-0x5F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Fuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -95
%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_5Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -95
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ SPI_Send(int);
unsigned char MC33927_GetSR3(void) {
  SPI_Send(0x03);
  return ((unsigned char)SPI_Send(0x00));
}


x86 assembly (clang, -O0):
<MC33927_GetSR3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SPI_Send@plt>
xor    %edi,%edi
call   1030 <SPI_Send@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC33927_GetSR3>:
push   %rax
mov    $0x3,%edi
call   1030 <SPI_Send@plt>
xor    %edi,%edi
call   1030 <SPI_Send@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @MC33927_GetSR3() {
%1 = call i64 @SPI_Send(i32 3)
%2 = call i64 @SPI_Send(i32 0)
%3 = trunc i64 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @MC33927_GetSR3() {
%1 = tail call i64 @SPI_Send(i32 3)
%2 = tail call i64 @SPI_Send(i32 0)
%3 = trunc i64 %2 to i8
ret i8 %3
}
int _isdigit(int c) {
  if (c >= '0' && c <= '9')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <_isdigit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m36_setParams41X2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m36_setParams42XX(int /*<<< orphan*/, int /*<<< orphan*/);
void m36_setParams41X2_42XX(uint16_t addr, uint8_t val) {
  m36_setParams41X2(addr, val);
  m36_setParams42XX(addr, val);
}


x86 assembly (clang, -O0):
<m36_setParams41X2_42XX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <m36_setParams41X2@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <m36_setParams42XX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m36_setParams41X2_42XX>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <m36_setParams41X2@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <m36_setParams42XX@plt>

LLVM IR (-O0):
define void @m36_setParams41X2_42XX(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 @m36_setParams41X2(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @m36_setParams42XX(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @m36_setParams41X2_42XX(i32 %0, i32 %1) {
%3 = tail call i32 @m36_setParams41X2(i32 %0, i32 %1)
%4 = tail call i32 @m36_setParams42XX(i32 %0, i32 %1)
ret void
}
int k_strlen(const char *str) {
  int i = 0;
  while (str[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<k_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <k_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <k_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <k_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @k_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void genmtlo() {}


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

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

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

LLVM IR (-O2):
define void @genmtlo() {
ret void
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << (unsigned char)7;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = (state[0UL] << (unsigned char)1) >> (unsigned char)1;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jge    1157 <RandomFunc+0x57>
movzbl -0x12(%rbp),%eax
movzbl -0x11(%rbp,%rax,1),%ecx
movzbl -0x11(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1124 <RandomFunc+0x24>
movzbl -0x11(%rbp),%eax
shl    $0x1,%eax
sar    $0x1,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movb   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = and i64 %10, 914778474
%12 = shl i64 %11, 7
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %23, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp slt i32 %17, %21
br i1 %22, label %23, label %36
23: ; preds = %15
%24 = load i8, i8* %6
%25 = zext i8 %24 to i64
%26 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = and i32 %31, %28
%33 = trunc i32 %32 to i8
store i8 %33, i8* %29
%34 = load i8, i8* %6
%35 = add i8 %34, 1
store i8 %35, i8* %6
br label %15
36: ; preds = %15
%37 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = shl i32 %39, 1
%41 = ashr i32 %40, 1
%42 = trunc i32 %41 to i8
%43 = load i8*, i8** %4
%44 = getelementptr inbounds i8, i8* %43, i64 0
store i8 %42, i8* %44
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
ret void
}
int main() {
  printf(__func__);
  printf("\n");
  doing();
  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    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <doing@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <doing@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (...) @doing()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  i = 10;
  printf("hello, world %d \n", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"hello, world %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
void XScreenCount() {}


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

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

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

LLVM IR (-O2):
define void @XScreenCount() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned int);
int foo(void) {
  char buf[1] = {3};
  const char *p = buf;
  const char **q = &p;
  unsigned int ch;
  switch (**q) {
  case 1:
    ch = 5;
    break;
  default:
    ch = 0;
    break;
  }
  bar(ch);
  return ch;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0x3,-0x1(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
sub    $0x1,%al
jne    114e <foo+0x3e>
jmp    1142 <foo+0x32>
movl   $0x5,-0x1c(%rbp)
jmp    1155 <foo+0x45>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <bar@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.foo.buf = [1 x i8] c"\03"
define i32 @foo() {
%1 = alloca [1 x i8]
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
%5 = bitcast [1 x i8]* %1 to i8*
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8* %6, i8** %2
store i8** %2, i8*** %3
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
switch i32 %10, label %12 [
i32 1, label %11
]
11: ; preds = %0
store i32 5, i32* %4
br label %13
12: ; preds = %0
store i32 0, i32* %4
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %4
%15 = call i32 @bar(i32 %14)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @bar(i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int comment(char c) {
  if (c && strchr("#", c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1151 <comment+0x41>
lea    0xece(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1151 <comment+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <comment+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
test   %dil,%dil
je     1139 <comment+0x29>
push   %rax
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
lea    0x8(%rsp),%rsp
je     1139 <comment+0x29>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
define i32 @comment(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @strchr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %1
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t LCDIntStatus(uint32_t ui32Base, bool bMasked) {
  ASSERT(ui32Base == 0x44050000);
  if (bMasked) {
    return ((*((volatile uint32_t *)(ui32Base + 0x0000005C))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000058))));
  }
}


x86 assembly (clang, -O0):
<LCDIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x44050000,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0xc(%rbp)
je     114e <LCDIntStatus+0x3e>
mov    -0x8(%rbp),%eax
add    $0x5c,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <LCDIntStatus+0x4b>
mov    -0x8(%rbp),%eax
add    $0x58,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIntStatus>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x44050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
lea    0x58(,%rax,4),%eax
movslq %ebp,%rcx
mov    (%rax,%rcx,1),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @LCDIntStatus(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 eq i32 %6, 1141178368
%8 = zext i1 %7 to i32
%9 = call i32 @ASSERT(i32 %8)
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 92
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
store i32 %17, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 88
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
store i32 %23, i32* %3
br label %24
24: ; preds = %18, %12
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @LCDIntStatus(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1141178368
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i32 88, i32 92
%8 = add nsw i32 %7, %0
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ load_u8f8_(char const *, int, int);
double u8f8_to_d(int /*<<< orphan*/);
double load_u8f8(const char *icc, int length, int offset) {
  return u8f8_to_d(load_u8f8_(icc, length, offset));
}


x86 assembly (clang, -O0):
<load_u8f8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <load_u8f8_@plt>
mov    %eax,%edi
call   1030 <u8f8_to_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_u8f8>:
push   %rax
call   1040 <load_u8f8_@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <u8f8_to_d@plt>

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

LLVM IR (-O2):
define double @load_u8f8(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @load_u8f8_(i8* %0, i32 %1, i32 %2)
%5 = tail call double @u8f8_to_d(i32 %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ parser(char *);
int /*<<< orphan*/ printf(char *);
void main() {
  char expr[100];
  printf("\nDigite uma expressao: ");
  gets(expr);
  parser(expr);
  printf("Expressao sintaticamente correta");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1040 <parser@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1040 <parser@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0ADigite uma expressao: \00"
@.str.1 = [33 x i8] c"Expressao sintaticamente correta\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @parser(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0ADigite uma expressao: \00"
@.str.1 = [33 x i8] c"Expressao sintaticamente correta\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @parser(i8* %2)
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initializeMemory();
void benchmarkSetupEach() { initializeMemory(); }


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

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

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

LLVM IR (-O2):
define void @benchmarkSetupEach() {
%1 = tail call i32 (...) @initializeMemory()
ret void
}
/* Variables and functions */
void libretro_dummy_retro_set_controller_port_device(unsigned port,
                                                     unsigned device) {
  (void)port;
  (void)device;
}


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

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

LLVM IR (-O0):
define void @libretro_dummy_retro_set_controller_port_device(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
ret void
}

LLVM IR (-O2):
define void @libretro_dummy_retro_set_controller_port_device(i32 %0, i32 %1) {
ret void
}
int rna_index(char c) {
  switch (c) {
  case 'A':
    return 0;
  case 'C':
    return 1;
  case 'G':
    return 2;
  case 'U':
    return 3;
  }
  return -1;
}


x86 assembly (clang, -O0):
<rna_index>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     1164 <rna_index+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <rna_index+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <rna_index+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <rna_index+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <rna_index+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rna_index>:
add    $0xffffffbf,%edi
cmp    $0x14,%edi
ja     1120 <rna_index+0x20>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @rna_index(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 67, label %7
i32 71, label %8
i32 85, label %9
]
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @rna_index(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 67, label %3
i32 71, label %4
i32 85, label %5
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i32 [ -1, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_bus_message_get_bus(void *m) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_message_get_bus(i8* nocapture readnone %0) {
ret i8* null
}
void f2(int dst[3], int R) {
  int i, inter[2];
  _Bool inter0p = 0;
  _Bool inter1p = 0;
  for (i = 1; i < R; i++) {
    inter0p = 1;
    inter1p = 1;
  }
  if (inter0p)
    inter[0] = 1;
  if (inter1p)
    inter[1] = 1;
  foo(inter);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0x19(%rbp)
movb   $0x0,-0x1a(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <f2+0x40>
movb   $0x1,-0x19(%rbp)
movb   $0x1,-0x1a(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112e <f2+0x1e>
testb  $0x1,-0x19(%rbp)
je     1161 <f2+0x51>
movl   $0x1,-0x18(%rbp)
testb  $0x1,-0x1a(%rbp)
je     1172 <f2+0x62>
movl   $0x1,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
cmp    $0x2,%esi
jl     1124 <f2+0x14>
movabs $0x100000001,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <foo@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i32]
%7 = alloca i8
%8 = alloca i8
store i32* %0, i32** %3
store i32 %1, i32* %4
store i8 0, i8* %7
store i8 0, i8* %8
store i32 1, i32* %5
br label %9
9: ; preds = %14, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
store i8 1, i8* %7
store i8 1, i8* %8
br label %14
14: ; preds = %13
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %9
17: ; preds = %9
%18 = load i8, i8* %7
%19 = trunc i8 %18 to i1
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 1, i32* %21
br label %22
22: ; preds = %20, %17
%23 = load i8, i8* %8
%24 = trunc i8 %23 to i1
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 1, i32* %26
br label %27
27: ; preds = %25, %22
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%29 = call i32 (i32*, ...) bitcast (i32 (...)* @foo to i32 (i32*, ...)*)(i32* %28)
ret void
}

LLVM IR (-O2):
define void @f2(i32* nocapture readnone %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = icmp slt i32 %1, 2
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 1, i32* %8
br label %9
9: ; preds = %2, %6
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%11 = call i32 (i32*, ...) bitcast (i32 (...)* @foo to i32 (i32*, ...)*)(i32* %10)
ret void
}
void maxfill(buffer, side) unsigned long *buffer;
long side;
{
  register unsigned long maxv = ~0L;
  register long i;
  register unsigned long *bp;
  for (i = side * side * side, bp = buffer; i > 0; i--, bp++)
    *bp = maxv;
}


x86 assembly (clang, -O0):
<maxfill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jle    1161 <maxfill+0x61>
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
jmp    112e <maxfill+0x2e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxfill>:
mov    %rsi,%rdx
imul   %rsi,%rdx
imul   %rsi,%rdx
test   %rdx,%rdx
jle    1133 <maxfill+0x23>
push   %rax
shl    $0x3,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @maxfill(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
store i64* %0, i64** %3
store i64 %1, i64* %4
store i64 -1, i64* %5
%8 = load i64, i64* %4
%9 = load i64, i64* %4
%10 = mul nsw i64 %8, %9
%11 = load i64, i64* %4
%12 = mul nsw i64 %10, %11
store i64 %12, i64* %6
%13 = load i64*, i64** %3
store i64* %13, i64** %7
br label %14
14: ; preds = %20, %2
%15 = load i64, i64* %6
%16 = icmp sgt i64 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %14
%18 = load i64, i64* %5
%19 = load i64*, i64** %7
store i64 %18, i64* %19
br label %20
20: ; preds = %17
%21 = load i64, i64* %6
%22 = add nsw i64 %21, -1
store i64 %22, i64* %6
%23 = load i64*, i64** %7
%24 = getelementptr inbounds i64, i64* %23, i32 1
store i64* %24, i64** %7
br label %14
25: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @maxfill(i64* nocapture writeonly %0, i64 %1) {
%3 = mul i64 %1, %1
%4 = mul i64 %3, %1
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = bitcast i64* %0 to i8*
%8 = shl i64 %4, 3
br label %9
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  for (int i = 0; i < 4; i++) {
    puts("* * * * * * * *");
    puts(" * * * * * * * *");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1156 <main+0x46>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee6(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xed6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"* * * * * * * *\00"
@.str.1 = [17 x i8] c" * * * * * * * *\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"* * * * * * * *\00"
@.str.1 = [17 x i8] c" * * * * * * * *\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t return_int32_3() { return 1073741824; }


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

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

LLVM IR (-O0):
define i32 @return_int32_3() {
ret i32 1073741824
}

LLVM IR (-O2):
define i32 @return_int32_3() {
ret i32 1073741824
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ usleep(int);
void uspi(int R) {
  int cas = 0;
  if (R != 0) {
    cas = (rand() % (R + 1));
  } else {
    cas = 0;
  }
  usleep(cas * 1000);
}


x86 assembly (clang, -O0):
<uspi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <uspi+0x34>
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
jmp    115b <uspi+0x3b>
movl   $0x0,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uspi>:
test   %edi,%edi
je     1140 <uspi+0x20>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
cltd
idiv   %ebx
imul   $0x3e8,%edx,%edi
pop    %rbx
jmp    1040 <usleep@plt>
xor    %edi,%edi
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @uspi(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 (...) @rand()
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
%10 = srem i32 %7, %9
store i32 %10, i32* %3
br label %12
11: ; preds = %1
store i32 0, i32* %3
br label %12
12: ; preds = %11, %6
%13 = load i32, i32* %3
%14 = mul nsw i32 %13, 1000
%15 = call i32 @usleep(i32 %14)
ret void
}

LLVM IR (-O2):
define void @uspi(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 (...) @rand()
%5 = add nsw i32 %0, 1
%6 = srem i32 %4, %5
%7 = mul i32 %6, 1000
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 0, %1 ]
%10 = tail call i32 @usleep(i32 %9)
ret void
}