xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ do_all(int, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ putenv(char *);
int shc_main(int argc, char *argv[]) {
  putenv("LANG=");
  do_all(argc, argv);
  perror(argv[0]);
  exit(1);
  return 1;
}


x86 assembly (clang, -O0):
<shc_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <putenv@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <do_all@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<shc_main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rdi
call   1030 <putenv@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <do_all@plt>
mov    (%rbx),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"LANG=\00"
define i32 @shc_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @putenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @do_all(i32 %6, i8** %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @perror(i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"LANG=\00"
define i32 @shc_main(i32 %0, i8** %1) {
%3 = tail call i32 @putenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @do_all(i32 %0, i8** %1)
%5 = load i8*, i8** %1
%6 = tail call i32 @perror(i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ lnp_hexdump(char *, unsigned char *, unsigned char);
int /*<<< orphan*/ printf(char *, unsigned char);
void lnp_integrity_hexdump(unsigned char *data, unsigned char length) {
  printf("Integrity layer message (%i bytes)\n", length);
  lnp_hexdump("[LNPI]", data, length);
}


x86 assembly (clang, -O0):
<lnp_integrity_hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    0xec7(%rip),%rdi
movzbl -0x9(%rbp),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed7(%rip),%rdi
movzbl -0x9(%rbp),%edx
call   1040 <lnp_hexdump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnp_integrity_hexdump>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <lnp_hexdump@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Integrity layer message (%i bytes)\0A\00"
@.str.1 = [7 x i8] c"[LNPI]\00"
define void @lnp_integrity_hexdump(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
%7 = load i8*, i8** %3
%8 = load i8, i8* %4
%9 = call i32 @lnp_hexdump(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8 zeroext %8)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Integrity layer message (%i bytes)\0A\00"
@.str.1 = [7 x i8] c"[LNPI]\00"
define void @lnp_integrity_hexdump(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
%4 = tail call i32 @lnp_hexdump(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8 zeroext %1)
ret void
}
void init_row2(int *row, int ld) {
  int i;
  for (i = 0; i < ld; i++)
    row[i] = 0;
}


x86 assembly (clang, -O0):
<init_row2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <init_row2+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <init_row2+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_row2>:
test   %esi,%esi
jle    1126 <init_row2+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @init_row2(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int w_quick_sort_string_compare(void *data, int i, void *key) {
  char **str = (char **)data;
  char *s1 = str[i];
  char *s2 = *((char **)key);
  return strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<w_quick_sort_string_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_quick_sort_string_compare>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rdi
mov    (%rdx),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @w_quick_sort_string_compare(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
store i8** %11, i8*** %7
%12 = load i8**, i8*** %7
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
store i8* %16, i8** %8
%17 = load i8*, i8** %6
%18 = bitcast i8* %17 to i8**
%19 = load i8*, i8** %18
store i8* %19, i8** %9
%20 = load i8*, i8** %8
%21 = load i8*, i8** %9
%22 = call i32 @strcmp(i8* %20, i8* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @w_quick_sort_string_compare(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %0 to i8**
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8*, i8** %4, i64 %5
%7 = load i8*, i8** %6
%8 = bitcast i8* %2 to i8**
%9 = load i8*, i8** %8
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(1) %9)
ret i32 %10
}
/* Variables and functions */
double strtod(char const *, char **);
double module_libc_strtod(const char *str, char **end) {
  return strtod(str, end);
}


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

x86 assembly (clang, -O2):
<module_libc_strtod>:
jmp    1030 <strtod@plt>

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

LLVM IR (-O2):
define double @module_libc_strtod(i8* %0, i8** nocapture %1) {
%3 = tail call double @strtod(i8* %0, i8** %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ extfunc();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Split Module Table world (9)\n");
  extfunc();
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Hello Split Module Table world (9)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @extfunc()
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello Split Module Table world (9)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @extfunc()
ret i32 0
}
extern void Unix_ioctlNonBlocking(void) {}


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

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

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

LLVM IR (-O2):
define void @Unix_ioctlNonBlocking() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getCycles(unsigned int *, unsigned int *);
unsigned long long getCycles_ll() {
  unsigned int low, high;
  unsigned long long ret;
  getCycles(&low, &high);
  ret = high;
  ret <<= 32;
  ret += low;
  return ret;
}


x86 assembly (clang, -O0):
<getCycles_ll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <getCycles@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCycles_ll>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <getCycles@plt>
mov    (%rsp),%ecx
shl    $0x20,%rcx
mov    0x4(%rsp),%eax
or     %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @getCycles_ll() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = call i32 @getCycles(i32* %1, i32* %2)
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = shl i64 %7, 32
store i64 %8, i64* %3
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = load i64, i64* %3
%12 = add i64 %11, %10
store i64 %12, i64* %3
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @getCycles_ll() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @getCycles(i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = shl nuw i64 %7, 32
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = or i64 %8, %10
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void label_printString(void *e) {
  char *str = e;
  printf("%s", str);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @label_printString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_09uint16_reg(unsigned short val) {
  return ((val) & (0x09 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_09uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 9
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printerr(char *, unsigned char, unsigned char, unsigned char,
                            unsigned char);
int /*<<< orphan*/ split_ip(int, unsigned char *);
void show_ip(int saddr) {
  unsigned char ip[4];
  split_ip(saddr, ip);
  printerr("%d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]);
}


x86 assembly (clang, -O0):
<show_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <split_ip@plt>
mov    -0x8(%rbp),%dl
mov    -0x7(%rbp),%cl
mov    -0x6(%rbp),%al
lea    0xeb9(%rip),%rdi
movzbl %dl,%esi
movzbl %cl,%edx
movzbl %al,%ecx
movzbl -0x5(%rbp),%r8d
call   1030 <printerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_ip>:
push   %rax
lea    0x4(%rsp),%rsi
call   1040 <split_ip@plt>
movzbl 0x4(%rsp),%esi
movzbl 0x5(%rsp),%edx
movzbl 0x6(%rsp),%ecx
movzbl 0x7(%rsp),%r8d
lea    0xeb9(%rip),%rdi
call   1030 <printerr@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d.%d.%d.%d\0A\00"
define void @show_ip(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = call i32 @split_ip(i32 %4, i8* %5)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = load i8, i8* %7
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%10 = load i8, i8* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%12 = load i8, i8* %11
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%14 = load i8, i8* %13
%15 = call i32 @printerr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i8 zeroext %10, i8 zeroext %12, i8 zeroext %14)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d.%d.%d.%d\0A\00"
define void @show_ip(i32 %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @split_ip(i32 %0, i8* %3)
%5 = load i8, i8* %3
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%9 = load i8, i8* %8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%11 = load i8, i8* %10
%12 = call i32 @printerr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 zeroext %5, i8 zeroext %7, i8 zeroext %9, i8 zeroext %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
int called_function(int j) {
  int k;
  __analyzer_eval(j > 4);
  k = j - 1;
  __analyzer_eval(k > 3);
  return k;
}


x86 assembly (clang, -O0):
<called_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<called_function>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x5,%edi
setge  %bpl
mov    %ebp,%edi
call   1030 <__analyzer_eval@plt>
add    $0xffffffff,%ebx
mov    %ebp,%edi
call   1030 <__analyzer_eval@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @called_function(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 4
%6 = zext i1 %5 to i32
%7 = call i32 @__analyzer_eval(i32 %6)
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 3
%12 = zext i1 %11 to i32
%13 = call i32 @__analyzer_eval(i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @called_function(i32 %0) {
%2 = icmp sgt i32 %0, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @__analyzer_eval(i32 %3)
%5 = add nsw i32 %0, -1
%6 = tail call i32 @__analyzer_eval(i32 %3)
ret i32 %5
}
/* Variables and functions */
long binaryToDecimal(int /*<<< orphan*/, int, char *);
scalar_t__ pow(int, int);
long reverseExcess(int size, char binaryIn[size]) {
  long bias = (long)pow(2, size - 1) - 1;
  long num = binaryToDecimal(0, size, binaryIn);
  return num - bias;
}


x86 assembly (clang, -O0):
<reverseExcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <binaryToDecimal@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseExcess>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
lea    -0x1(%rbx),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %rax,%r15
xor    %edi,%edi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <binaryToDecimal@plt>
sub    %r15,%rax
add    $0x1,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @reverseExcess(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i64 @pow(i32 2, i32 %10)
%12 = sub nsw i64 %11, 1
store i64 %12, i64* %5
%13 = load i32, i32* %3
%14 = load i8*, i8** %4
%15 = call i64 @binaryToDecimal(i32 0, i32 %13, i8* %14)
store i64 %15, i64* %6
%16 = load i64, i64* %6
%17 = load i64, i64* %5
%18 = sub nsw i64 %16, %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @reverseExcess(i32 %0, i8* %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i64 @pow(i32 2, i32 %3)
%5 = tail call i64 @binaryToDecimal(i32 0, i32 %0, i8* %1)
%6 = sub i64 1, %4
%7 = add i64 %6, %5
ret i64 %7
}
void foo654(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo654(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
void clntraw_destroy(CLIENT *x) { (void)x; }


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

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

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

LLVM IR (-O2):
define void @clntraw_destroy(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ horswap(int, int);
void spinvertaxis() {
  int i, j;
  for (i = 0; i < 4; ++i) {
    for (j = 0; j < 4 / 2; ++j) {
      horswap(i, j);
    }
  }
}


x86 assembly (clang, -O0):
<spinvertaxis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1166 <spinvertaxis+0x56>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1153 <spinvertaxis+0x43>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <horswap@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <spinvertaxis+0x20>
jmp    1158 <spinvertaxis+0x48>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <spinvertaxis+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spinvertaxis>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <horswap@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <horswap@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <horswap@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <horswap@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <horswap@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <horswap@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <horswap@plt>
mov    $0x3,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <horswap@plt>

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

LLVM IR (-O2):
define void @spinvertaxis() {
%1 = tail call i32 @horswap(i32 0, i32 0)
%2 = tail call i32 @horswap(i32 0, i32 1)
%3 = tail call i32 @horswap(i32 1, i32 0)
%4 = tail call i32 @horswap(i32 1, i32 1)
%5 = tail call i32 @horswap(i32 2, i32 0)
%6 = tail call i32 @horswap(i32 2, i32 1)
%7 = tail call i32 @horswap(i32 3, i32 0)
%8 = tail call i32 @horswap(i32 3, i32 1)
ret void
}
/* Variables and functions */
int add_c_escaped_char(char, char **, char *);
int add_named_escape(char, char **, char *);
bool add_c_string_escaped_char(char ch, char **buffer, char *buffer_end) {
  if (ch == '"') {
    return add_named_escape('"', buffer, buffer_end);
  } else {
    return add_c_escaped_char(ch, buffer, buffer_end);
  }
}


x86 assembly (clang, -O0):
<add_c_string_escaped_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x22,%eax
jne    115d <add_c_string_escaped_char+0x3d>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x22,%edi
call   1030 <add_named_escape@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <add_c_string_escaped_char+0x53>
mov    -0x5(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsbl %al,%edi
call   1040 <add_c_escaped_char@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_c_string_escaped_char>:
cmp    $0x22,%dil
jne    1130 <add_c_string_escaped_char+0x10>
mov    $0x22,%edi
jmp    1030 <add_named_escape@plt>
movsbl %dil,%edi
jmp    1040 <add_c_escaped_char@plt>

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

LLVM IR (-O2):
define i32 @add_c_string_escaped_char(i8 signext %0, i8** %1, i8* %2) {
%4 = icmp eq i8 %0, 34
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @add_named_escape(i8 signext 34, i8** %1, i8* %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @add_c_escaped_char(i8 signext %0, i8** %1, i8* %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
void foo_2_2_2_2_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_1_2_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int current = 1;
  int totalPrimes = 0;
  int threshold = 1000000;
  while (1) {
#pragma omp parallel for schedule(dynamic) reduction(+ : totalPrimes)
    for (current = 1; current <= threshold; current++) {
      int i = 2;
      while (i <= current) {
        if (current % i == 0)
          break;
        i++;
      }
      if (i == current)
        totalPrimes++;
    }
  }
  printf("%d prime numbers under %d\n", totalPrimes, threshold);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xf4240,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1191 <main+0x91>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1169 <main+0x69>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    115b <main+0x5b>
jmp    1169 <main+0x69>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <main+0x3a>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    117e <main+0x7e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1183 <main+0x83>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <main+0x27>
jmp    1120 <main+0x20>

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int qe_inrange(int c, int a, int b) { return c >= a && c <= b; }


x86 assembly (clang, -O0):
<qe_inrange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     112a <qe_inrange+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qe_inrange>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @qe_inrange(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int pathconN_nm5_f0(double const **, double **, int *, double *, int);
int pathconN_nm5(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return pathconN_nm5_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<pathconN_nm5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <pathconN_nm5_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm5>:
jmp    1030 <pathconN_nm5_f0@plt>

LLVM IR (-O0):
define i32 @pathconN_nm5(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @pathconN_nm5_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @pathconN_nm5(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @pathconN_nm5_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int slice_from_s(struct SN_env *, int /*<<< orphan*/, int /*<<< orphan*/);
extern int slice_del(struct SN_env *z) { return slice_from_s(z, 0, 0); }


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

x86 assembly (clang, -O2):
<slice_del>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <slice_from_s@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define i32 @slice_del(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @slice_from_s(%struct.SN_env* %3, i32 0, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define i32 @slice_del(%struct.SN_env* %0) {
%2 = tail call i32 @slice_from_s(%struct.SN_env* %0, i32 0, i32 0)
ret i32 %2
}
unsigned int bm_rgb(unsigned char R, unsigned char G, unsigned char B) {
  return 0xFF000000 | ((R) << 16) | ((G) << 8) | (B);
}


x86 assembly (clang, -O0):
<bm_rgb>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x10,%eax
or     $0xff000000,%eax
movzbl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x3(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm_rgb>:
shl    $0x10,%edi
shl    $0x8,%esi
or     %edi,%esi
lea    (%rdx,%rsi,1),%eax
add    $0xff000000,%eax
ret

LLVM IR (-O0):
define i32 @bm_rgb(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 16
%10 = or i32 -16777216, %9
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %10, %13
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @bm_rgb(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %0 to i32
%5 = shl nuw nsw i32 %4, 16
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %5
%9 = zext i8 %2 to i32
%10 = or i32 %8, %9
%11 = or i32 %10, -16777216
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void switch_s1_left(const uint32_t repeat_count) { (void)repeat_count; }


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

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

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

LLVM IR (-O2):
define void @switch_s1_left(i32 %0) {
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int x, y, sum;
  printf("Enter the values for A & B: ");
  scanf("%d %d", &x, &y);
  sum = add(x, y);
  printf("%d", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <add@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <add@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter the values for A & B: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @add(i32 %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter the values for A & B: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @add(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
int picolHash(char *key, int modul) {
  char *cp;
  int hash = 0;
  for (cp = key; *cp; cp++)
    hash = (hash << 1) ^ *cp;
  return hash % modul;
}


x86 assembly (clang, -O0):
<picolHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <picolHash+0x4a>
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <picolHash+0x1a>
mov    -0x1c(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<picolHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <picolHash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    %eax,%eax
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <picolHash+0x10>
jmp    1126 <picolHash+0x26>
xor    %eax,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @picolHash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = shl i32 %7, 1
%10 = sext i8 %6 to i32
%11 = xor i32 %9, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = srem i32 %16, %1
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr)
    return ptr;
  fprintf(stderr, "out of memory\n");
  exit(1);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <xmalloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
int cmp(const void *a, const void *b) {
  int x = *(int *)a, y = *(int *)b;
  if (x > y)
    return 1;
  if (x < y)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <cmp+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <cmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    114e <cmp+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M321_f(char *s) {
  debug("M321_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M321_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M321_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M321_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M321_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M321_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M321_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
__attribute__((weak, section(".after_vectors"))) void HardFault_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define weak void @HardFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @HardFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
const char *stringprep_locale_charset() { return "ASCII"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"ASCII\00"
define i8* @stringprep_locale_charset() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int is_highmem(struct zone *zone) { return 0; }


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

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

LLVM IR (-O0):
%struct.zone = type opaque
define i32 @is_highmem(%struct.zone* %0) {
%2 = alloca %struct.zone*
store %struct.zone* %0, %struct.zone** %2
ret i32 0
}

LLVM IR (-O2):
%struct.zone = type opaque
define i32 @is_highmem(%struct.zone* nocapture readnone %0) {
ret i32 0
}
void U_EMRSETMETARGN_print(const char *contents) { (void)(contents); }


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

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

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

LLVM IR (-O2):
define void @U_EMRSETMETARGN_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void print_ptr(void **p) {
  printf("%p\n", p);
  printf("%p\n", (void *)*p);
}


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

x86 assembly (clang, -O2):
<print_ptr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%rbx),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
define void @print_ptr(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = bitcast i8** %3 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define void @print_ptr(i8** %0) {
%2 = bitcast i8** %0 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8*, i8** %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}