xunge/DecIR huggingface dataset:
void rop3_255_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = 255;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_255_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)
movb   $0xff,-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_255_1_1>:
mov    %edx,%eax
or     %sil,%al
not    %al
mov    (%rdi),%cl
and    %cl,%sil
or     %al,%sil
and    %dl,%cl
or     %sil,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_255_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i8 -1, i8* %7
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = and i32 %13, %16
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = and i32 %20, %22
%24 = or i32 %17, %23
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = or i32 %24, %30
%32 = trunc i32 %31 to i8
%33 = load i8*, i8** %4
store i8 %32, i8* %33
ret void
}

LLVM IR (-O2):
define void @rop3_255_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %1
%8 = or i8 %7, %5
%9 = and i8 %6, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void manipulador(char *buffer) {
  char nuevobuffer[30];
  strcpy(nuevobuffer, buffer);
}


x86 assembly (clang, -O0):
<manipulador>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manipulador>:
sub    $0x28,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @manipulador(i8* %0) {
%2 = alloca i8*
%3 = alloca [30 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @manipulador(i8* %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pnp_write_config(unsigned char, int, int);
void pnp_set_logical_device(unsigned char port, int device) {
  pnp_write_config(port, device, 0x07);
}


x86 assembly (clang, -O0):
<pnp_set_logical_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    $0x7,%edx
movzbl %al,%edi
call   1030 <pnp_write_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnp_set_logical_device>:
mov    $0x7,%edx
jmp    1030 <pnp_write_config@plt>

LLVM IR (-O0):
define void @pnp_set_logical_device(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 = load i32, i32* %4
%7 = call i32 @pnp_write_config(i8 zeroext %5, i32 %6, i32 7)
ret void
}

LLVM IR (-O2):
define void @pnp_set_logical_device(i8 zeroext %0, i32 %1) {
%3 = tail call i32 @pnp_write_config(i8 zeroext %0, i32 %1, i32 7)
ret void
}
/* Variables and functions */
unsigned char *cbor_write_type_size(unsigned char *, unsigned int,
                                    int /*<<< orphan*/, unsigned int);
unsigned char *cbor_write_pint(unsigned char *data, unsigned int size,
                               unsigned int value) {
  return cbor_write_type_size(data, size, 0, value);
}


x86 assembly (clang, -O0):
<cbor_write_pint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
xor    %edx,%edx
call   1030 <cbor_write_type_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_write_pint>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <cbor_write_type_size@plt>

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

LLVM IR (-O2):
define i8* @cbor_write_pint(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @cbor_write_type_size(i8* %0, i32 %1, i32 0, i32 %2)
ret i8* %4
}
unsigned long h(unsigned char *p) { return *p; }


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

x86 assembly (clang, -O2):
<h>:
movzbl (%rdi),%eax
ret

LLVM IR (-O0):
define i64 @h(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @h(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void evenmorehello(void) { printf("Hello back from C-land\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Hello back from C-land\0A\00"
define void @evenmorehello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Hello back from C-land\00"
define void @evenmorehello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(unsigned int);
void o(unsigned int c) {
  while (c) {
    g(c);
    c = c >> 8;
  }
}


x86 assembly (clang, -O0):
<o>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113b <o+0x2b>
mov    -0x4(%rbp),%edi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <o+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<o>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1134 <o+0x24>
mov    %edi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <g@plt>
shr    $0x8,%ebp
cmp    $0xff,%ebx
mov    %ebp,%ebx
ja     1120 <o+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @o(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @g(i32 %4)
%6 = lshr i32 %4, 8
%7 = icmp ult i32 %4, 256
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int execute_acct() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_acct() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_acct() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void light_reset(void) {
  mbus_remote_register_write(0x4, 0x01, ((0 << 5) | (0 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<light_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x9,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<light_reset>:
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x9,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @light_reset() {
%1 = call i32 @mbus_remote_register_write(i32 4, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
define void @light_reset() {
%1 = tail call i32 @mbus_remote_register_write(i32 4, i32 1, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(char const *s, int fd) {
  int i;
  if (!s)
    return;
  i = 0;
  while (s[i])
    i++;
  write(fd, s, i);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <ft_putstr_fd+0x1f>
jmp    1165 <ft_putstr_fd+0x55>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1156 <ft_putstr_fd+0x46>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <ft_putstr_fd+0x26>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
test   %rdi,%rdi
je     1137 <ft_putstr_fd+0x27>
mov    %rdi,%rax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rax,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr_fd+0x10>
add    $0xffffffff,%edx
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = tail call i32 @write(i32 %1, i8* %0, i32 %11)
br label %13
13: ; preds = %2, %10
ret void
}
void ff_hevc_put_hevc_uni_qpel_h64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h64_12_sse4() {
ret void
}
/* Variables and functions */
int isspace(char c) {
  return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||
         c == '\v';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1171 <isspace+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0xb,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%dil
ja     1120 <isspace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    1120 <isspace+0x20>
ret
xor    %eax,%eax
cmp    $0xb,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 12, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a = 5;
  int i = 1;
  scanf("%d", &a);
  while (a != 0) {
    printf("%d\n\n\n", a);
    scanf("%d", &a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     117b <main+0x5b>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0xc(%rsp)
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
je     117b <main+0x5b>
lea    0xeb2(%rip),%r14
lea    0xea8(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
void functionParaExpr() {}


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

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

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

LLVM IR (-O2):
define void @functionParaExpr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fun6() {
  printf("\nin fun6\n");
  return 7;
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"\0Ain fun6\00"
define i32 @fun6() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ init_contextual_type();
int /*<<< orphan*/ init_functional_type();
int /*<<< orphan*/ init_highest_structural_type();
void initialise_slice_properties(void) {
  init_highest_structural_type();
  init_contextual_type();
  init_functional_type();
}


x86 assembly (clang, -O0):
<initialise_slice_properties>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_highest_structural_type@plt>
mov    $0x0,%al
call   1030 <init_contextual_type@plt>
mov    $0x0,%al
call   1040 <init_functional_type@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialise_slice_properties>:
push   %rax
xor    %eax,%eax
call   1050 <init_highest_structural_type@plt>
xor    %eax,%eax
call   1030 <init_contextual_type@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <init_functional_type@plt>

LLVM IR (-O0):
define void @initialise_slice_properties() {
%1 = call i32 (...) @init_highest_structural_type()
%2 = call i32 (...) @init_contextual_type()
%3 = call i32 (...) @init_functional_type()
ret void
}

LLVM IR (-O2):
define void @initialise_slice_properties() {
%1 = tail call i32 (...) @init_highest_structural_type()
%2 = tail call i32 (...) @init_contextual_type()
%3 = tail call i32 (...) @init_functional_type()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void fail(char *what, int ret) {
  printf("%s failed: %d\n", what, ret);
  exit(ret);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s failed: %d\0A\00"
define void @fail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s failed: %d\0A\00"
define void @fail(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
struct strerr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ strerr_warn(char const *, char const *, char const *,
                               char const *, char const *, char const *,
                               struct strerr const *);
void strerr_die(int e, const char *x1, const char *x2, const char *x3,
                const char *x4, const char *x5, const char *x6,
                const struct strerr *se) {
  strerr_warn(x1, x2, x3, x4, x5, x6, se);
  _exit(e);
}


x86 assembly (clang, -O0):
<strerr_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <strerr_warn@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<strerr_die>:
push   %rbx
sub    $0x10,%rsp
mov    %r9,%rax
mov    %edi,%ebx
mov    0x20(%rsp),%r9
mov    0x28(%rsp),%rdi
mov    %rdi,(%rsp)
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %rax,%r8
call   1040 <strerr_warn@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.strerr = type { i32 }
define void @strerr_die(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, %struct.strerr* %7) {
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca %struct.strerr*
store i32 %0, i32* %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store %struct.strerr* %7, %struct.strerr** %16
%17 = load i8*, i8** %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = load i8*, i8** %13
%21 = load i8*, i8** %14
%22 = load i8*, i8** %15
%23 = load %struct.strerr*, %struct.strerr** %16
%24 = call i32 @strerr_warn(i8* %17, i8* %18, i8* %19, i8* %20, i8* %21, i8* %22, %struct.strerr* %23)
%25 = load i32, i32* %9
%26 = call i32 @_exit(i32 %25)
unreachable
}

LLVM IR (-O2):
%struct.strerr = type { i32 }
define void @strerr_die(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, %struct.strerr* %7) {
%9 = tail call i32 @strerr_warn(i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, %struct.strerr* %7)
%10 = tail call i32 @_exit(i32 %0)
unreachable
}
char *procprt_NOTAVAIL_5(struct tstat *curstat, int avgval, int nsecs) {
  return "    ?";
}


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

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [6 x i8] c" ?\00"
define i8* @procprt_NOTAVAIL_5(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [6 x i8] c" ?\00"
define i8* @procprt_NOTAVAIL_5(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ mtest_aug_allocations(int);
void mtest_free(void *pointer) {
  mtest_aug_allocations(-1);
  free(pointer);
}


x86 assembly (clang, -O0):
<mtest_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1040 <mtest_aug_allocations@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtest_free>:
push   %rbx
mov    %rdi,%rbx
mov    $0xffffffff,%edi
call   1040 <mtest_aug_allocations@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mtest_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @mtest_aug_allocations(i32 -1)
%4 = load i8*, i8** %2
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
define void @mtest_free(i8* nocapture %0) {
%2 = tail call i32 @mtest_aug_allocations(i32 -1)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct thread_info {
  int dummy;
};

/* Variables and functions */
unsigned long __arch_copy_to_user(void *, void *, unsigned long);
struct thread_info *current_thread_info();
unsigned long copy_to_user(void *to, void *from, unsigned long n) {
  unsigned long flag;
  unsigned long sum;
  struct thread_info *tmp;
  tmp = current_thread_info();
  if (flag == 0UL) {
    n = __arch_copy_to_user(to, from, n);
  }
  return (n);
}


x86 assembly (clang, -O0):
<copy_to_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <current_thread_info@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115f <copy_to_user+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <__arch_copy_to_user@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_to_user>:
push   %rbx
mov    %rdx,%rbx
xor    %eax,%eax
call   1030 <current_thread_info@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.thread_info = type { i32 }
define i64 @copy_to_user(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca %struct.thread_info*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = call %struct.thread_info* (...) @current_thread_info()
store %struct.thread_info* %10, %struct.thread_info** %9
%11 = load i64, i64* %7
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i64 @__arch_copy_to_user(i8* %14, i8* %15, i64 %16)
store i64 %17, i64* %6
br label %18
18: ; preds = %13, %3
%19 = load i64, i64* %6
ret i64 %19
}

LLVM IR (-O2):
%struct.thread_info = type { i32 }
define i64 @copy_to_user(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 returned %2) {
%4 = tail call %struct.thread_info* (...) @current_thread_info()
ret i64 %2
}
__typeof__(strcat(1, (void *)1)) test_strcat_147(void) {
  return strcat(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_strcat_147>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <strcat@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @test_strcat_147() {
%1 = call i8* @strcat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i8* %1
}

LLVM IR (-O2):
define i8* @test_strcat_147() {
%1 = tail call i8* @strcat(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int);
void mergesort(int A[], int start, int end) {
  if (end > start) {
    mergesort(A, start, (start + end) / 2);
    mergesort(A, (start + end) / 2 + 1, end);
    merge(A, start, end);
  }
  return;
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1188 <mergesort+0x68>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %esi,%edx
jle    116e <mergesort+0x4e>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
lea    (%r14,%rbx,1),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
mov    %ebp,%edx
call   1040 <mergesort@plt>
add    $0x1,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <mergesort@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergesort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergesort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %2)
br label %5
}
int g(void) {
  static int n;
  return n++;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@g.n = internal global i32 0
define i32 @g() {
%1 = load i32, i32* @g.n
%2 = add nsw i32 %1, 1
store i32 %2, i32* @g.n
ret i32 %1
}

LLVM IR (-O2):
@g.n = internal unnamed_addr global i32 0
define i32 @g() {
%1 = load i32, i32* @g.n
%2 = add nsw i32 %1, 1
store i32 %2, i32* @g.n
ret i32 %1
}
/* Type definitions */
struct Multiarray_Matrix_T {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
print_Multiarray_Matrix_T_tol(struct Multiarray_Matrix_T const *const, double);
void print_Multiarray_Matrix_T(const struct Multiarray_Matrix_T *const a) {
  print_Multiarray_Matrix_T_tol(a, 1.0e-15);
}


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

x86 assembly (clang, -O2):
<print_Multiarray_Matrix_T>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <print_Multiarray_Matrix_T_tol@plt>

LLVM IR (-O0):
%struct.Multiarray_Matrix_T = type { i32 }
define void @print_Multiarray_Matrix_T(%struct.Multiarray_Matrix_T* %0) {
%2 = alloca %struct.Multiarray_Matrix_T*
store %struct.Multiarray_Matrix_T* %0, %struct.Multiarray_Matrix_T** %2
%3 = load %struct.Multiarray_Matrix_T*, %struct.Multiarray_Matrix_T** %2
%4 = call i32 @print_Multiarray_Matrix_T_tol(%struct.Multiarray_Matrix_T* %3, double 1.000000e-15)
ret void
}

LLVM IR (-O2):
%struct.Multiarray_Matrix_T = type { i32 }
define void @print_Multiarray_Matrix_T(%struct.Multiarray_Matrix_T* %0) {
%2 = tail call i32 @print_Multiarray_Matrix_T_tol(%struct.Multiarray_Matrix_T* %0, double 1.000000e-15)
ret void
}
unsigned int test_5(unsigned int x) { return x | (1 << 8); }


x86 assembly (clang, -O0):
<test_5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x100,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_5>:
mov    %edi,%eax
or     $0x100,%eax
ret

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

LLVM IR (-O2):
define i32 @test_5(i32 %0) {
%2 = or i32 %0, 256
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int broqch, a;
  a = 1;
  for (broqch = 1; broqch < 11; broqch++) {
    a = a * broqch;
  }
  printf("10 factorial is %d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jge    114f <main+0x3f>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"10 factorial is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int magellan_init(int fd) {
  write(fd, "m3\rpBB\rz\r", 9);
  return 0;
}


x86 assembly (clang, -O0):
<magellan_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x9,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magellan_init>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x9,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"m3\0DpBB\0Dz\0D\00"
define i32 @magellan_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"m3\0DpBB\0Dz\0D\00"
define i32 @magellan_init(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
int check_cursor_pos(char *, char const *, int const *);
int /*<<< orphan*/ lou_free();
int main(int argc, char **argv) {
  const char *str1 = "World ";
  const int expected_pos1[] = {0, 1, 2, 3, 4, 3};
  int result =
      check_cursor_pos("compress.cti,en-us-g2.ctb", str1, expected_pos1);
  lou_free();
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee5(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    0xe96(%rip),%rdi
call   1030 <check_cursor_pos@plt>
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1040 <lou_free@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xf14(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xef8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec4(%rip),%rdi
lea    0xeb6(%rip),%rsi
mov    %rsp,%rdx
call   1030 <check_cursor_pos@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <lou_free@plt>
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"World \00"
@__const.main.expected_pos1 = [6 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 3]
@.str.1 = [26 x i8] c"compress.cti,en-us-g2.ctb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [6 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %6
%9 = bitcast [6 x i32]* %7 to i8*
%10 = load i8*, i8** %6
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
%12 = call i32 @check_cursor_pos(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32* %11)
store i32 %12, i32* %8
%13 = call i32 (...) @lou_free()
%14 = load i32, i32* %8
ret i32 %14
}

LLVM IR (-O2):
@.str = [7 x i8] c"World \00"
@__const.main.expected_pos1 = [6 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 3]
@.str.1 = [26 x i8] c"compress.cti,en-us-g2.ctb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i32 @check_cursor_pos(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = call i32 (...) @lou_free()
ret i32 %6
}
/* Variables and functions */
double _get_ulong(const char *data, size_t pos) {
  unsigned long int *buf = (unsigned long int *)data;
  return ((double)buf[pos]);
}


x86 assembly (clang, -O0):
<_get_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movq   (%rax,%rcx,8),%xmm0
movaps 0xed8(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_ulong>:
movsd  (%rdi,%rsi,8),%xmm1
unpcklps 0xef4(%rip),%xmm1
subpd  0xefc(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @_get_ulong(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i64*, i64** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds i64, i64* %8, i64 %9
%11 = load i64, i64* %10
%12 = uitofp i64 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @_get_ulong(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 %1
%5 = load i64, i64* %4
%6 = uitofp i64 %5 to double
ret double %6
}
/* Variables and functions */
int log10(double const);
int num_int_digits(const double val) {
  return 1 + (val > 1.0 ? log10(val) : val < -1.0 ? log10(-val) : 0);
}


x86 assembly (clang, -O0):
<num_int_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <num_int_digits+0x36>
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
mov    %eax,-0xc(%rbp)
jmp    1192 <num_int_digits+0x82>
movsd  0xeba(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1182 <num_int_digits+0x72>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <log10@plt>
mov    %eax,-0x10(%rbp)
jmp    118c <num_int_digits+0x7c>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    118c <num_int_digits+0x7c>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_int_digits>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
ja     1136 <num_int_digits+0x26>
mov    $0x1,%eax
movsd  0xee0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    113e <num_int_digits+0x2e>
xorpd  0xeda(%rip),%xmm0
call   1030 <log10@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @num_int_digits(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 1.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call i32 @log10(double %6)
br label %18
8: ; preds = %1
%9 = load double, double* %2
%10 = fcmp olt double %9, -1.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load double, double* %2
%13 = fneg double %12
%14 = call i32 @log10(double %13)
br label %16
15: ; preds = %8
br label %16
16: ; preds = %15, %11
%17 = phi i32 [ %14, %11 ], [ 0, %15 ]
br label %18
18: ; preds = %16, %5
%19 = phi i32 [ %7, %5 ], [ %17, %16 ]
%20 = add nsw i32 1, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @num_int_digits(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp olt double %0, -1.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = fneg double %0
br label %7
7: ; preds = %1, %5
%8 = phi double [ %6, %5 ], [ %0, %1 ]
%9 = tail call i32 @log10(double %8)
%10 = add i32 %9, 1
br label %11
11: ; preds = %7, %3
%12 = phi i32 [ 1, %3 ], [ %10, %7 ]
ret i32 %12
}
int test_imm_36int8_mem(signed char *val) {
  return ((*val) & (-0x36 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_36int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -54
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
const char *DeviceName() { return "USB-UIRT Transceiver"; }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"USB-UIRT Transceiver\00"
define i8* @DeviceName() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [21 x i8] c"USB-UIRT Transceiver\00"
define i8* @DeviceName() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void aaa() { db(0x37); }


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

x86 assembly (clang, -O2):
<aaa>:
mov    $0x37,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @aaa() {
%1 = call i32 @db(i32 55)
ret void
}

LLVM IR (-O2):
define void @aaa() {
%1 = tail call i32 @db(i32 55)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char const *pw_dir;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
const char *gethome_uid(uid_t uid) {
  struct passwd *pw;
  pw = getpwuid(uid);
  return pw->pw_dir;
}


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

x86 assembly (clang, -O2):
<gethome_uid>:
push   %rax
call   1030 <getpwuid@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @gethome_uid(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %6, i32 0, i32 0
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @gethome_uid(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%4 = load i8*, i8** %3
ret i8* %4
}
/* Variables and functions */
scalar_t__ calloc(int, int);
void zeros(int **B, int n) { *B = (int *)calloc(n, sizeof(int)); }


x86 assembly (clang, -O0):
<zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeros>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @zeros(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i64 @calloc(i32 %5, i32 4)
%7 = inttoptr i64 %6 to i32*
%8 = load i32**, i32*** %3
store i32* %7, i32** %8
ret void
}

LLVM IR (-O2):
define void @zeros(i32** nocapture writeonly %0, i32 %1) {
%3 = tail call i64 @calloc(i32 %1, i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %0
ret void
}