xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint16_t;
struct p4_digest {
  int dummy;
};

/* Variables and functions */
struct p4_digest *unpack_p4_digest(char *buffer, uint16_t offset) {
  return (struct p4_digest *)(buffer + offset);
}


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

x86 assembly (clang, -O2):
<unpack_p4_digest>:
movslq %esi,%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.p4_digest = type { i32 }
define %struct.p4_digest* @unpack_p4_digest(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_digest*
ret %struct.p4_digest* %5
}
/* Variables and functions */
void *memchr(const void *ptr, int value, unsigned short num) { return 0; }


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

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

LLVM IR (-O0):
define i8* @memchr(i8* %0, i32 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i16
store i8* %0, i8** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @memchr(i8* nocapture readnone %0, i32 %1, i16 zeroext %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[201] = {0};
  scanf("%s", word);
  printf("%li", hash(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc9,%edx
call   1050 <memset@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0xb9(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xe6f(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xe58(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%li\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [201 x i8]
store i32 0, i32* %1
%3 = bitcast [201 x i8]* %2 to i8*
%4 = getelementptr inbounds [201 x i8], [201 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [201 x i8], [201 x i8]* %2, i64 0, i64 0
%7 = call i32 @hash(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%li\00"
define i32 @main() {
%1 = alloca [201 x i8]
%2 = getelementptr inbounds [201 x i8], [201 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int cbmarch_iec_wait(int f, int line, int state) {
  return ioctl(f, _IO(0xcb, 15), (line << 8) | state);
}


x86 assembly (clang, -O0):
<cbmarch_iec_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xcb,%edi
mov    $0xf,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
shl    $0x8,%edx
or     -0xc(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_iec_wait>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xcb,%edi
mov    $0xf,%esi
call   1030 <_IO@plt>
shl    $0x8,%ebp
or     %ebp,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbmarch_iec_wait(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @_IO(i32 203, i32 15)
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = load i32, i32* %6
%12 = or i32 %10, %11
%13 = call i32 @ioctl(i32 %7, i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cbmarch_iec_wait(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 203, i32 15)
%5 = shl i32 %1, 8
%6 = or i32 %5, %2
%7 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvCancelCapture(char byBoardNum) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvCancelCapture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvCancelCapture>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvCancelCapture(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvCancelCapture(i8 signext %0) {
%2 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int deg(unsigned int poly) { return (32 - __builtin_clz(poly)) - 1; }


x86 assembly (clang, -O0):
<deg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%ecx
xor    $0x1f,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg>:
bsr    %edi,%eax
ret

LLVM IR (-O0):
define i32 @deg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sub nsw i32 32, %4
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @deg(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = xor i32 %2, 31
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t l2cap_event_channel_opened_get_local_mtu(const uint8_t *event) {
  return little_endian_read_16(event, 17);
}


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

x86 assembly (clang, -O2):
<l2cap_event_channel_opened_get_local_mtu>:
mov    $0x11,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @l2cap_event_channel_opened_get_local_mtu(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 17)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t lp_read_u16_be(void *p) {
  uint8_t *s = (uint8_t *)p;
  uint16_t v = s[0] << 8 | s[1];
  return v;
}


x86 assembly (clang, -O0):
<lp_read_u16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lp_read_u16_be>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @lp_read_u16_be(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = or i32 %10, %13
store i32 %14, i32* %4
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @lp_read_u16_be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
int maxnum(int a, int b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<maxnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <maxnum+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <maxnum+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxnum>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @maxnum(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 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @maxnum(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *init_palavra(char *texto_palavra) {
  char *palavra = (char *)malloc(sizeof(char) * (strlen(texto_palavra) + 1));
  strcpy(palavra, texto_palavra);
  return palavra;
}


x86 assembly (clang, -O0):
<init_palavra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @init_palavra(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @init_palavra(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int ptrtest1() { return 55; }


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

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

LLVM IR (-O0):
define i32 @ptrtest1() {
ret i32 55
}

LLVM IR (-O2):
define i32 @ptrtest1() {
ret i32 55
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ stderr;
void *emalloc(unsigned int n) {
  void *ptr;
  ptr = (void *)malloc(n);
  if (ptr == NULL) {
    fprintf(stderr, "c4: emalloc() - Can't allocate %d bytes.\n", n);
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <emalloc+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <emalloc+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"c4: emalloc() - Can't allocate %d bytes.\0A\00"
define i8* @emalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"c4: emalloc() - Can't allocate %d bytes.\0A\00"
define i8* @emalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
char *ndesc(char *buf, char *a, char *b) {
  snprintf(buf, 100, "%s %s", a, b);
  return buf;
}


x86 assembly (clang, -O0):
<ndesc>:
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),%rcx
mov    -0x18(%rbp),%r8
mov    $0x64,%esi
lea    0xec4(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndesc>:
push   %rbx
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xedf(%rip),%rdx
mov    $0x64,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
define i8* @ndesc(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @snprintf(i8* %7, i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
define i8* @ndesc(i8* returned %0, i8* %1, i8* %2) {
%4 = tail call i32 @snprintf(i8* %0, i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ parImpar(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Digite um numero inteiro: ");
  scanf("%d", &num);
  parImpar(num);
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Digite um numero inteiro: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @parImpar(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Digite um numero inteiro: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @parImpar(i32 %5)
ret i32 0
}
int main(int argc, char *argv[]) { return 42; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 42
}
int NI() { return -1; }


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

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

LLVM IR (-O0):
define i32 @NI() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @NI() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ test_racket_char_string();
int /*<<< orphan*/ test_racket_comment();
int /*<<< orphan*/ test_racket_comment_entities();
int /*<<< orphan*/ test_racket_doc_string();
int /*<<< orphan*/ test_racket_doc_string_blank();
int /*<<< orphan*/ test_racket_empty_string();
void all_racket_tests() {
  test_racket_comment();
  test_racket_doc_string();
  test_racket_doc_string_blank();
  test_racket_empty_string();
  test_racket_char_string();
  test_racket_comment_entities();
}


x86 assembly (clang, -O0):
<all_racket_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <test_racket_comment@plt>
mov    $0x0,%al
call   1040 <test_racket_doc_string@plt>
mov    $0x0,%al
call   1070 <test_racket_doc_string_blank@plt>
mov    $0x0,%al
call   1080 <test_racket_empty_string@plt>
mov    $0x0,%al
call   1050 <test_racket_char_string@plt>
mov    $0x0,%al
call   1030 <test_racket_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_racket_tests>:
push   %rax
xor    %eax,%eax
call   1060 <test_racket_comment@plt>
xor    %eax,%eax
call   1040 <test_racket_doc_string@plt>
xor    %eax,%eax
call   1070 <test_racket_doc_string_blank@plt>
xor    %eax,%eax
call   1080 <test_racket_empty_string@plt>
xor    %eax,%eax
call   1050 <test_racket_char_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_racket_comment_entities@plt>

LLVM IR (-O0):
define void @all_racket_tests() {
%1 = call i32 (...) @test_racket_comment()
%2 = call i32 (...) @test_racket_doc_string()
%3 = call i32 (...) @test_racket_doc_string_blank()
%4 = call i32 (...) @test_racket_empty_string()
%5 = call i32 (...) @test_racket_char_string()
%6 = call i32 (...) @test_racket_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_racket_tests() {
%1 = tail call i32 (...) @test_racket_comment()
%2 = tail call i32 (...) @test_racket_doc_string()
%3 = tail call i32 (...) @test_racket_doc_string_blank()
%4 = tail call i32 (...) @test_racket_empty_string()
%5 = tail call i32 (...) @test_racket_char_string()
%6 = tail call i32 (...) @test_racket_comment_entities()
ret void
}
char *strreplace(char *s, char old, char new) {
  for (; *s; ++s)
    if (*s == old)
      *s = new;
  return s;
}


x86 assembly (clang, -O0):
<strreplace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <strreplace+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <strreplace+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1141 <strreplace+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strreplace+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreplace>:
mov    %rdi,%rax
mov    (%rdi),%cl
jmp    1118 <strreplace+0x18>
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1125 <strreplace+0x25>
cmp    %sil,%cl
jne    1110 <strreplace+0x10>
mov    %dl,(%rax)
jmp    1110 <strreplace+0x10>
ret

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

LLVM IR (-O2):
define i8* @strreplace(i8* %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
%16 = phi i8* [ %0, %3 ], [ %12, %11 ]
ret i8* %16
}
/* Type definitions */
typedef scalar_t__ int_least16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_int_least16_t(int_least16_t const k1,
                                            int_least16_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_int_least16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_int_least16_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_least16_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_least16_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int putchar(char);
int puts(const char *str) {
  int ch;
  while (ch = *str)
    putchar(ch);
  return putchar('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113f <puts+0x2f>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     112f <puts+0x1f>
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
store i32 %7, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
%12 = call i32 @putchar(i8 signext %11)
br label %4
13: ; preds = %4
%14 = call i32 @putchar(i8 signext 10)
ret i32 %14
}

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @putchar(i8 signext %5)
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = tail call i32 @putchar(i8 signext 10)
ret i32 %10
}
/* Variables and functions */
char *strncpyI(char *, char const *, size_t);
__attribute__((visibility("default"))) char *strncpy(char *s1, const char *s2,
                                                     size_t n) {
  return strncpyI(s1, s2, n);
}


x86 assembly (clang, -O0):
<strncpy>:
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 <strncpyI@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
jmp    1030 <strncpyI@plt>

LLVM IR (-O0):
define i8* @strncpy(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 i8* @strncpyI(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strncpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @strncpyI(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
void printfUART_init() {}


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

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

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

LLVM IR (-O2):
define void @printfUART_init() {
ret void
}
/* Variables and functions */
int __C_islower(int);
int islower(int c) { return __C_islower(c); }


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

x86 assembly (clang, -O2):
<islower>:
jmp    1030 <__C_islower@plt>

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

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = tail call i32 @__C_islower(i32 %0)
ret i32 %2
}
void rop3_159_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_159_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_159_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_159_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_159_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
int test_imm_52uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x52 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_52uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x52,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_52uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 82
%6 = icmp ne i64 %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_52uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5373952
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(const void *a, const void *b) {
  return strcmp((char *)a, (char *)b);
}


x86 assembly (clang, -O0):
<compare>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int /*<<< orphan*/ inet_addr(char *);
int main(int argc, char **argv) {
  struct in_addr ia;
  ia.s_addr = inet_addr("0.0.0.0");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <inet_addr@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [8 x i8] c"0.0.0.0\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.in_addr
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @inet_addr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
store i32 %7, i32* %8
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"0.0.0.0\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @inet_addr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ queue_len(struct queue *);
int /*<<< orphan*/ queue_pop(struct queue *);
void queue_clear(struct queue *queue) {
  assert(queue != NULL);
  while (queue_len(queue) != 0)
    queue_pop(queue);
}


x86 assembly (clang, -O0):
<queue_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <queue_len@plt>
cmp    $0x0,%rax
je     116f <queue_clear+0x3f>
mov    -0x8(%rbp),%rdi
call   1040 <queue_pop@plt>
jmp    114e <queue_clear+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_clear>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <queue_len@plt>
test   %rax,%rax
je     1167 <queue_clear+0x37>
mov    %rbx,%rdi
call   1040 <queue_pop@plt>
jmp    1150 <queue_clear+0x20>
pop    %rbx
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
define void @queue_clear(%struct.queue* %0) {
%2 = alloca %struct.queue*
store %struct.queue* %0, %struct.queue** %2
%3 = load %struct.queue*, %struct.queue** %2
%4 = icmp ne %struct.queue* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
br label %7
7: ; preds = %11, %1
%8 = load %struct.queue*, %struct.queue** %2
%9 = call i64 @queue_len(%struct.queue* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load %struct.queue*, %struct.queue** %2
%13 = call i32 @queue_pop(%struct.queue* %12)
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.queue = type { i32 }
define void @queue_clear(%struct.queue* %0) {
%2 = icmp ne %struct.queue* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @queue_len(%struct.queue* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1, %7
%8 = tail call i32 @queue_pop(%struct.queue* %0)
%9 = tail call i64 @queue_len(%struct.queue* %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %7
11: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postsub_int32_t(int /*<<< orphan*/ *, int);
int32_t atomic_postdec_int32_t(int32_t *var) {
  return atomic_postsub_int32_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postdec_int32_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postsub_int32_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_postdec_int32_t(i32* %0) {
%2 = tail call i32 @atomic_postsub_int32_t(i32* %0, i32 1)
ret i32 %2
}
void account_scheduler_latency(struct task_struct *task, int usecs, int inter) {
}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @account_scheduler_latency(%struct.task_struct* %0, i32 %1, i32 %2) {
%4 = alloca %struct.task_struct*
%5 = alloca i32
%6 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @account_scheduler_latency(%struct.task_struct* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strtol(char *, char **, int);
void ignoreretrn(void) {
  char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";
  char *pEnd;
  strtol(szNumbers, &pEnd, 10);
}


x86 assembly (clang, -O0):
<ignoreretrn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2d,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoreretrn>:
sub    $0x48,%rsp
movups 0xf02(%rip),%xmm0
movups %xmm0,0x2d(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.ignoreretrn.szNumbers = [45 x i8] c"2001 60c0c0 -1101110100110100100000 0x6fffff\00"
define void @ignoreretrn() {
%1 = alloca [45 x i8]
%2 = alloca i8*
%3 = bitcast [45 x i8]* %1 to i8*
%4 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%5 = call i32 @strtol(i8* %4, i8** %2, i32 10)
ret void
}

LLVM IR (-O2):
@__const.ignoreretrn.szNumbers = [45 x i8] c"2001 60c0c0 -1101110100110100100000 0x6fffff\00"
define void @ignoreretrn() {
%1 = alloca [45 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%4 = bitcast i8** %2 to i8*
%5 = call i32 @strtol(i8* %3, i8** %2, i32 10)
ret void
}
void steal_exp(struct battle_char *origin, struct battle_char *target) {}


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

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

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

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @steal_exp(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_or_insert(int);
void *process3(void *arg) {
  int val = 65;
  int found = find_or_insert(val);
  assert(found);
  return NULL;
}


x86 assembly (clang, -O0):
<process3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x41,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <find_or_insert@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process3>:
push   %rax
mov    $0x41,%edi
call   1040 <find_or_insert@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @process3(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 65, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @find_or_insert(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @assert(i32 %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @process3(i8* nocapture readnone %0) {
%2 = tail call i32 @find_or_insert(i32 65)
%3 = tail call i32 @assert(i32 %2)
ret i8* null
}
int fun739() { return 739; }


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

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

LLVM IR (-O0):
define i32 @fun739() {
ret i32 739
}

LLVM IR (-O2):
define i32 @fun739() {
ret i32 739
}
void gdk_string_to_compound_text_for_display() {}


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

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

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

LLVM IR (-O2):
define void @gdk_string_to_compound_text_for_display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ECHILD;
int /*<<< orphan*/ errno;
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 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 i32 @_wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ECHILD
store i32 %2, i32* @errno
ret i32 -1
}
void ar_cnt_set_notify_mslot(int my_bid, int my_cid, int cnt, int val) {}


x86 assembly (clang, -O0):
<ar_cnt_set_notify_mslot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ar_cnt_set_notify_mslot(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @ar_cnt_set_notify_mslot(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  func();
  printf("pid = %d, say something\n", getpid());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <func@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"pid = %d, say something\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @func()
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void error_success(void) { printf("Fichier correct\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Fichier correct\00"
define void @error_success() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Que a força esteja com você!\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Que a for\C3\A7a esteja com voc\C3\AA!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"Que a for\C3\A7a esteja com voc\C3\AA!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void bubble(int *ar, const int size, void (*f)(int *, int)) { (*f)(ar, size); }


x86 assembly (clang, -O0):
<bubble>:
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    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bubble>:
jmp    *%rdx

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

LLVM IR (-O2):
define void @bubble(i32* %0, i32 %1, void (i32*, i32)* nocapture %2) {
tail call void %2(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Init_Barcode();
void Init_Extensions(void) { Init_Barcode(); }


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

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

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

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