xunge/DecIR huggingface dataset:
int imin(const int a, const int b) { return a < b ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int libshared(void) { return 21; }


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

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

LLVM IR (-O0):
define i32 @libshared() {
ret i32 21
}

LLVM IR (-O2):
define i32 @libshared() {
ret i32 21
}
/* Variables and functions */
int ciphCopy(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 3) {
    fprintf(
        stderr,
        "Syntax error! First parameter is source file, second is dest file\n");
    return 1;
  }
  return ciphCopy(argv[1], argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1161 <main+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1179 <main+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <ciphCopy@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1134 <main+0x14>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
pop    %rax
jmp    1030 <ciphCopy@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"Syntax error! First parameter is source file, second is dest file\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %19
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @ciphCopy(i8* %14, i8* %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %11, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"Syntax error! First parameter is source file, second is dest file\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @ciphCopy(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ 1, %4 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int platform_word_size();
unsigned platform_align_max() {
  switch (platform_word_size()) {
  case 4:
    return 8;
  case 8:
    return 16;
  }
  abort();
}


x86 assembly (clang, -O0):
<platform_align_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <platform_word_size@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x4,%eax
je     1153 <platform_align_max+0x33>
jmp    1142 <platform_align_max+0x22>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
je     115f <platform_align_max+0x3f>
jmp    116b <platform_align_max+0x4b>
movl   $0x8,-0x4(%rbp)
jmp    1172 <platform_align_max+0x52>
movl   $0x10,-0x4(%rbp)
jmp    1172 <platform_align_max+0x52>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_align_max>:
push   %rax
xor    %eax,%eax
call   1040 <platform_word_size@plt>
mov    %eax,%ecx
mov    $0x8,%eax
cmp    $0x4,%ecx
je     113e <platform_align_max+0x1e>
cmp    $0x8,%ecx
jne    1140 <platform_align_max+0x20>
mov    $0x10,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @platform_align_max() {
%1 = alloca i32
%2 = call i32 (...) @platform_word_size()
switch i32 %2, label %5 [
i32 4, label %3
i32 8, label %4
]
3: ; preds = %0
store i32 8, i32* %1
br label %7
4: ; preds = %0
store i32 16, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %4, %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @platform_align_max() {
%1 = tail call i32 (...) @platform_word_size()
switch i32 %1, label %3 [
i32 4, label %5
i32 8, label %2
]
2: ; preds = %0
br label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0, %2
%6 = phi i32 [ 16, %2 ], [ 8, %0 ]
ret i32 %6
}
int I_NoAppServicesLobbyMgrInRequest(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesLobbyMgrInRequest() {
ret i32 0
}
int ffs(x)
int x;
{
  int bit, mask;
  if (x == 0)
    return 0;
  for (bit = 1, mask = 1; !(x & mask); bit++, mask <<= 1)
    ;
  return bit;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1168 <ffs+0x68>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1146 <ffs+0x46>
jmp    1162 <ffs+0x62>
jmp    114b <ffs+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <ffs+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112a <ffs+0x2a>
mov    $0x1,%eax
test   $0x1,%dil
jne    1129 <ffs+0x29>
mov    $0x1,%ecx
mov    $0x1,%eax
nopl   0x0(%rax)
add    $0x1,%eax
add    %ecx,%ecx
test   %edi,%ecx
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %24
9: ; preds = %1
store i32 1, i32* %4
store i32 1, i32* %5
br label %10
10: ; preds = %17, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %22
16: ; preds = %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
%20 = load i32, i32* %5
%21 = shl i32 %20, 1
store i32 %21, i32* %5
br label %10
22: ; preds = %10
%23 = load i32, i32* %4
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %8
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ 1, %3 ]
%9 = add nuw nsw i32 %8, 1
%10 = shl i32 %7, 1
%11 = and i32 %10, %0
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void ExitProgram(const char *message) {
  endwin();
  printf("%s\n", message);
  exit(0);
}


x86 assembly (clang, -O0):
<ExitProgram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <endwin@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<ExitProgram>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <endwin@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ExitProgram(i8* %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int i = 0;
  while (1) {
    printf("-----------%d\n", i++);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xed4(%rip),%rbx
nopl   0x0(%rax)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %ebp,%esi
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [15 x i8] c"-----------%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@.str = [15 x i8] c"-----------%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @sleep(i32 1)
br label %1
}
ISR(TIMER2_COMPB_vect) {
  DEBUG("ISR "
        "TIMER2_COMPB"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"ISR TIMER2_COMPB occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [25 x i8] c"ISR TIMER2_COMPB occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void a_and(volatile int *p, int v) {
  int old;
  do
    old = *p;
  while (((int (*)(int, int, volatile int *))0xffff0fc0)(old, old & v, p));
}


x86 assembly (clang, -O0):
<a_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
and    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    $0xffff0fc0,%eax
call   *%rax
cmp    $0x0,%eax
jne    110f <a_and+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_and>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xffff0fc0,%r14d
nop
mov    (%rbx),%edi
mov    %edi,%esi
and    %ebp,%esi
mov    %rbx,%rdx
call   *%r14
test   %eax,%eax
jne    1110 <a_and+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @a_and(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32*, i32** %3
%8 = load volatile i32, i32* %7
store i32 %8, i32* %5
br label %9
9: ; preds = %6
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = and i32 %11, %12
%14 = load i32*, i32** %3
%15 = call i32 inttoptr (i64 4294905792 to i32 (i32, i32, i32*)*)(i32 %10, i32 %13, i32* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %6, label %17
17: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @a_and(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %0
%5 = and i32 %4, %1
%6 = tail call i32 inttoptr (i64 4294905792 to i32 (i32, i32, i32*)*)(i32 %4, i32 %5, i32* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flip4(unsigned int const *, unsigned int *, int);
int read(int, float *, int);
int read_float4_array(int f, float *x, int n) {
  int nread = read(f, x, 4 * n);
  if (nread <= 0)
    return 0;
  flip4((const unsigned int *)x, (unsigned int *)x, nread / 4);
  return nread / 4;
}


x86 assembly (clang, -O0):
<read_float4_array>:
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
shl    $0x2,%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     115d <read_float4_array+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1185 <read_float4_array+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1040 <flip4@plt>
mov    -0x18(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_float4_array>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
shl    $0x2,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1146 <read_float4_array+0x26>
mov    %eax,%ebp
shr    $0x2,%ebp
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <flip4@plt>
jmp    1148 <read_float4_array+0x28>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_float4_array(i32 %0, float* %1, i32 %2) {
%4 = shl nsw i32 %2, 2
%5 = tail call i32 @read(i32 %0, float* %1, i32 %4)
%6 = icmp slt i32 %5, 1
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = bitcast float* %1 to i32*
%9 = lshr i32 %5, 2
%10 = tail call i32 @flip4(i32* %8, i32* %8, i32 %9)
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %9, %7 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello world! My first c program \n"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Hello world! My first c program \0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"Hello world! My first c program \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_007(int a, int c, int b, int d) { return a + (d & 1) + b + c; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
and    $0x1,%ecx
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_007(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* %8
%11 = and i32 %10, 1
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_007(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %3, 1
%6 = add i32 %1, %0
%7 = add i32 %6, %2
%8 = add i32 %7, %5
ret i32 %8
}
int is_palindrome(char *s) {}


x86 assembly (clang, -O0):
<is_palindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_palindrome(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Display();
void Reshape(int width, int height) { Display(); }


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

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

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

LLVM IR (-O2):
define void @Reshape(i32 %0, i32 %1) {
%3 = tail call i32 (...) @Display()
ret void
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ creo_clave(int);
int /*<<< orphan*/ exit(int);
int msgget(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int createMessageQueue(int key) {
  int msqid = msgget(creo_clave(key), 0600 | IPC_CREAT);
  if (msqid == -1) {
    printf("Error al obtener identificador para cola mensajes\n");
    exit(-1);
  }
  return msqid;
}


x86 assembly (clang, -O0):
<createMessageQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <creo_clave@plt>
mov    %eax,%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
or     $0x180,%esi
call   1030 <msgget@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    118c <createMessageQueue+0x4c>
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createMessageQueue>:
push   %rax
call   1040 <creo_clave@plt>
mov    0x2e93(%rip),%rcx
mov    $0x180,%esi
or     (%rcx),%esi
mov    %eax,%edi
call   1030 <msgget@plt>
cmp    $0xffffffff,%eax
je     1162 <createMessageQueue+0x22>
pop    %rcx
ret
lea    0xe97(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [51 x i8] c"Error al obtener identificador para cola mensajes\0A\00"
define i32 @createMessageQueue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @creo_clave(i32 %4)
%6 = load i32, i32* @IPC_CREAT
%7 = or i32 384, %6
%8 = call i32 @msgget(i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@str = [50 x i8] c"Error al obtener identificador para cola mensajes\00"
define i32 @createMessageQueue(i32 %0) {
%2 = tail call i32 @creo_clave(i32 %0)
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 384
%5 = tail call i32 @msgget(i32 %2, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ POLICY_CONSTRAINTS;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ POLICY_CONSTRAINTS_it;
void POLICY_CONSTRAINTS_free(POLICY_CONSTRAINTS *a) {
  ASN1_item_free((ASN1_VALUE *)a, &POLICY_CONSTRAINTS_it);
}


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

x86 assembly (clang, -O2):
<POLICY_CONSTRAINTS_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@POLICY_CONSTRAINTS_it = global i32 0
define void @POLICY_CONSTRAINTS_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @POLICY_CONSTRAINTS_it)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u64;

/* Variables and functions */
int __get_unaligned_be32(int /*<<< orphan*/ const *);
__u64 __get_unaligned_be64(const __u8 *p) {
  return (__u64)__get_unaligned_be32(p) << 32 | __get_unaligned_be32(p + 4);
}


x86 assembly (clang, -O0):
<__get_unaligned_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__get_unaligned_be32@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <__get_unaligned_be32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_unaligned_be64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__get_unaligned_be32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__get_unaligned_be32@plt>

LLVM IR (-O0):
define i32 @__get_unaligned_be64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @__get_unaligned_be32(i32* %3)
%5 = shl i32 %4, 32
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 4
%8 = call i32 @__get_unaligned_be32(i32* %7)
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__get_unaligned_be64(i32* %0) {
%2 = tail call i32 @__get_unaligned_be32(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i32 @__get_unaligned_be32(i32* %3)
ret i32 poison
}
void ftn(char *sp) {
  char status;
  while (1) {
    *sp = 0xE8;
    status = *(volatile char *)sp;
    if (status & 0x80)
      break;
  }
}


x86 assembly (clang, -O0):
<ftn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xe8,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112f <ftn+0x2f>
jmp    1134 <ftn+0x34>
jmp    1108 <ftn+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftn>:
movb   $0xe8,(%rdi)
cmpb   $0x0,(%rdi)
jns    1100 <ftn>
ret

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

LLVM IR (-O2):
define void @ftn(i8* %0) {
br label %2
2: ; preds = %2, %1
store i8 -24, i8* %0
%3 = load volatile i8, i8* %0
%4 = icmp sgt i8 %3, -1
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
unsigned int _uiCommDisconnect(unsigned int uiCommType) { return (0x0000); }


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

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

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

LLVM IR (-O2):
define i32 @_uiCommDisconnect(i32 %0) {
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double now(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((double)tv.tv_sec + (double)(tv.tv_usec / 1000000.0));
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %9, %6
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ func_stats_add(void const *, int, size_t);
int /*<<< orphan*/ my_hooks();
int /*<<< orphan*/ old_hooks();
void *realloc(void *, size_t);
void *my_realloc(void *ptr, size_t size, const void *caller) {
  void *ret;
  old_hooks();
  func_stats_add(caller, 1, size);
  ret = realloc(ptr, size);
  my_hooks();
  return ret;
}


x86 assembly (clang, -O0):
<my_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <old_hooks@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1050 <func_stats_add@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <my_hooks@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_realloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <old_hooks@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1050 <func_stats_add@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <realloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <my_hooks@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @my_realloc(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = call i32 (...) @old_hooks()
%9 = load i8*, i8** %6
%10 = load i64, i64* %5
%11 = call i32 @func_stats_add(i8* %9, i32 1, i64 %10)
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = call i8* @realloc(i8* %12, i64 %13)
store i8* %14, i8** %7
%15 = call i32 (...) @my_hooks()
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @my_realloc(i8* nocapture %0, i64 %1, i8* %2) {
%4 = tail call i32 (...) @old_hooks()
%5 = tail call i32 @func_stats_add(i8* %2, i32 1, i64 %1)
%6 = tail call i8* @realloc(i8* %0, i64 %1)
%7 = tail call i32 (...) @my_hooks()
ret i8* %6
}
/* Variables and functions */
int hex_to_int(char);
int hex_to_ascii(char c, char d) {
  int high = hex_to_int(c) * 16;
  int low = hex_to_int(d);
  return high + low;
}


x86 assembly (clang, -O0):
<hex_to_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <hex_to_int@plt>
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <hex_to_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_ascii>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <hex_to_int@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
mov    %ebx,%edi
call   1030 <hex_to_int@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hex_to_ascii(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = call i32 @hex_to_int(i8 signext %7)
%9 = mul nsw i32 %8, 16
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = call i32 @hex_to_int(i8 signext %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @hex_to_ascii(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @hex_to_int(i8 signext %0)
%4 = shl nsw i32 %3, 4
%5 = tail call i32 @hex_to_int(i8 signext %1)
%6 = add nsw i32 %4, %5
ret i32 %6
}
void gtk_menu_shell_deactivate() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_shell_deactivate() {
ret void
}
int j(int x) {
  if (x > 4) {
    char c = x + 1;
    return c;
  } else {
    int c = x * 2;
    return c;
  }
}


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    1126 <j+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <j+0x35>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<j>:
lea    0x1(%rdi),%eax
lea    (%rdi,%rdi,1),%ecx
cmp    $0x5,%edi
movsbl %al,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @j(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 4
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = trunc i32 %10 to i8
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
store i32 %13, i32* %2
br label %18
14: ; preds = %1
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, 2
store i32 %16, i32* %5
%17 = load i32, i32* %5
store i32 %17, i32* %2
br label %18
18: ; preds = %14, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @j(i32 %0) {
%2 = icmp sgt i32 %0, 4
%3 = shl i32 %0, 24
%4 = add i32 %3, 16777216
%5 = ashr exact i32 %4, 24
%6 = shl nsw i32 %0, 1
%7 = select i1 %2, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int strlen(char *);
char *getFilename(char *basename) {
  int i = strlen(basename);
  while (i > 0) {
    if (*(basename + i) == '/') {
      break;
    }
    i--;
  }
  return basename + i;
}


x86 assembly (clang, -O0):
<getFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115a <getFilename+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    114c <getFilename+0x3c>
jmp    115a <getFilename+0x4a>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <getFilename+0x18>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFilename>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1134 <getFilename+0x24>
nopl   (%rax)
mov    %eax,%ecx
cmpb   $0x2f,(%rbx,%rcx,1)
je     1134 <getFilename+0x24>
lea    -0x1(%rax),%ecx
cmp    $0x1,%eax
mov    %ecx,%eax
jg     1120 <getFilename+0x10>
xor    %eax,%eax
cltq
add    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @getFilename(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %10
%5 = phi i32 [ %11, %10 ], [ %2, %1 ]
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 47
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = add nsw i32 %5, -1
%12 = icmp sgt i32 %5, 1
br i1 %12, label %4, label %13
13: ; preds = %10, %4, %1
%14 = phi i32 [ %2, %1 ], [ %5, %4 ], [ 0, %10 ]
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
ret i8* %16
}
_Complex float ffi_test_45(int x) { return x; }


x86 assembly (clang, -O0):
<ffi_test_45>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffi_test_45>:
cvtsi2ss %edi,%xmm1
xorps  %xmm0,%xmm0
movss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @ffi_test_45(i32 %0) {
%2 = alloca { float, float }
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to float
%6 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%7 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %5, float* %6
store float 0.000000e+00, float* %7
%8 = bitcast { float, float }* %2 to <2 x float>*
%9 = load <2 x float>, <2 x float>* %8
ret <2 x float> %9
}

LLVM IR (-O2):
define <2 x float> @ffi_test_45(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = insertelement <2 x float> <float poison, float 0.000000e+00>, float %2, i64 0
ret <2 x float> %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rmd_rol(uint32_t n, int bits) {
  return ((n << bits) | (n >> (32 - bits)));
}


x86 assembly (clang, -O0):
<rmd_rol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmd_rol>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rmd_rol(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rmd_rol(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int __divsi3(int, int);
int __modsi3(int a, int b) { return a - __divsi3(a, b) * b; }


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

x86 assembly (clang, -O2):
<__modsi3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <__divsi3@plt>
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__modsi3(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* %3
%7 = load i32, i32* %4
%8 = call i32 @__divsi3(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %5, %10
ret i32 %11
}

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


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

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

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

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


x86 assembly (clang, -O0):
<CyBle_ServiceInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <CyBle_BasInit@plt>
mov    $0x0,%al
call   1050 <CyBle_DisInit@plt>
mov    $0x0,%al
call   1040 <CyBle_HidsInit@plt>
mov    $0x0,%al
call   1030 <CyBle_ScpsInit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CyBle_ServiceInit>:
push   %rax
xor    %eax,%eax
call   1060 <CyBle_BasInit@plt>
xor    %eax,%eax
call   1050 <CyBle_DisInit@plt>
xor    %eax,%eax
call   1040 <CyBle_HidsInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CyBle_ScpsInit@plt>

LLVM IR (-O0):
define void @CyBle_ServiceInit() {
%1 = call i32 (...) @CyBle_BasInit()
%2 = call i32 (...) @CyBle_DisInit()
%3 = call i32 (...) @CyBle_HidsInit()
%4 = call i32 (...) @CyBle_ScpsInit()
ret void
}

LLVM IR (-O2):
define void @CyBle_ServiceInit() {
%1 = tail call i32 (...) @CyBle_BasInit()
%2 = tail call i32 (...) @CyBle_DisInit()
%3 = tail call i32 (...) @CyBle_HidsInit()
%4 = tail call i32 (...) @CyBle_ScpsInit()
ret void
}
/* Variables and functions */
scalar_t__ MyMalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *MyStrdup(char *str) {
  char *final;
  final = (char *)MyMalloc(strlen(str) + 1);
  strcpy(final, str);
  return (final);
}


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

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

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

LLVM IR (-O2):
define i8* @MyStrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @MyMalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
scalar_t__ output_check(int);
int /*<<< orphan*/ output_timing();
void problem_output() {
  if (output_check(10. * 2. * 3.14159265358979323846)) {
    output_timing();
  }
}


x86 assembly (clang, -O0):
<problem_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e,%edi
call   1040 <output_check@plt>
cmp    $0x0,%rax
je     113f <problem_output+0x1f>
mov    $0x0,%al
call   1030 <output_timing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem_output>:
push   %rax
mov    $0x3e,%edi
call   1040 <output_check@plt>
test   %rax,%rax
je     1138 <problem_output+0x18>
xor    %eax,%eax
pop    %rcx
jmp    1030 <output_timing@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @problem_output() {
%1 = call i64 @output_check(i32 62)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @problem_output() {
%1 = tail call i64 @output_check(i32 62)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
float abs(float);
float tan(float);
float sin_sqrt() {
  float error = 0.000001;
  float guess1 = 3;
  float guess2 = 0;
  while (abs(guess1 - guess2) > error) {
    guess2 = guess1;
    guess1 = guess1 - tan(guess1);
  }
  return guess1;
}


x86 assembly (clang, -O0):
<sin_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xed4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xec3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <abs@plt>
ucomiss -0x4(%rbp),%xmm0
jbe    1197 <sin_sqrt+0x77>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    114a <sin_sqrt+0x2a>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_sqrt>:
push   %rax
movss  0xed7(%rip),%xmm0
movss  %xmm0,(%rsp)
call   1030 <abs@plt>
ucomiss 0xeca(%rip),%xmm0
jbe    1185 <sin_sqrt+0x65>
movss  0xebc(%rip),%xmm0
movss  %xmm0,(%rsp)
nopl   0x0(%rax)
movss  %xmm0,0x4(%rsp)
call   1040 <tan@plt>
movss  (%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movaps %xmm1,%xmm0
subss  0x4(%rsp),%xmm0
call   1030 <abs@plt>
ucomiss 0xe86(%rip),%xmm0
movss  (%rsp),%xmm0
ja     1150 <sin_sqrt+0x30>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sin_sqrt() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
store float 0x3EB0C6F7A0000000, float* %1
store float 3.000000e+00, float* %2
store float 0.000000e+00, float* %3
br label %4
4: ; preds = %11, %0
%5 = load float, float* %2
%6 = load float, float* %3
%7 = fsub float %5, %6
%8 = call float @abs(float %7)
%9 = load float, float* %1
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load float, float* %2
store float %12, float* %3
%13 = load float, float* %2
%14 = load float, float* %2
%15 = call float @tan(float %14)
%16 = fsub float %13, %15
store float %16, float* %2
br label %4
17: ; preds = %4
%18 = load float, float* %2
ret float %18
}

LLVM IR (-O2):
define float @sin_sqrt() {
%1 = tail call float @abs(float 3.000000e+00)
%2 = fcmp ogt float %1, 0x3EB0C6F7A0000000
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi float [ %6, %3 ], [ 3.000000e+00, %0 ]
%5 = tail call float @tan(float %4)
%6 = fsub float %4, %5
%7 = fsub float %6, %4
%8 = tail call float @abs(float %7)
%9 = fcmp ogt float %8, 0x3EB0C6F7A0000000
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = phi float [ 3.000000e+00, %0 ], [ %6, %3 ]
ret float %11
}
unsigned int next_probe(unsigned int prev_key) {
  return (prev_key + 1) & ((1 << 4) - 1);
}


x86 assembly (clang, -O0):
<next_probe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_probe>:
lea    0x1(%rdi),%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @next_probe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1
%5 = and i32 %4, 15
ret i32 %5
}

LLVM IR (-O2):
define i32 @next_probe(i32 %0) {
%2 = add i32 %0, 1
%3 = and i32 %2, 15
ret i32 %3
}