xunge/DecIR huggingface dataset:
void strrev2(char *s, int from, int to) {
  char t;
  for (; from < to; from++, to--) {
    t = s[from];
    s[from] = s[to];
    s[to] = t;
  }
}


x86 assembly (clang, -O0):
<strrev2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <strrev2+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <strrev2+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrev2>:
cmp    %edx,%esi
jge    1131 <strrev2+0x31>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
movzbl -0x1(%rdi,%rax,1),%esi
movzbl (%rdi,%rcx,1),%edx
mov    %dl,-0x1(%rdi,%rax,1)
mov    %sil,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <strrev2+0x10>
ret

LLVM IR (-O0):
define void @strrev2(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %8
8: ; preds = %32, %3
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %37
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
store i8 %17, i8* %7
%18 = load i8*, i8** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
store i8 %27, i8* %31
br label %32
32: ; preds = %12
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
%35 = load i32, i32* %6
%36 = add nsw i32 %35, -1
store i32 %36, i32* %6
br label %8
37: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @strrev2(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %10, 1
%16 = add nsw i64 %9, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
int inverseColor(int c) {
  int r, g, b;
  r = c >> 16;
  g = (c >> 8) & 0xff;
  b = c & 0xff;
  r = 255 - r;
  g = 255 - g;
  b = 255 - b;
  return ((r << 16) | (g << 8) | b);
}


x86 assembly (clang, -O0):
<inverseColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    $0xff,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xff,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xff,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverseColor>:
mov    %edi,%eax
movzbl %dil,%ecx
and    $0xffff0000,%edi
and    $0xff00,%eax
sub    %edi,%eax
add    %ecx,%eax
add    $0xff0000,%eax
xor    $0xffff,%eax
ret

LLVM IR (-O0):
define i32 @inverseColor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = and i32 %11, 255
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = sub nsw i32 255, %13
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 255, %15
store i32 %16, i32* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 255, %17
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = shl i32 %19, 16
%21 = load i32, i32* %4
%22 = shl i32 %21, 8
%23 = or i32 %20, %22
%24 = load i32, i32* %5
%25 = or i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @inverseColor(i32 %0) {
%2 = and i32 %0, -65536
%3 = and i32 %0, 65280
%4 = and i32 %0, 255
%5 = sub i32 16711680, %2
%6 = or i32 %5, %3
%7 = or i32 %6, %4
%8 = xor i32 %7, 65535
ret i32 %8
}
/* Type definitions */
struct rlimit {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_STACK;
int /*<<< orphan*/ RLIM_INFINITY;
int setrlimit(int /*<<< orphan*/, struct rlimit *);
void remove_stack_limit(void) {
  struct rlimit rlim = {RLIM_INFINITY, RLIM_INFINITY};
  if (setrlimit(RLIMIT_STACK, &rlim) == -1) {
  }
}


x86 assembly (clang, -O0):
<remove_stack_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <setrlimit@plt>
cmp    $0xffffffff,%eax
jne    1150 <remove_stack_limit+0x40>
jmp    1150 <remove_stack_limit+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_stack_limit>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %eax,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <setrlimit@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
@RLIM_INFINITY = global i32 0
@RLIMIT_STACK = global i32 0
define void @remove_stack_limit() {
%1 = alloca %struct.rlimit
%2 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%3 = load i32, i32* @RLIM_INFINITY
store i32 %3, i32* %2
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 1
%5 = load i32, i32* @RLIM_INFINITY
store i32 %5, i32* %4
%6 = load i32, i32* @RLIMIT_STACK
%7 = call i32 @setrlimit(i32 %6, %struct.rlimit* %1)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %0
br label %10
10: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
@RLIM_INFINITY = global i32 0
@RLIMIT_STACK = global i32 0
define void @remove_stack_limit() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%4 = load i32, i32* @RLIM_INFINITY
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 1
store i32 %4, i32* %5
%6 = load i32, i32* @RLIMIT_STACK
%7 = call i32 @setrlimit(i32 %6, %struct.rlimit* %1)
ret void
}
/* Variables and functions */
char *ft_strcpy(char *, char const *);
int ft_strlen(char const *);
scalar_t__ malloc(int);
char *ft_strdup(const char *src) {
  char *dest;
  if (!src)
    return (NULL);
  dest = (char *)malloc(sizeof(char) * ft_strlen(src) + 1);
  if (!dest)
    return (NULL);
  dest = ft_strcpy(dest, src);
  return (dest);
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <ft_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    11a3 <ft_strdup+0x73>
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118a <ft_strdup+0x5a>
movq   $0x0,-0x8(%rbp)
jmp    11a3 <ft_strdup+0x73>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_strcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %rbx
test   %rdi,%rdi
je     1157 <ft_strdup+0x27>
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1157 <ft_strdup+0x27>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <ft_strcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ft_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %25
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @ft_strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = mul i64 1, %11
%13 = add i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = icmp ne i8* %17, null
br i1 %18, label %20, label %19
19: ; preds = %8
store i8* null, i8** %2
br label %25
20: ; preds = %8
%21 = load i8*, i8** %4
%22 = load i8*, i8** %3
%23 = call i8* @ft_strcpy(i8* %21, i8* %22)
store i8* %23, i8** %4
%24 = load i8*, i8** %4
store i8* %24, i8** %2
br label %25
25: ; preds = %20, %19, %7
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = add i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = inttoptr i64 %6 to i8*
%10 = tail call i8* @ft_strcpy(i8* %9, i8* %0)
br label %11
11: ; preds = %3, %1, %8
%12 = phi i8* [ %10, %8 ], [ null, %1 ], [ null, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ quark_unsetaffinity();
void quark_topology_finalize() { quark_unsetaffinity(); }


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

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

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

LLVM IR (-O2):
define void @quark_topology_finalize() {
%1 = tail call i32 (...) @quark_unsetaffinity()
ret void
}
/* Type definitions */
struct can_frame {
  int can_id;
  int can_dlc;
  int *data;
};
typedef int canid_t;

/* Variables and functions */
int can_send_frame(int, struct can_frame *);
int can_send_erase_flash(int fd, canid_t addr) {
  struct can_frame msg;
  msg.can_id = addr | 1 << 31;
  msg.can_dlc = 8;
  msg.data[0] = 0x03;
  return can_send_frame(fd, &msg);
}


x86 assembly (clang, -O0):
<can_send_erase_flash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x18(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <can_send_frame@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.can_frame = type { i32, i32, i32* }
define i32 @can_send_erase_flash(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.can_frame
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = or i32 %6, -2147483648
%8 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 1
store i32 8, i32* %9
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 2
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 3, i32* %12
%13 = load i32, i32* %3
%14 = call i32 @can_send_frame(i32 %13, %struct.can_frame* %5)
ret i32 %14
}

LLVM IR (-O2):
unsigned char f2(unsigned char x, int y) {
  x = x | (unsigned char)(0x80 >> y);
  return x;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x80,%edx
sar    %cl,%edx
mov    %edx,%ecx
movzbl %cl,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%ecx
mov    $0x80,%eax
shr    %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f2(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 128, %7
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @f2(i8 zeroext %0, i32 %1) {
%3 = lshr i32 128, %1
%4 = trunc i32 %3 to i8
%5 = or i8 %4, %0
ret i8 %5
}
/* Variables and functions */
int __builtin_mips_cabs_ule_d(double, double);
int test7(double a, double b) { return __builtin_mips_cabs_ule_d(a, b); }


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

x86 assembly (clang, -O2):
<test7>:
jmp    1030 <__builtin_mips_cabs_ule_d@plt>

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

LLVM IR (-O2):
define i32 @test7(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_ule_d(double %0, double %1)
ret i32 %3
}
int get_hash(int key) { return (key % 997); }


x86 assembly (clang, -O0):
<get_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hash>:
movslq %edi,%rax
imul   $0xffffffff837765f1,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x9,%ecx
add    %edx,%ecx
imul   $0x3e5,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_hash(i32 %0) {
%2 = srem i32 %0, 997
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void xerror(char *msg) {
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<xerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xerror>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @xerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @xerror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
float interpol_linear(float x0, float x1, float y0, float y1, float x) {
  return (y1 - y0) * (x - x0) / (x1 - x0) + y0;
}


x86 assembly (clang, -O0):
<interpol_linear>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
addss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpol_linear>:
subss  %xmm2,%xmm3
subss  %xmm0,%xmm4
mulss  %xmm3,%xmm4
subss  %xmm0,%xmm1
divss  %xmm1,%xmm4
addss  %xmm2,%xmm4
movaps %xmm4,%xmm0
ret

LLVM IR (-O0):
define float @interpol_linear(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %9
%12 = load float, float* %8
%13 = fsub float %11, %12
%14 = load float, float* %10
%15 = load float, float* %6
%16 = fsub float %14, %15
%17 = fmul float %13, %16
%18 = load float, float* %7
%19 = load float, float* %6
%20 = fsub float %18, %19
%21 = fdiv float %17, %20
%22 = load float, float* %8
%23 = fadd float %21, %22
ret float %23
}

LLVM IR (-O2):
define float @interpol_linear(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %3, %2
%7 = fsub float %4, %0
%8 = fmul float %6, %7
%9 = fsub float %1, %0
%10 = fdiv float %8, %9
%11 = fadd float %10, %2
ret float %11
}
void moveLeft(int *x, int *y) { (*x)--; }


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

x86 assembly (clang, -O2):
<moveLeft>:
addl   $0xffffffff,(%rdi)
ret

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

LLVM IR (-O2):
define void @moveLeft(i32* nocapture %0, i32* nocapture readnone %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, -1
store i32 %4, i32* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void changeendian32(uint32_t *a) {
  *a = (*a & 0x000000FF) << 24 | (*a & 0x0000FF00) << 8 |
       (*a & 0x00FF0000) >> 8 | (*a & 0xFF000000) >> 24;
}


x86 assembly (clang, -O0):
<changeendian32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff00,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff0000,%eax
sar    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeendian32>:
mov    (%rdi),%eax
bswap  %eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @changeendian32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 255
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = and i32 %8, 65280
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = and i32 %13, 16711680
%15 = ashr i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = and i32 %18, -16777216
%20 = lshr i32 %19, 24
%21 = or i32 %16, %20
%22 = load i32*, i32** %2
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @changeendian32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void word_to_bitstring(unsigned long long word) {
  unsigned long long mask = (unsigned long long)1 << 63;
  while (mask != 0) {
    if ((mask & word) != 0)
      putchar('1');
    else
      putchar('0');
    mask = mask >> 1;
  }
}


x86 assembly (clang, -O0):
<word_to_bitstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1171 <word_to_bitstring+0x61>
mov    -0x10(%rbp),%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1156 <word_to_bitstring+0x46>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    1160 <word_to_bitstring+0x50>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112a <word_to_bitstring+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<word_to_bitstring>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
movabs $0x8000000000000000,%r15
mov    %r15,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rax
and    %r14,%rax
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
shr    %rbx
cmp    $0x1,%r15
mov    %rbx,%r15
ja     1130 <word_to_bitstring+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @word_to_bitstring(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 -9223372036854775808, i64* %3
br label %4
4: ; preds = %16, %1
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = and i64 %8, %9
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @putchar(i8 signext 49)
br label %16
14: ; preds = %7
%15 = call i32 @putchar(i8 signext 48)
br label %16
16: ; preds = %14, %12
%17 = load i64, i64* %3
%18 = lshr i64 %17, 1
store i64 %18, i64* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @word_to_bitstring(i64 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ -9223372036854775808, %1 ], [ %8, %2 ]
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8 48, i8 49
%7 = tail call i32 @putchar(i8 signext %6)
%8 = lshr i64 %3, 1
%9 = icmp ult i64 %3, 2
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void audit_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<audit_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @audit_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mplayer_put_key_internal(int);
void put_double(int code) {
  if (code >= (((0x100 + 256) | (1 << 28)) + 0) &&
      code <= (((0x100 + 256) | (1 << 28)) + 9))
    mplayer_put_key_internal(code - (((0x100 + 256) | (1 << 28)) + 0) +
                             ((0x300 | (1 << 28)) + 0));
}


x86 assembly (clang, -O0):
<put_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x10000200,-0x4(%rbp)
jl     1149 <put_double+0x39>
cmpl   $0x10000209,-0x4(%rbp)
jg     1149 <put_double+0x39>
mov    -0x4(%rbp),%edi
sub    $0x10000200,%edi
add    $0x10000300,%edi
call   1030 <mplayer_put_key_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_double>:
lea    -0x10000200(%rdi),%eax
cmp    $0x9,%eax
ja     1126 <put_double+0x16>
add    $0x100,%edi
jmp    1030 <mplayer_put_key_internal@plt>
ret

LLVM IR (-O0):
define void @put_double(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 268435968
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 268435977
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 268435968
%11 = add nsw i32 %10, 268436224
%12 = call i32 @mplayer_put_key_internal(i32 %11)
br label %13
13: ; preds = %8, %5, %1
ret void
}

LLVM IR (-O2):
define void @put_double(i32 %0) {
%2 = add i32 %0, -268435968
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = add nuw nsw i32 %0, 256
%6 = tail call i32 @mplayer_put_key_internal(i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
int ordering_gt(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @ordering_gt() {
ret i32 1
}
/* Variables and functions */
double sin(double);
__attribute__((__weak__, __always___)) double softboundcets_sin(double x) {
  return sin(x);
}


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

x86 assembly (clang, -O2):
<softboundcets_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define weak double @softboundcets_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ encrypt(unsigned int *, unsigned int const *,
                           unsigned int *);
void TWOFISH_encrypt(int *key, char *input, char *output) {
  encrypt((unsigned int *)key, (const unsigned int *)input,
          (unsigned int *)output);
}


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

x86 assembly (clang, -O2):
<TWOFISH_encrypt>:
jmp    1030 <encrypt@plt>

LLVM IR (-O0):
define void @TWOFISH_encrypt(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to i32*
%12 = call i32 @encrypt(i32* %7, i32* %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @TWOFISH_encrypt(i32* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %1 to i32*
%5 = bitcast i8* %2 to i32*
%6 = tail call i32 @encrypt(i32* %0, i32* %4, i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prost(int);
int prv_pogolem_prost(int n) {
  ++n;
  while (!prost(n)) {
    ++n;
  }
  return n;
}


x86 assembly (clang, -O0):
<prv_pogolem_prost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <prost@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1141 <prv_pogolem_prost+0x31>
jmp    114f <prv_pogolem_prost+0x3f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <prv_pogolem_prost+0x14>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_pogolem_prost>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <prost@plt>
test   %eax,%eax
je     1120 <prv_pogolem_prost+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @prv_pogolem_prost(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, 1
%5 = tail call i32 @prost(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 %4
}
/* Variables and functions */
float ceil(float inp) {
  int temp = 0;
  temp = (int)inp;
  if ((float)temp > inp)
    return (float)temp;
  else
    return (float)temp + 1;
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1136 <ceil+0x36>
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114c <ceil+0x4c>
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xebd(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
movss  0xef1(%rip),%xmm2
addss  %xmm1,%xmm2
cmpltss %xmm1,%xmm0
andps  %xmm0,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ceil(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 0, i32* %4
%5 = load float, float* %3
%6 = fptosi float %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = load float, float* %3
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to float
store float %13, float* %2
br label %18
14: ; preds = %1
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to float
%17 = fadd float %16, 1.000000e+00
store float %17, float* %2
br label %18
18: ; preds = %14, %11
%19 = load float, float* %2
ret float %19
}

LLVM IR (-O2):
define float @ceil(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp ogt float %3, %0
%5 = fadd float %3, 1.000000e+00
%6 = select i1 %4, float %3, float %5
ret float %6
}
/* Variables and functions */
unsigned char *md4_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_md4(unsigned char *out, const unsigned char *in,
                               size_t in_len) {
  return md4_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_md4>:
jmp    1030 <md4_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_md4(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @md4_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, j, len, n, t, res, temp, flag;
  long long int sum;
  scanf("%d", &t);
  while (t--) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     1148 <main+0x38>
jmp    112f <main+0x1f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc < 3)
    return -1;
  char *str1 = argv[1];
  char *str2 = argv[2];
  cat(str1, str2);
  printf("%s\n", str1);
}


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)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <cat@plt>
mov    -0x18(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%eax
cmp    $0x3,%edi
jl     114d <main+0x2d>
push   %rbx
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%rsi
mov    %rbx,%rdi
call   1040 <cat@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %23
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
store i8* %17, i8** %7
%18 = load i8*, i8** %6
%19 = load i8*, i8** %7
%20 = call i32 @cat(i8* %18, i8* %19)
%21 = load i8*, i8** %6
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %11, %10
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @cat(i8* %6, i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void strcmp() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @strcmp() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
int osal_valloc_msg_wait(int type, void **addr, int len, int flag) {
  return -1;
}


x86 assembly (clang, -O0):
<osal_valloc_msg_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @osal_valloc_msg_wait(i32 %0, i8** nocapture readnone %1, i32 %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
char *strdup(char const *);
char *_XkbDupString(const char *s) { return s ? strdup(s) : NULL; }


x86 assembly (clang, -O0):
<_XkbDupString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <_XkbDupString+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <_XkbDupString+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <_XkbDupString+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_XkbDupString>:
test   %rdi,%rdi
je     111a <_XkbDupString+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @_XkbDupString(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Type definitions */
struct chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_alib(struct chunk *chunk) { printf("library=yes\n"); }


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

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

LLVM IR (-O0):
%struct.chunk = type { i32 }
@.str = [13 x i8] c"library=yes\0A\00"
define void @show_alib(%struct.chunk* %0) {
%2 = alloca %struct.chunk*
store %struct.chunk* %0, %struct.chunk** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.chunk = type { i32 }
@str = [12 x i8] c"library=yes\00"
define void @show_alib(%struct.chunk* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int scale8(int, int);
uint8_t brighten8_lin(uint8_t x) {
  uint8_t ix = 255 - x;
  if (ix & 0x80) {
    ix = scale8(ix, ix);
  } else {
    ix += 1;
    ix /= 2;
  }
  return 255 - ix;
}


x86 assembly (clang, -O0):
<brighten8_lin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xff,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     114a <brighten8_lin+0x3a>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <scale8@plt>
mov    %eax,-0x8(%rbp)
jmp    1161 <brighten8_lin+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    $0xff,%eax
sub    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brighten8_lin>:
mov    $0xff,%esi
sub    %edi,%esi
test   $0x80,%sil
jne    112f <brighten8_lin+0x1f>
mov    $0x100,%ecx
sub    %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
jmp    113b <brighten8_lin+0x2b>
push   %rax
mov    %esi,%edi
call   1030 <scale8@plt>
add    $0x8,%rsp
mov    $0xff,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @brighten8_lin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 255, %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @scale8(i32 %10, i32 %11)
store i32 %12, i32* %3
br label %18
13: ; preds = %1
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 2
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %9
%19 = load i32, i32* %3
%20 = sub nsw i32 255, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @brighten8_lin(i32 %0) {
%2 = sub nsw i32 255, %0
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @scale8(i32 %2, i32 %2)
br label %10
7: ; preds = %1
%8 = sub i32 256, %0
%9 = sdiv i32 %8, 2
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
%12 = sub nsw i32 255, %11
ret i32 %12
}
float pmax(float a, float b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<pmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <pmax+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <pmax+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmax>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @pmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ imprimeString(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char cadena[] = "cadena para imprimir!";
  printf("la cadena es:\n");
  imprimeString(cadena);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <imprimeString@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2172696d697270,%rax
mov    %rax,0xe(%rsp)
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <imprimeString@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.cadena = [22 x i8] c"cadena para imprimir!\00"
@.str = [15 x i8] c"la cadena es:\0A\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = bitcast [22 x i8]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%5 = call i32 @imprimeString(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.cadena = [22 x i8] c"cadena para imprimir!\00"
@str = [14 x i8] c"la cadena es:\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = call i32 @imprimeString(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int array[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", array[i]);
  printf("n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0x6e,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"n\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 110)
ret void
}