xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int read(int, unsigned char *, int);
int /*<<< orphan*/ write_to_serial(unsigned char *, int);
void tun_to_serial(int infd, int outfd) {
  struct {
    unsigned char inbuf[2000];
  } uip;
  int size;
  if ((size = read(infd, uip.inbuf, 2000)) == -1)
    err(1, "tun_to_serial: read");
  write_to_serial(uip.inbuf, size);
}


x86 assembly (clang, -O0):
<tun_to_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7d8(%rbp),%rsi
mov    $0x7d0,%edx
call   1030 <read@plt>
mov    %eax,-0x7dc(%rbp)
cmp    $0xffffffff,%eax
jne    1175 <tun_to_serial+0x45>
mov    $0x1,%edi
lea    0xe90(%rip),%rsi
call   1050 <err@plt>
lea    -0x7d8(%rbp),%rdi
mov    -0x7dc(%rbp),%esi
call   1040 <write_to_serial@plt>
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_to_serial>:
push   %rbx
sub    $0x7d0,%rsp
mov    %rsp,%rsi
mov    $0x7d0,%edx
call   1030 <read@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    115d <tun_to_serial+0x2d>
lea    0xead(%rip),%rsi
mov    $0x1,%edi
call   1050 <err@plt>
mov    %rsp,%rdi
mov    %ebx,%esi
call   1040 <write_to_serial@plt>
add    $0x7d0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { [2000 x i8] }
@.str = [20 x i8] c"tun_to_serial: read\00"
define void @tun_to_serial(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.anon
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 0
%9 = getelementptr inbounds [2000 x i8], [2000 x i8]* %8, i64 0, i64 0
%10 = call i32 @read(i32 %7, i8* %9, i32 2000)
store i32 %10, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @err(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 0
%16 = getelementptr inbounds [2000 x i8], [2000 x i8]* %15, i64 0, i64 0
%17 = load i32, i32* %6
%18 = call i32 @write_to_serial(i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.anon = type { [2000 x i8] }
@.str = [20 x i8] c"tun_to_serial: read\00"
define void @tun_to_serial(i32 %0, i32 %1) {
%3 = alloca %struct.anon
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 2000)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = call i32 @write_to_serial(i8* %4, i32 %5)
ret void
}
double Div(double x, double y) { return x / y; }


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

x86 assembly (clang, -O2):
<Div>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Div(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Div(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
int errno;
int setpriority(int /*<<< orphan*/, long, int);
int set_priority(long pid, int priority) {
  if (setpriority(PRIO_PROCESS, pid, priority) == -1) {
    return errno;
  }
  return 0;
}


x86 assembly (clang, -O0):
<set_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <setpriority@plt>
cmp    $0xffffffff,%eax
jne    114e <set_priority+0x3e>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <set_priority+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_priority>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <setpriority@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
jne    1136 <set_priority+0x26>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@PRIO_PROCESS = global i32 0
@errno = global i32 0
define i32 @set_priority(i64 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* @PRIO_PROCESS
%7 = load i64, i64* %4
%8 = load i32, i32* %5
%9 = call i32 @setpriority(i32 %6, i64 %7, i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @errno
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
@errno = global i32 0
define i32 @set_priority(i64 %0, i32 %1) {
%3 = load i32, i32* @PRIO_PROCESS
%4 = tail call i32 @setpriority(i32 %3, i64 %0, i32 %1)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = select i1 %5, i32 %6, i32 0
ret i32 %7
}
void alf_uw_end() {}


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

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

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

LLVM IR (-O2):
define void @alf_uw_end() {
ret void
}
/* Type definitions */
struct evbuffer {
  int dummy;
};
struct bufferevent {
  int dummy;
};
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int arc4random_uniform(int);
struct evbuffer *bufferevent_get_output(struct bufferevent *);
int /*<<< orphan*/ evbuffer_add(struct evbuffer *, int *, int);
void cross_talk(evutil_socket_t fd, short events, void *ptr) {
  int ch;
  struct bufferevent *ev_bev = ptr;
  struct evbuffer *output = bufferevent_get_output(ev_bev);
  ch = 65 + arc4random_uniform(26);
  evbuffer_add(output, &ch, 1);
}


x86 assembly (clang, -O0):
<cross_talk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <bufferevent_get_output@plt>
mov    %rax,-0x28(%rbp)
mov    $0x1a,%edi
call   1030 <arc4random_uniform@plt>
add    $0x41,%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x1,%edx
call   1050 <evbuffer_add@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cross_talk>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rdi
call   1040 <bufferevent_get_output@plt>
mov    %rax,%rbx
mov    $0x1a,%edi
call   1030 <arc4random_uniform@plt>
add    $0x41,%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1050 <evbuffer_add@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
%struct.evbuffer = type { i32 }
define void @cross_talk(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.bufferevent*
%9 = alloca %struct.evbuffer*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to %struct.bufferevent*
store %struct.bufferevent* %11, %struct.bufferevent** %8
%12 = load %struct.bufferevent*, %struct.bufferevent** %8
%13 = call %struct.evbuffer* @bufferevent_get_output(%struct.bufferevent* %12)
store %struct.evbuffer* %13, %struct.evbuffer** %9
%14 = call i32 @arc4random_uniform(i32 26)
%15 = add nsw i32 65, %14
store i32 %15, i32* %7
%16 = load %struct.evbuffer*, %struct.evbuffer** %9
%17 = call i32 @evbuffer_add(%struct.evbuffer* %16, i32* %7, i32 1)
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
%struct.evbuffer = type { i32 }
define void @cross_talk(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = bitcast i8* %2 to %struct.bufferevent*
%7 = tail call %struct.evbuffer* @bufferevent_get_output(%struct.bufferevent* %6)
%8 = tail call i32 @arc4random_uniform(i32 26)
%9 = add nsw i32 %8, 65
store i32 %9, i32* %4
%10 = call i32 @evbuffer_add(%struct.evbuffer* %7, i32* %4, i32 1)
ret void
}
void rop3_239_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D | stk3;
  stk1 = S | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_239_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)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%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_239_1_1>:
or     %edx,%esi
mov    %edx,%eax
not    %al
mov    (%rdi),%cl
or     %cl,%al
not    %sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_239_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = or i8 %2, %1
%8 = xor i8 %7, -1
%9 = and i8 %6, %8
%10 = or i8 %5, %9
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int skip_comment(FILE *fh) {
  char c = '0';
  while (c != '\n') {
    c = fgetc(fh);
    if (c == EOF)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<skip_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movb   $0x30,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
je     1160 <skip_comment+0x50>
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    0x2ea4(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <skip_comment+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1167 <skip_comment+0x57>
jmp    1120 <skip_comment+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comment>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x30,%al
mov    0x2ec8(%rip),%r14
cmp    $0xa,%al
je     1138 <skip_comment+0x28>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r14),%al
jne    1120 <skip_comment+0x10>
mov    $0x1,%eax
jmp    113a <skip_comment+0x2a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @skip_comment(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 48, i8* %4
br label %5
5: ; preds = %18, %1
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = call signext i8 @fgetc(i32* %10)
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = load i8, i8* @EOF
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %9
store i32 1, i32* %2
br label %20
18: ; preds = %9
br label %5
19: ; preds = %5
store i32 0, i32* %2
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @skip_comment(i32* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8 [ 48, %1 ], [ %6, %5 ]
%4 = icmp eq i8 %3, 10
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call signext i8 @fgetc(i32* %0)
%7 = load i8, i8* @EOF
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %2
9: ; preds = %2, %5
%10 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int core_rtl_strncmp(char const *, char const *, int);
int core_rtl_strcmp(const char *s1, const char *s2) {
  return core_rtl_strncmp(s1, s2, 0xFFFFFFFF);
}


x86 assembly (clang, -O0):
<core_rtl_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
call   1030 <core_rtl_strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_rtl_strcmp>:
mov    $0xffffffff,%edx
jmp    1030 <core_rtl_strncmp@plt>

LLVM IR (-O0):
define i32 @core_rtl_strcmp(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 @core_rtl_strncmp(i8* %5, i8* %6, i32 -1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @core_rtl_strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @core_rtl_strncmp(i8* %0, i8* %1, i32 -1)
ret i32 %3
}
char *base_name(name)
char const *name;
{
  char const *base = name += 0;
  for (; *name; name++)
    if (((*name) == '/'))
      base = name + 1;
  return (char *)base;
}


x86 assembly (clang, -O0):
<base_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <base_name+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    113d <base_name+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1142 <base_name+0x42>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <base_name+0x14>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_name>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <base_name+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <base_name+0x10>
test   %dl,%dl
jne    1113 <base_name+0x13>
ret

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

LLVM IR (-O2):
define i8* @base_name(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ st103_ep_set_tx_status(int /*<<< orphan*/, int);
int /*<<< orphan*/ st103_get_tx_addr(int /*<<< orphan*/);
int /*<<< orphan*/ st103_set_tx_count(int /*<<< orphan*/, size_t);
int /*<<< orphan*/ usb_lld_to_pmabuf(void const *, int /*<<< orphan*/, size_t);
void usb_lld_write(uint8_t ep_num, const void *buf, size_t len) {
  usb_lld_to_pmabuf(buf, st103_get_tx_addr(ep_num), len);
  st103_set_tx_count(ep_num, len);
  st103_ep_set_tx_status(ep_num, (0x0030));
}


x86 assembly (clang, -O0):
<usb_lld_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <st103_get_tx_addr@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1040 <usb_lld_to_pmabuf@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <st103_set_tx_count@plt>
mov    -0x4(%rbp),%edi
mov    $0x30,%esi
call   1060 <st103_ep_set_tx_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_lld_write>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1050 <st103_get_tx_addr@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <usb_lld_to_pmabuf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <st103_set_tx_count@plt>
mov    %ebp,%edi
mov    $0x30,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <st103_ep_set_tx_status@plt>

LLVM IR (-O0):
define void @usb_lld_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %4
%9 = call i32 @st103_get_tx_addr(i32 %8)
%10 = load i64, i64* %6
%11 = call i32 @usb_lld_to_pmabuf(i8* %7, i32 %9, i64 %10)
%12 = load i32, i32* %4
%13 = load i64, i64* %6
%14 = call i32 @st103_set_tx_count(i32 %12, i64 %13)
%15 = load i32, i32* %4
%16 = call i32 @st103_ep_set_tx_status(i32 %15, i32 48)
ret void
}

LLVM IR (-O2):
define void @usb_lld_write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @st103_get_tx_addr(i32 %0)
%5 = tail call i32 @usb_lld_to_pmabuf(i8* %1, i32 %4, i64 %2)
%6 = tail call i32 @st103_set_tx_count(i32 %0, i64 %2)
%7 = tail call i32 @st103_ep_set_tx_status(i32 %0, i32 48)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *log_sense_param_data(uint8_t *param) { return param + 4; }


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

x86 assembly (clang, -O2):
<log_sense_param_data>:
lea    0x10(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @log_sense_param_data(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %2
}
int tpm_swallow_printf_args(const char *format, ...) {
  format = format;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @tpm_swallow_printf_args(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
char *leerUnStringArbitrariamenteLargo();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *string;
  printf("Dame tu nombre: ");
  string = leerUnStringArbitrariamenteLargo();
  printf(" ... nombre: %s\n", string);
  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>
mov    $0x0,%al
call   1040 <leerUnStringArbitrariamenteLargo@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Dame tu nombre: \00"
@.str.1 = [17 x i8] c" ... nombre: %s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @leerUnStringArbitrariamenteLargo()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
struct Obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ css_free_obj(struct Obj *);
int /*<<< orphan*/ free(struct Obj **);
void css_free_objs(struct Obj **objs) {
  return;
  struct Obj *obj;
  int css_iter_i48 = 0;
  while ((obj = objs[css_iter_i48++])) {
    css_free_obj(obj);
  }
  free(objs);
}


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

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

LLVM IR (-O0):
%struct.Obj = type { i32 }
define void @css_free_objs(%struct.Obj** %0) {
%2 = alloca %struct.Obj**
%3 = alloca %struct.Obj*
%4 = alloca i32
store %struct.Obj** %0, %struct.Obj*** %2
ret void
}

LLVM IR (-O2):
%struct.Obj = type { i32 }
define void @css_free_objs(%struct.Obj** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_pmu_sar_override(int);
void flash_turn_on() { set_pmu_sar_override(48); }


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

x86 assembly (clang, -O2):
<flash_turn_on>:
mov    $0x30,%edi
jmp    1030 <set_pmu_sar_override@plt>

LLVM IR (-O0):
define void @flash_turn_on() {
%1 = call i32 @set_pmu_sar_override(i32 48)
ret void
}

LLVM IR (-O2):
define void @flash_turn_on() {
%1 = tail call i32 @set_pmu_sar_override(i32 48)
ret void
}
const char *snd_asoundlib_version(void) { return "1.0.18"; }


x86 assembly (clang, -O0):
<snd_asoundlib_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"1.0.18\00"
define i8* @snd_asoundlib_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"1.0.18\00"
define i8* @snd_asoundlib_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef void dentry;

/* Variables and functions */
void *lookup_dentry(char const *);
int strnlen(char const *, int);
struct dentry *dentry_lookup(const char *path) {
  if (strnlen(path, 1024) == 1024) {
    return ((void *)0);
  }
  return lookup_dentry(path);
}


x86 assembly (clang, -O0):
<dentry_lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x400,%esi
call   1030 <strnlen@plt>
cmp    $0x400,%eax
jne    1152 <dentry_lookup+0x32>
movq   $0x0,-0x8(%rbp)
jmp    115f <dentry_lookup+0x3f>
mov    -0x10(%rbp),%rdi
call   1040 <lookup_dentry@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dentry_lookup>:
push   %rbx
mov    %rdi,%rbx
mov    $0x400,%esi
call   1030 <strnlen@plt>
cmp    $0x400,%eax
jne    1139 <dentry_lookup+0x19>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <lookup_dentry@plt>

LLVM IR (-O0):
%struct.dentry = type opaque
define %struct.dentry* @dentry_lookup(i8* %0) {
%2 = alloca %struct.dentry*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strnlen(i8* %4, i32 1024)
%6 = icmp eq i32 %5, 1024
br i1 %6, label %7, label %8
7: ; preds = %1
store %struct.dentry* null, %struct.dentry** %2
br label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @lookup_dentry(i8* %9)
%11 = bitcast i8* %10 to %struct.dentry*
store %struct.dentry* %11, %struct.dentry** %2
br label %12
12: ; preds = %8, %7
%13 = load %struct.dentry*, %struct.dentry** %2
ret %struct.dentry* %13
}

LLVM IR (-O2):
%struct.dentry = type opaque
define %struct.dentry* @dentry_lookup(i8* %0) {
%2 = tail call i32 @strnlen(i8* %0, i32 1024)
%3 = icmp eq i32 %2, 1024
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i8* @lookup_dentry(i8* %0)
%6 = bitcast i8* %5 to %struct.dentry*
br label %7
7: ; preds = %1, %4
%8 = phi %struct.dentry* [ %6, %4 ], [ null, %1 ]
ret %struct.dentry* %8
}
/* Variables and functions */
int /*<<< orphan*/ stdio_helper_fake_printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ tolower(char);
int /*<<< orphan*/ toupper(char);
void soru_4(char a, char b) {
  stdio_helper_fake_printf("%c", toupper(a));
  stdio_helper_fake_printf("%c", tolower(b));
}


x86 assembly (clang, -O0):
<soru_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <stdio_helper_fake_printf@plt>
movsbl -0x2(%rbp),%edi
call   1050 <tolower@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1040 <stdio_helper_fake_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_4>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <toupper@plt>
lea    0xebe(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <stdio_helper_fake_printf@plt>
mov    %ebx,%edi
call   1050 <tolower@plt>
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <stdio_helper_fake_printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @soru_4(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @toupper(i8 signext %5)
%7 = call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8, i8* %4
%9 = call i32 @tolower(i8 signext %8)
%10 = call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @soru_4(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @toupper(i8 signext %0)
%4 = tail call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @tolower(i8 signext %1)
%6 = tail call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
int roundInt(float number) {
  float ret = (number >= 0) ? (number + 0.5) : (number - 0.5);
  return (int)ret;
}


x86 assembly (clang, -O0):
<roundInt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1139 <roundInt+0x39>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1153 <roundInt+0x53>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundInt>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setb   %al
cvtss2sd %xmm0,%xmm0
lea    0xeea(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvtsd2ss %xmm0,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @roundInt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fadd double %8, 5.000000e-01
br label %14
10: ; preds = %1
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fsub double %12, 5.000000e-01
br label %14
14: ; preds = %10, %6
%15 = phi double [ %9, %6 ], [ %13, %10 ]
%16 = fptrunc double %15 to float
store float %16, float* %3
%17 = load float, float* %3
%18 = fptosi float %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @roundInt(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fpext float %0 to double
%4 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%5 = fadd double %4, %3
%6 = fptrunc double %5 to float
%7 = fptosi float %6 to i32
ret i32 %7
}
/* Variables and functions */
float get_rn_flt(int *);
float fget_rn_flt(int **genptr) { return get_rn_flt(*genptr); }


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

x86 assembly (clang, -O2):
<fget_rn_flt>:
mov    (%rdi),%rdi
jmp    1030 <get_rn_flt@plt>

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

LLVM IR (-O2):
define float @fget_rn_flt(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call float @get_rn_flt(i32* %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printFunctionEpilog() {
  printf("\n\n\tmovq $0, \%rax\n\tleave\n\tret\n\t.cfi_endproc\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"\0A\0A\09movq $0, %rax\0A\09leave\0A\09ret\0A\09.cfi_endproc\0A\00"
define void @printFunctionEpilog() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"\0A\0A\09movq $0, %rax\0A\09leave\0A\09ret\0A\09.cfi_endproc\0A\00"
define void @printFunctionEpilog() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f381(int *);
int f382(int *p) { return f381(p); }


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

x86 assembly (clang, -O2):
<f382>:
jmp    1030 <f381@plt>

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

LLVM IR (-O2):
define i32 @f382(i32* %0) {
%2 = tail call i32 @f381(i32* %0)
ret i32 %2
}
long sub5(long i, long j, int k) { return !k ? i : j; }


x86 assembly (clang, -O0):
<sub5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1126 <sub5+0x26>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    112e <sub5+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub5>:
mov    %rdi,%rax
test   %edx,%edx
cmovne %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @sub5(i64 %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i64 %0, i64 %1
ret i64 %5
}
unsigned Sys_HasChar() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Sys_HasChar() {
ret i32 1
}
int test_imm_06int16_reg(short val) {
  return ((val) & (0x06 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_06int16_reg>:
test   $0x6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_06int16_reg(i16 signext %0) {
%2 = and i16 %0, 6
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float values[10] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0};
  float sum, average;
  int n;
  sum = 0.0;
  for (n = 0; n < 10; ++n)
    sum += values[n];
  average = sum / 10;
  printf("%f", average);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    117f <main+0x5f>
movslq -0x3c(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
addss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1153 <main+0x33>
movss  -0x34(%rbp),%xmm0
movss  0xe74(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.values = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 9.000000e+00, float 1.000000e+01]
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x float]
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [10 x float]* %2 to i8*
store float 0.000000e+00, float* %3
store i32 0, i32* %5
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %12
%14 = load float, float* %13
%15 = load float, float* %3
%16 = fadd float %15, %14
store float %16, float* %3
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %7
20: ; preds = %7
%21 = load float, float* %3
%22 = fdiv float %21, 1.000000e+01
store float %22, float* %4
%23 = load float, float* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float 5.500000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("In foo!\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"In foo!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
int fun1175() { return 1175; }


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

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

LLVM IR (-O0):
define i32 @fun1175() {
ret i32 1175
}

LLVM IR (-O2):
define i32 @fun1175() {
ret i32 1175
}
void _start() { _Exit(1); }


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

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

LLVM IR (-O0):
define void @_start() {
unreachable
}

LLVM IR (-O2):
define void @_start() {
tail call void @_Exit(i32 1)
unreachable
}
void listen_out(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @listen_out(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct cpack_state {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int cpack_uint32(struct cpack_state *, int /*<<< orphan*/ *);
int cpack_int32(struct cpack_state *s, int32_t *p) {
  return cpack_uint32(s, (uint32_t *)p);
}


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

x86 assembly (clang, -O2):
<cpack_int32>:
jmp    1030 <cpack_uint32@plt>

LLVM IR (-O0):
%struct.cpack_state = type { i32 }
define i32 @cpack_int32(%struct.cpack_state* %0, i32* %1) {
%3 = alloca %struct.cpack_state*
%4 = alloca i32*
store %struct.cpack_state* %0, %struct.cpack_state** %3
store i32* %1, i32** %4
%5 = load %struct.cpack_state*, %struct.cpack_state** %3
%6 = load i32*, i32** %4
%7 = call i32 @cpack_uint32(%struct.cpack_state* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.cpack_state = type { i32 }
define i32 @cpack_int32(%struct.cpack_state* %0, i32* %1) {
%3 = tail call i32 @cpack_uint32(%struct.cpack_state* %0, i32* %1)
ret i32 %3
}
long double return_ldl(long double ldl) { return 2 * ldl; }


x86 assembly (clang, -O0):
<return_ldl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fadd   %st,%st(0)
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_ldl>:
fldt   0x8(%rsp)
fadd   %st,%st(0)
ret

LLVM IR (-O0):
define x86_fp80 @return_ldl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fmul x86_fp80 0xK40008000000000000000, %3
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @return_ldl(x86_fp80 %0) {
%2 = fmul x86_fp80 %0, 0xK40008000000000000000
ret x86_fp80 %2
}
/* Variables and functions */
scalar_t__ link(char *, char *);
scalar_t__ unlink(char *);
int rename(const char *old, const char *new) {
  if (link((char *)old, (char *)new) < 0)
    return -1;
  if (unlink((char *)old) < 0) {
    unlink((char *)new);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <link@plt>
cmp    $0x0,%rax
jge    1153 <rename+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <rename+0x62>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
jge    117b <rename+0x5b>
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <rename+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <link@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     115b <rename+0x3b>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jns    115b <rename+0x3b>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @link(i8* %6, i8* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %19
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i64 @unlink(i8* %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i8*, i8** %5
%17 = call i64 @unlink(i8* %16)
store i32 -1, i32* %3
br label %19
18: ; preds = %11
store i32 0, i32* %3
br label %19
19: ; preds = %18, %15, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @rename(i8* %0, i8* %1) {
%3 = tail call i64 @link(i8* %0, i8* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @unlink(i8* %0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i64 @unlink(i8* %1)
br label %10
10: ; preds = %5, %2, %8
%11 = phi i32 [ -1, %8 ], [ -1, %2 ], [ 0, %5 ]
ret i32 %11
}
int elias_gamma_bits(int value) {
  int bits;
  bits = 1;
  while (value > 1) {
    bits += 2;
    value >>= 1;
  }
  return bits;
}


x86 assembly (clang, -O0):
<elias_gamma_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112f <elias_gamma_bits+0x2f>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <elias_gamma_bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elias_gamma_bits>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     112c <elias_gamma_bits+0x2c>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x2,%eax
shr    %ecx
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1120 <elias_gamma_bits+0x20>
ret

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

LLVM IR (-O2):
define i32 @elias_gamma_bits(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 2
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void prt_bas_vtx(const void *data) { printf("%s", (char *)data); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @prt_bas_vtx(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void fun2(char b) { printf("this is fun%c\n", b); }


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

x86 assembly (clang, -O2):
<fun2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"this is fun%c\0A\00"
define void @fun2(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}