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


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

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

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

LLVM IR (-O2):
define void @rop3_220_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = and i8 %5, %2
%7 = or i8 %6, %1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("char is 16 bits.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"char is 16 bits.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"char is 16 bits.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void DummyFree(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @DummyFree(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ mem_read_ramw(int, void *);
uint16_t ps2_read_shadow_ramw(uint32_t addr, void *priv) {
  addr = (addr & 0x1ffff) + 0xe0000;
  return mem_read_ramw(addr, priv);
}


x86 assembly (clang, -O0):
<ps2_read_shadow_ramw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1ffff,%eax
add    $0xe0000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <mem_read_ramw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps2_read_shadow_ramw>:
and    $0x1ffff,%edi
or     $0xe0000,%edi
jmp    1030 <mem_read_ramw@plt>

LLVM IR (-O0):
define i32 @ps2_read_shadow_ramw(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 131071
%7 = add nsw i32 %6, 917504
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @mem_read_ramw(i32 %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ps2_read_shadow_ramw(i32 %0, i8* %1) {
%3 = and i32 %0, 131071
%4 = or i32 %3, 917504
%5 = tail call i32 @mem_read_ramw(i32 %4, i8* %1)
ret i32 %5
}
long long longLongTest(long long value) { return value; }


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

x86 assembly (clang, -O2):
<longLongTest>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longLongTest(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @longLongTest(i64 returned %0) {
ret i64 %0
}
void X509_CERT_PAIR_new(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_CERT_PAIR_new() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_display_key_event(char *);
int /*<<< orphan*/ fd_nrf8001_error();
void fd_nrf8001_decode_display_key_event(uint8_t *buffer, uint32_t length) {
  if (length != 7) {
    fd_nrf8001_error();
    return;
  }
  char *passkey = (char *)&buffer[1];
  fd_nrf8001_display_key_event(passkey);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
je     1145 <fd_nrf8001_decode_display_key_event+0x25>
mov    $0x0,%al
call   1030 <fd_nrf8001_error@plt>
jmp    115a <fd_nrf8001_decode_display_key_event+0x3a>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fd_nrf8001_display_key_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x7,%esi
jne    112e <fd_nrf8001_decode_display_key_event+0xe>
add    $0x4,%rdi
jmp    1040 <fd_nrf8001_display_key_event@plt>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_error@plt>

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

LLVM IR (-O2):
define void @fd_nrf8001_decode_display_key_event(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 7
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @fd_nrf8001_error()
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = bitcast i32* %7 to i8*
%9 = tail call i32 @fd_nrf8001_display_key_event(i8* %8)
br label %10
10: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void uninitvar_fclose(void) {
  FILE *stream;
  (void)fclose(stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_fclose>:
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @uninitvar_fclose() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @fclose(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fclose() {
%1 = tail call i32 @fclose(i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int send(int, char *, int, int /*<<< orphan*/);
int enviar(int sock, char *buf, int longitud) {
  if (send(sock, buf, longitud, 0) == -1) {
    perror("ERROR send");
    return (-1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<enviar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
jne    1164 <enviar+0x44>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <enviar+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enviar>:
push   %rbx
xor    %ebx,%ebx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
je     1133 <enviar+0x13>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%ebx
jmp    112f <enviar+0xf>

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

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR send\00"
define i32 @enviar(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int /*<<< orphan*/);
char *strchr(char *, char);
int /*<<< orphan*/ strlen(char *);
void remchars(char *str, char c) {
  char *pos;
  while (pos = strchr(str, c))
    memmove(pos, pos + 1, strlen(pos));
}


x86 assembly (clang, -O0):
<remchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     118e <remchars+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1050 <memmove@plt>
jmp    1142 <remchars+0x12>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remchars>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
call   1040 <strchr@plt>
test   %rax,%rax
je     117c <remchars+0x4c>
mov    %rax,%rbx
movsbl %bpl,%r15d
nopl   (%rax)
lea    0x1(%rbx),%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1050 <memmove@plt>
mov    %r14,%rdi
mov    %r15d,%esi
call   1040 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <remchars+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @remchars(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
br label %6
6: ; preds = %11, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %4
%9 = call i8* @strchr(i8* %7, i8 signext %8)
store i8* %9, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = load i8*, i8** %5
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8*, i8** %5
%16 = call i32 @strlen(i8* %15)
%17 = call i32 @memmove(i8* %12, i8* %14, i32 %16)
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @remchars(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @strlen(i8* %6)
%9 = tail call i32 @memmove(i8* %6, i8* %7, i32 %8)
%10 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
int cifra(int x) {
  int y = 0;
  while (x > 0) {
    y = x % 10;
    x = x / 10;
  }
  return y;
}


x86 assembly (clang, -O0):
<cifra>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1139 <cifra+0x39>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <cifra+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cifra>:
test   %edi,%edi
jle    1139 <cifra+0x39>
mov    $0xcccccccd,%eax
nopl   0x0(%rax)
mov    %edi,%ecx
mov    %edi,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
cmp    $0x9,%ecx
ja     1110 <cifra+0x10>
movzbl %cl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
movzbl %al,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cifra(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = udiv i32 %4, 10
%6 = icmp ult i32 %4, 10
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = trunc i32 %4 to i8
%9 = urem i8 %8, 10
%10 = zext i8 %9 to i32
br label %11
11: ; preds = %7, %1
%12 = phi i32 [ %10, %7 ], [ 0, %1 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ clear_lines();
void cmd_clear(const char *pf, char **args) { clear_lines(); }


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

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

LLVM IR (-O0):
define void @cmd_clear(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 (...) @clear_lines()
ret void
}

LLVM IR (-O2):
define void @cmd_clear(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @clear_lines()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parallel_merge(char *, int);
void test_main(void) { parallel_merge("child-qsort", 72); }


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x48,%esi
call   1030 <parallel_merge@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_main>:
lea    0xee9(%rip),%rdi
mov    $0x48,%esi
jmp    1030 <parallel_merge@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"child-qsort\00"
define void @test_main() {
%1 = call i32 @parallel_merge(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 72)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"child-qsort\00"
define void @test_main() {
%1 = tail call i32 @parallel_merge(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 72)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ insertionsort(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int arr[] = {10, 7, 3, 1, 9, 7, 4, 3};
  int len = sizeof(arr) / sizeof(int);
  printf("Initial Array : ");
  printArray(arr, len);
  insertionsort(arr, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <printArray@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <insertionsort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <insertionsort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [8 x i32] [i32 10, i32 7, i32 3, i32 1, i32 9, i32 7, i32 4, i32 3]
@.str = [17 x i8] c"Initial Array : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @printArray(i32* %6, i32 %7)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @insertionsort(i32* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [8 x i32] [i32 10, i32 7, i32 3, i32 1, i32 9, i32 7, i32 4, i32 3]
@.str = [17 x i8] c"Initial Array : \00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%5 = call i32 @printArray(i32* %4, i32 8)
%6 = call i32 @insertionsort(i32* %4, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void refcnt_reg_pd_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_refcnt@%p::reg_pd (refcnt_reg_pd) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


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

x86 assembly (clang, -O2):
<refcnt_reg_pd_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_refcnt@%p::reg_pd (refcnt_reg_pd) is invoked after destruction\0A\00"
define void @refcnt_reg_pd_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_refcnt@%p::reg_pd (refcnt_reg_pd) is invoked after destruction\0A\00"
define void @refcnt_reg_pd_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_anl_data(FILE *stream, uint8_t data) {
  fprintf(stream,
          "ANL   A, #"
          "0x%02X"
          "                  ",
          data);
}


x86 assembly (clang, -O0):
<fprint_anl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_anl_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ANL A,x%02X \00"
define void @fprint_anl_data(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ANL A,x%02X \00"
define void @fprint_anl_data(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int bar(int, int);
int foo(int a, int b) {
  int c = b - a;
  c = bar(c, b / a);
  return c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%esi
call   1030 <bar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
mov    %esi,%ecx
sub    %edi,%ecx
cltd
idiv   %edi
mov    %ecx,%edi
mov    %eax,%esi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
%13 = call i32 @bar(i32 %9, i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = sdiv i32 %1, %0
%5 = tail call i32 @bar(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int n = 4;
  printf("%0*d", n, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x3,%edx
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    $0x4,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%0*d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ permute(int *, int const *, int const *, int, int const);
void permute_int(int *data_out, const int *data_in, const int *perm,
                 const int n) {
  permute(data_out, data_in, perm, sizeof(int), n);
}


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

x86 assembly (clang, -O2):
<permute_int>:
mov    %ecx,%r8d
mov    $0x4,%ecx
jmp    1030 <permute@plt>

LLVM IR (-O0):
define void @permute_int(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @permute(i32* %9, i32* %10, i32* %11, i32 4, i32 %12)
ret void
}

LLVM IR (-O2):
define void @permute_int(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = tail call i32 @permute(i32* %0, i32* %1, i32* %2, i32 4, i32 %3)
ret void
}
/* Variables and functions */
int fac(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fac(5));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fac(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pm_init_counters(int /*<<< orphan*/, int /*<<< orphan*/ *);
void pm_init() { pm_init_counters(0, NULL); }


x86 assembly (clang, -O0):
<pm_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pm_init_counters@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_init>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <pm_init_counters@plt>

LLVM IR (-O0):
define void @pm_init() {
%1 = call i32 @pm_init_counters(i32 0, i32* null)
ret void
}

LLVM IR (-O2):
define void @pm_init() {
%1 = tail call i32 @pm_init_counters(i32 0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("  -b x    Write x bytes (default 1024)\n");
  printf("  -n f    Write to device f (default \"/dev/sda\")\n");
  printf("  -q      Suppress info messages\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xf28(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [40 x i8] c" -b x Write x bytes (default 1024)\0A\00"
@.str.1 = [50 x i8] c" -n f Write to device f (default \22/dev/sda\22)\0A\00"
@.str.2 = [34 x i8] c" -q Suppress info messages\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c" -b x Write x bytes (default 1024)\00"
@str.3 = [49 x i8] c" -n f Write to device f (default \22/dev/sda\22)\00"
@str.4 = [33 x i8] c" -q Suppress info messages\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
void setfield(char *label, char *val, FILE *fp) {
  fprintf(fp, "%s(%s)\n", label, val);
}


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

x86 assembly (clang, -O2):
<setfield>:
mov    %rsi,%rcx
mov    %rdi,%rax
lea    0xee3(%rip),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s(%s)\0A\00"
define void @setfield(i8* %0, i8* %1, i32* nocapture %2) {
%4 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
OP(fd, db) {
  illegal_1();
  op_db();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_db@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_db@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_db()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_db()
ret i32 undef
}
void gtk_widget_size_allocate() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_size_allocate() {
ret void
}
int leapYear(int y) {
  int result;
  if (y % 400 == 0)
    result = 1;
  else if (y % 100 == 0)
    result = 0;
  else if (y % 4 == 0)
    result = 1;
  else
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<leapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <leapYear+0x27>
movl   $0x1,-0x8(%rbp)
jmp    1178 <leapYear+0x78>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <leapYear+0x47>
movl   $0x0,-0x8(%rbp)
jmp    1173 <leapYear+0x73>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <leapYear+0x67>
movl   $0x1,-0x8(%rbp)
jmp    116e <leapYear+0x6e>
movl   $0x0,-0x8(%rbp)
jmp    1173 <leapYear+0x73>
jmp    1178 <leapYear+0x78>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapYear>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <leapYear+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <leapYear+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @leapYear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %3
br label %21
8: ; preds = %1
%9 = load i32, i32* %2
%10 = srem i32 %9, 100
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %3
br label %20
13: ; preds = %8
%14 = load i32, i32* %2
%15 = srem i32 %14, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %3
br label %19
18: ; preds = %13
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17
br label %20
20: ; preds = %19, %12
br label %21
21: ; preds = %20, %7
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @leapYear(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void cs5536_enable_smbus(void) {
  outb((0x7F << 1) | (0x01 << 0), 0x6000 + 0x05);
  outb((0xEF | (0x01 << 7)), 0x6000 + 0x04);
}


x86 assembly (clang, -O0):
<cs5536_enable_smbus>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
mov    $0x6005,%esi
call   1030 <outb@plt>
mov    $0xef,%edi
mov    $0x6004,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs5536_enable_smbus>:
push   %rax
mov    $0xff,%edi
mov    $0x6005,%esi
call   1030 <outb@plt>
mov    $0xef,%edi
mov    $0x6004,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @cs5536_enable_smbus() {
%1 = call i32 @outb(i32 255, i32 24581)
%2 = call i32 @outb(i32 239, i32 24580)
ret void
}

LLVM IR (-O2):
define void @cs5536_enable_smbus() {
%1 = tail call i32 @outb(i32 255, i32 24581)
%2 = tail call i32 @outb(i32 239, i32 24580)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: kgzip [-cv] [-f format] [-l loader] [-o output] file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"usage: kgzip [-cv] [-f format] [-l loader] [-o output] file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"usage: kgzip [-cv] [-f format] [-l loader] [-o output] file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void foo(void) {
#pragma GCC ivdep
  while (1)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <foo+0x9>
jmp    1109 <foo+0x9>

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define void @foo() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %0, %1
br label %1
}
int my_swap(int *a, int *b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
  return (0);
}


x86 assembly (clang, -O0):
<my_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @my_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ddd(char *);
void ccc(char *x) { ddd(x); }


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

x86 assembly (clang, -O2):
<ccc>:
jmp    1030 <ddd@plt>

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

LLVM IR (-O2):
define void @ccc(i8* %0) {
%2 = tail call i32 @ddd(i8* %0)
ret void
}
double _Complex *fp_cxd(double _Complex *cx) { return cx; }


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

x86 assembly (clang, -O2):
<fp_cxd>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define { double, double }* @fp_cxd({ double, double }* %0) {
%2 = alloca { double, double }*
store { double, double }* %0, { double, double }** %2
%3 = load { double, double }*, { double, double }** %2
ret { double, double }* %3
}

LLVM IR (-O2):
define { double, double }* @fp_cxd({ double, double }* readnone returned %0) {
ret { double, double }* %0
}
void AtomicAssertOnCompileInt(void) {
  enum {
    AssertOnCompileMisused =
        8 * sizeof(int) == 32 && 8 * sizeof(int) == 32 && 8 * sizeof(int) == 32
            ? 1
            : -1
  };
  typedef char AssertOnCompileFailed[AssertOnCompileMisused]
      __attribute__((__unused__));
}


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

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

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

LLVM IR (-O2):
define void @AtomicAssertOnCompileInt() {
ret void
}
/* Type definitions */
typedef int dev_t;

/* Variables and functions */
dev_t dev_from_mount_options(
    __attribute__((unused)) char const *mount_options) {
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @dev_from_mount_options(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int arraySum(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int numbers[] = {0, 1, 2, 3, 4, 5};
  printf("Sum array: 0 1 2 3 4 5\n\n");
  printf("Total: %i", arraySum(numbers, 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1040 <arraySum@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xed5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
mov    $0x6,%esi
call   1050 <arraySum@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.numbers = [6 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [25 x i8] c"Sum array: 0 1 2 3 4 5\0A\0A\00"
@.str.1 = [10 x i8] c"Total: %i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
store i32 0, i32* %1
%3 = bitcast [6 x i32]* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = call i32 @arraySum(i32* %5, i32 6)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.numbers = [6 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5]
@.str.1 = [10 x i8] c"Total: %i\00"
@str = [24 x i8] c"Sum array: 0 1 2 3 4 5\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = call i32 @arraySum(i32* %4, i32 6)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void call(void (**funcarray)(void), int idx) { funcarray[idx](); }


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
call   *(%rax,%rcx,8)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
movslq %esi,%rax
jmp    *(%rdi,%rax,8)

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

LLVM IR (-O2):
define void @call(void ()** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds void ()*, void ()** %0, i64 %3
%5 = load void ()*, void ()** %4
tail call void %5()
ret void
}
int is_number(char c) {
  if ((c >= '0') && (c <= '9'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_number+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_number+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_number+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_number(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int bar(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 2
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 2
}
int callback3_int_short_int(short (*f)(int)) { return f(3); }


x86 assembly (clang, -O0):
<callback3_int_short_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   *-0x8(%rbp)
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback3_int_short_int>:
push   %rax
mov    %rdi,%rax
mov    $0x3,%edi
call   *%rax
cwtl
pop    %rcx
ret

LLVM IR (-O0):
define i32 @callback3_int_short_int(i16 (i32)* %0) {
%2 = alloca i16 (i32)*
store i16 (i32)* %0, i16 (i32)** %2
%3 = load i16 (i32)*, i16 (i32)** %2
%4 = call signext i16 %3(i32 3)
%5 = sext i16 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @callback3_int_short_int(i16 (i32)* nocapture %0) {
%2 = tail call signext i16 %0(i32 3)
%3 = sext i16 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XHostAddress;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XHostAddress(void) {
  XHostAddress *_p = (XHostAddress *)malloc(sizeof(XHostAddress));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XHostAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XHostAddress+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XHostAddress>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XHostAddress+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XHostAddress() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XHostAddress() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void register_test() {}


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

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

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

LLVM IR (-O2):
define void @register_test() {
ret void
}
int fun305() { return 305; }


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

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

LLVM IR (-O0):
define i32 @fun305() {
ret i32 305
}

LLVM IR (-O2):
define i32 @fun305() {
ret i32 305
}