xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x21() {
  Assert_real((isalnum(33) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              170, ("isalnum should be 0 for !"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x21>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xaa,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x21>:
push   %rax
mov    $0x21,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xaa,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for !\00"
define void @t_isalnum_0x21() {
%1 = call i64 @isalnum(i32 33)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for !\00"
define void @t_isalnum_0x21() {
%1 = tail call i64 @isalnum(i32 33)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int munmap(void *, size_t);
int /*<<< orphan*/ perror(char *);
bool shmem_unmap(void *mem, size_t size) {
  if (munmap(mem, size) == -1) {
    perror("munmap");
    return (false);
  }
  return (true);
}


x86 assembly (clang, -O0):
<shmem_unmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <munmap@plt>
cmp    $0xffffffff,%eax
jne    115e <shmem_unmap+0x3e>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1165 <shmem_unmap+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_unmap>:
push   %rax
call   1030 <munmap@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1134 <shmem_unmap+0x14>
pop    %rcx
ret
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"munmap\00"
define i32 @shmem_unmap(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
scalar_t__ seteuid(int /*<<< orphan*/);
scalar_t__ setuid(int /*<<< orphan*/);
int Privsep_SetUser(uid_t uid) {
  if (setuid(uid) < 0)
    return (-1);
  if (seteuid(uid) < 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<Privsep_SetUser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <setuid@plt>
cmp    $0x0,%rax
jge    1149 <Privsep_SetUser+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <Privsep_SetUser+0x4e>
mov    -0x8(%rbp),%edi
call   1040 <seteuid@plt>
cmp    $0x0,%rax
jge    1167 <Privsep_SetUser+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <Privsep_SetUser+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Privsep_SetUser>:
push   %rbx
mov    %edi,%ebx
call   1030 <setuid@plt>
test   %rax,%rax
js     113a <Privsep_SetUser+0x1a>
mov    %ebx,%edi
call   1040 <seteuid@plt>
sar    $0x3f,%rax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Privsep_SetUser(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @setuid(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i64 @seteuid(i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @Privsep_SetUser(i32 %0) {
%2 = tail call i64 @setuid(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @seteuid(i32 %0)
%6 = ashr i64 %5, 63
%7 = trunc i64 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
void rop3_182_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = *D & T;
  stk3 = S | stk4;
  stk2 = T ^ stk3;
  stk1 = *D ^ stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_182_0_0>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %dl,%cl
or     %sil,%cl
xor    %dl,%al
xor    %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_182_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %4, %2
%8 = xor i8 %7, %6
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int len = 0;
  printf("Enter a message: ");
  while (getchar() != '\n')
    len++;
  printf("Your message was %d character(s) long.\n", len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1165 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%al
jne    1140 <main+0x20>
lea    0xebd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a message: \00"
@.str.1 = [40 x i8] c"Your message was %d character(s) long.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %8, %0
%5 = call signext i8 (...) @getchar()
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter a message: \00"
@.str.1 = [40 x i8] c"Your message was %d character(s) long.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
void mutex_trylock(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<mutex_trylock>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_trylock>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.mutex_trylock = [14 x i8] c"mutex_trylock\00"
define void @mutex_trylock() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.mutex_trylock, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.mutex_trylock = [14 x i8] c"mutex_trylock\00"
define void @mutex_trylock() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.mutex_trylock, i64 0, i64 0))
ret void
}
/* Variables and functions */
int xbp_rmdir(char const *);
int __wrap_rmdir(const char *dirname) { return xbp_rmdir(dirname); }


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

x86 assembly (clang, -O2):
<__wrap_rmdir>:
jmp    1030 <xbp_rmdir@plt>

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

LLVM IR (-O2):
define i32 @__wrap_rmdir(i8* %0) {
%2 = tail call i32 @xbp_rmdir(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ read_word_data(int, int);
uint16_t io_get_bus_polarity() { return read_word_data(0x20, 0x02); }


x86 assembly (clang, -O0):
<io_get_bus_polarity>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x2,%esi
call   1030 <read_word_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_get_bus_polarity>:
mov    $0x20,%edi
mov    $0x2,%esi
jmp    1030 <read_word_data@plt>

LLVM IR (-O0):
define i32 @io_get_bus_polarity() {
%1 = call i32 @read_word_data(i32 32, i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @io_get_bus_polarity() {
%1 = tail call i32 @read_word_data(i32 32, i32 2)
ret i32 %1
}
func() { func(); }


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

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

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

LLVM IR (-O2):
define i32 @func() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", argc - 1);
  return EXIT_SUCCESS;
}


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)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
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 = sub nsw i32 %6, 1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
scalar_t__ test0();
scalar_t__ test1(int /*<<< orphan*/);
int main() { return test0() && test1(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test0@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1159 <main+0x39>
xor    %edi,%edi
call   1030 <test1@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test0@plt>
test   %rax,%rax
je     113e <main+0x1e>
xor    %edi,%edi
call   1030 <test1@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test0()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 @test1(i32 0)
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ false, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test0()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @test1(i32 0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int seccomp_sandbox_filter_init();
int seccomp_sandbox_strict_init();
int SBCELT_EnterSandbox(int mode) {
  switch (mode) {
  case 0:
    return 0;
  case 1:
    return seccomp_sandbox_strict_init();
  case 2:
    return seccomp_sandbox_filter_init();
  }
  return -1;
}


x86 assembly (clang, -O0):
<SBCELT_EnterSandbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1160 <SBCELT_EnterSandbox+0x40>
jmp    113e <SBCELT_EnterSandbox+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     116c <SBCELT_EnterSandbox+0x4c>
jmp    114f <SBCELT_EnterSandbox+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     117b <SBCELT_EnterSandbox+0x5b>
jmp    118a <SBCELT_EnterSandbox+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1191 <SBCELT_EnterSandbox+0x71>
mov    $0x0,%al
call   1040 <seccomp_sandbox_strict_init@plt>
mov    %eax,-0x4(%rbp)
jmp    1191 <SBCELT_EnterSandbox+0x71>
mov    $0x0,%al
call   1030 <seccomp_sandbox_filter_init@plt>
mov    %eax,-0x4(%rbp)
jmp    1191 <SBCELT_EnterSandbox+0x71>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SBCELT_EnterSandbox>:
test   %edi,%edi
je     1141 <SBCELT_EnterSandbox+0x21>
cmp    $0x2,%edi
je     1135 <SBCELT_EnterSandbox+0x15>
cmp    $0x1,%edi
jne    113c <SBCELT_EnterSandbox+0x1c>
xor    %eax,%eax
jmp    1040 <seccomp_sandbox_strict_init@plt>
xor    %eax,%eax
jmp    1030 <seccomp_sandbox_filter_init@plt>
mov    $0xffffffff,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @SBCELT_EnterSandbox(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 0, label %5
i32 1, label %6
i32 2, label %8
]
5: ; preds = %1
store i32 0, i32* %2
br label %11
6: ; preds = %1
%7 = call i32 (...) @seccomp_sandbox_strict_init()
store i32 %7, i32* %2
br label %11
8: ; preds = %1
%9 = call i32 (...) @seccomp_sandbox_filter_init()
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %8, %6, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @SBCELT_EnterSandbox(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %7
i32 1, label %2
i32 2, label %4
]
2: ; preds = %1
%3 = tail call i32 (...) @seccomp_sandbox_strict_init()
br label %7
4: ; preds = %1
%5 = tail call i32 (...) @seccomp_sandbox_filter_init()
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %4, %2
%8 = phi i32 [ -1, %6 ], [ %5, %4 ], [ %3, %2 ], [ %0, %1 ]
ret i32 %8
}
unsigned square_int(unsigned a) { return a * a; }


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

x86 assembly (clang, -O2):
<square_int>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @square_int(i32 %0) {
%2 = mul i32 %0, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __sfeof(int /*<<< orphan*/ *);
int feof(FILE *fp) { return (__sfeof(fp)); }


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

x86 assembly (clang, -O2):
<feof>:
jmp    1030 <__sfeof@plt>

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

LLVM IR (-O2):
define i32 @feof(i32* %0) {
%2 = tail call i32 @__sfeof(i32* %0)
ret i32 %2
}
int lockd_start_wait(struct cmd_context *cmd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cmd_context = type opaque
define i32 @lockd_start_wait(%struct.cmd_context* nocapture readnone %0) {
ret i32 0
}
int gui_color_get_weechat_colors_number() { return 17; }


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

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

LLVM IR (-O0):
define i32 @gui_color_get_weechat_colors_number() {
ret i32 17
}

LLVM IR (-O2):
define i32 @gui_color_get_weechat_colors_number() {
ret i32 17
}
void print_ind(const int *inds, int np) {
  int i;
  ;
  for (i = 0; i < np; i++) {
    ;
  };
}


x86 assembly (clang, -O0):
<print_ind>:
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    1131 <print_ind+0x31>
jmp    1123 <print_ind+0x23>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <print_ind+0x12>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_ind(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 = %11, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %6
br label %11
11: ; preds = %10
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
br label %6
14: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print_ind(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_set_credentials() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_call_set_credentials>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_set_credentials() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_set_credentials() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ out;

/* Variables and functions */
uint64_t TO_LE64(uint64_t in) {
  uint64_t out = 0;
  unsigned char *pout = (unsigned char *)&out;
  int i;
  for (i = 0; i < sizeof(out); ++i, in >>= 8)
    pout[i] = in & 0xff;
  return out;
}


x86 assembly (clang, -O0):
<TO_LE64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x4,%rax
jae    1157 <TO_LE64+0x57>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    111d <TO_LE64+0x1d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TO_LE64>:
mov    %edi,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ XcmBigEndian();
int /*<<< orphan*/ XcmValueUInt32Swap(int /*<<< orphan*/);
uint32_t XcmValueUInt32(uint32_t val) {
  if (!XcmBigEndian())
    val = XcmValueUInt32Swap(val);
  return val;
}


x86 assembly (clang, -O0):
<XcmValueUInt32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <XcmBigEndian@plt>
cmp    $0x0,%eax
jne    1146 <XcmValueUInt32+0x26>
mov    -0x4(%rbp),%edi
call   1030 <XcmValueUInt32Swap@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XcmValueUInt32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <XcmBigEndian@plt>
test   %eax,%eax
je     1132 <XcmValueUInt32+0x12>
mov    %ebx,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <XcmValueUInt32Swap@plt>

LLVM IR (-O0):
define i32 @XcmValueUInt32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @XcmBigEndian()
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @XcmValueUInt32Swap(i32 %6)
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @XcmValueUInt32(i32 %0) {
%2 = tail call i32 (...) @XcmBigEndian()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @XcmValueUInt32Swap(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %0, %1 ], [ %5, %4 ]
ret i32 %7
}
void codegen_flush() { return; }


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

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

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

LLVM IR (-O2):
define void @codegen_flush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendByte(int);
int /*<<< orphan*/ sendMesg(char *);
int /*<<< orphan*/ servo_list_in_hex(char *);
void send_servo_list() {
  char list[200];
  servo_list_in_hex(list);
  sendByte('!');
  sendMesg(list);
  sendByte(13);
  sendByte(10);
}


x86 assembly (clang, -O0):
<send_servo_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    -0xd0(%rbp),%rdi
call   1030 <servo_list_in_hex@plt>
mov    $0x21,%edi
call   1050 <sendByte@plt>
lea    -0xd0(%rbp),%rdi
call   1040 <sendMesg@plt>
mov    $0xd,%edi
call   1050 <sendByte@plt>
mov    $0xa,%edi
call   1050 <sendByte@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_servo_list>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <servo_list_in_hex@plt>
mov    $0x21,%edi
call   1050 <sendByte@plt>
mov    %rbx,%rdi
call   1040 <sendMesg@plt>
mov    $0xd,%edi
call   1050 <sendByte@plt>
mov    $0xa,%edi
call   1050 <sendByte@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @send_servo_list() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @servo_list_in_hex(i8* %2)
%4 = call i32 @sendByte(i32 33)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%6 = call i32 @sendMesg(i8* %5)
%7 = call i32 @sendByte(i32 13)
%8 = call i32 @sendByte(i32 10)
ret void
}

LLVM IR (-O2):
define void @send_servo_list() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @servo_list_in_hex(i8* %2)
%4 = call i32 @sendByte(i32 33)
%5 = call i32 @sendMesg(i8* %2)
%6 = call i32 @sendByte(i32 13)
%7 = call i32 @sendByte(i32 10)
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *get_prgname(const char *argv0) {
  const char *prgname;
  if (argv0) {
    prgname = strrchr(argv0, '/');
    if (!prgname) {
      prgname = argv0;
    } else {
      prgname++;
    }
  } else {
    prgname = "";
  }
  return prgname;
}


x86 assembly (clang, -O0):
<get_prgname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1162 <get_prgname+0x52>
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <get_prgname+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    115d <get_prgname+0x4d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    116d <get_prgname+0x5d>
lea    0xe97(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_prgname>:
test   %rdi,%rdi
je     1133 <get_prgname+0x23>
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_prgname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i8* @strrchr(i8* %7, i8 signext 47)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = load i8*, i8** %2
store i8* %12, i8** %3
br label %16
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %16
16: ; preds = %13, %11
br label %18
17: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %18
18: ; preds = %17, %16
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_prgname(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
br label %8
8: ; preds = %3, %1
%9 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ], [ %7, %3 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(void *, int, int, int /*<<< orphan*/ *);
void dump_buffer_file(void *buf, int buf_size, FILE *ofh) {
  fwrite(buf, sizeof *buf, buf_size, ofh);
}


x86 assembly (clang, -O0):
<dump_buffer_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_buffer_file>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define void @dump_buffer_file(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
void main() {
  int a, b;
  while (scanf("%d %d", &a, &b) == 2) {
    printf("%d\n", (a + b));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    115c <main+0x3c>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1128 <main+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1182 <main+0x62>
lea    0xebe(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%esi
add    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1160 <main+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = icmp eq i32 %12, 2
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ validate_gen_ex(int /*<<< orphan*/ const,
                                   int /*<<< orphan*/ const, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/ *);
void validate_gen(const uint32_t src, const uint32_t dst, uint8_t output[16]) {
  validate_gen_ex(src, dst, 0, 0, output);
}


x86 assembly (clang, -O0):
<validate_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%r8
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <validate_gen_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_gen>:
mov    %rdx,%r8
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <validate_gen_ex@plt>

LLVM IR (-O0):
define void @validate_gen(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 = load i32*, i32** %6
%10 = call i32 @validate_gen_ex(i32 %7, i32 %8, i32 0, i32 0, i32* %9)
ret void
}

LLVM IR (-O2):
define void @validate_gen(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @validate_gen_ex(i32 %0, i32 %1, i32 0, i32 0, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_write(int, unsigned short, char *);
void outw(unsigned short int value, unsigned short int port) {
  check_write((int)port, value, "outw");
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%edi
lea    0xecf(%rip),%rdx
movzwl -0x2(%rbp),%esi
call   1030 <check_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %edi,%eax
lea    0xee7(%rip),%rdx
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <check_write@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"outw\00"
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = load i16, i16* %3
%8 = call i32 @check_write(i32 %6, i16 zeroext %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"outw\00"
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = tail call i32 @check_write(i32 %3, i16 zeroext %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
char *strCat(char *dest, const char *src) {
  char *destStart = dest;
  while (*dest)
    dest++;
  while ((*dest++ = *src++))
    ;
  return destStart;
}


x86 assembly (clang, -O0):
<strCat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strCat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strCat+0x14>
jmp    1137 <strCat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strCat+0x66>
jmp    1137 <strCat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strCat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strCat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strCat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_clk_radio() {
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (14 << 9) | (14 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (14 << 9) | (14 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (2 << 9) | (3 << 5) | (1)));
  delay(100);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_clk_radio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc461,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_clk_radio>:
push   %rax
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc461,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_clk_radio() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56769)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56769)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50273)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_clk_radio() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56769)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56769)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50273)
%6 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int strlen(char *);
char *gen_cond_goto(char *label, char *expr) {
  char *result =
      (char *)malloc((strlen(label) + strlen(expr) + 16) * (sizeof(char)));
  sprintf(result, "\tif ( %s ) GOTO %s\n", expr, label);
  return result;
}


x86 assembly (clang, -O0):
<gen_cond_goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x10,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe7d(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_cond_goto>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r12,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\09if ( %s ) GOTO %s\0A\00"
define i8* @gen_cond_goto(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %7, %9
%11 = add nsw i32 %10, 16
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = load i8*, i8** %3
%20 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [20 x i8] c"\09if ( %s ) GOTO %s\0A\00"
define i8* @gen_cond_goto(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 16
%6 = add i32 %5, %4
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret i8* %8
}
/* Variables and functions */
int memcmp(unsigned char const *, unsigned char const *, int);
void cryp_hash_cmp(int *ret, unsigned char const *h1, unsigned char const *h2) {
  *ret = memcmp(h1, h2, 32);
}


x86 assembly (clang, -O0):
<cryp_hash_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcmp@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cryp_hash_cmp>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x20,%edx
call   1030 <memcmp@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cryp_hash_cmp(i32* nocapture writeonly %0, i8* %1, i8* %2) {
%4 = tail call i32 @memcmp(i8* %1, i8* %2, i32 32)
store i32 %4, i32* %0
ret void
}
int test_imm_FDint32_mem(int *val) {
  return ((*val) & (0xFD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FDint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 253
%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_FDint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 253
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bef_push(int);
int ins_nm3() {
  bef_push(3);
  return 1;
}


x86 assembly (clang, -O0):
<ins_nm3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <bef_push@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ins_nm3>:
push   %rax
mov    $0x3,%edi
call   1030 <bef_push@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ins_nm3() {
%1 = call i32 @bef_push(i32 3)
ret i32 1
}

LLVM IR (-O2):
define i32 @ins_nm3() {
%1 = tail call i32 @bef_push(i32 3)
ret i32 1
}
long int cast_int_long(int x) { return (long int)x; }


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

x86 assembly (clang, -O2):
<cast_int_long>:
movslq %edi,%rax
ret

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

LLVM IR (-O2):
define i64 @cast_int_long(i32 %0) {
%2 = sext i32 %0 to i64
ret i64 %2
}