xunge/DecIR huggingface dataset:
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, int);
void forf_proc_ge(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, b >= a);
}


x86 assembly (clang, -O0):
<forf_proc_ge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setge  %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <forf_push_num@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forf_proc_ge>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <forf_pop_num@plt>
xor    %esi,%esi
cmp    %r14,%rax
setge  %sil
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_ge(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = icmp sge i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @forf_push_num(%struct.forf_env* %9, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_ge(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = icmp sge i64 %3, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @forf_push_num(%struct.forf_env* %0, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint32_t __byte_clone_array(const uint8_t *p, uint8_t *q, uint32_t elements) {
  uint32_t n = elements * sizeof(uint8_t);
  memcpy(q, p, n);
  return n;
}


x86 assembly (clang, -O0):
<__byte_clone_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byte_clone_array>:
push   %rbx
mov    %rdi,%rax
lea    0x0(,%rdx,4),%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__byte_clone_array(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load i32*, i32** %5
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = call i32 @memcpy(i32* %12, i32* %13, i32 %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @__byte_clone_array(i32* %0, i32* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i32* %1, i32* %0, i32 %4)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ calculate_output(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  while (1) {
    int input;
    scanf("%d", &input);
    if ((input != 1) && (input != 2))
      return -2;
    calculate_output(input);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
je     115e <main+0x3e>
cmpl   $0x2,-0x8(%rbp)
je     115e <main+0x3e>
mov    $0xfffffffe,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%edi
call   1030 <calculate_output@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
lea    -0x3(%rdi),%eax
cmp    $0xfffffffe,%eax
jb     116c <main+0x4c>
lea    0xeb8(%rip),%r14
lea    0x4(%rsp),%rbx
nopl   (%rax)
call   1030 <calculate_output@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
lea    -0x3(%rdi),%eax
cmp    $0xfffffffd,%eax
ja     1150 <main+0x30>
mov    $0xfffffffe,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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


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

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

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

LLVM IR (-O2):
define void @ft_print_combn(i32 %0) {
ret void
}
__attribute__((noreturn)) void hp3(void) { __builtin_unreachable(); }


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @hp3() {
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo) {
  (void)signo;
  printf("In handler\n");
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"In handler\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int);
void test3(int c) {
  isdigit(c);
  isdigit(10);
  isdigit(-10);
}


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

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

LLVM IR (-O0):
define void @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isdigit(i32 %3)
%5 = call i32 @isdigit(i32 10)
%6 = call i32 @isdigit(i32 -10)
ret void
}

LLVM IR (-O2):
define void @test3(i32 %0) {
ret void
}
int LowestBitIndex(unsigned x) { return __builtin_ffs(x) - 1; }


x86 assembly (clang, -O0):
<LowestBitIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
bsf    %edx,%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowestBitIndex>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @LowestBitIndex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = add i32 %4, 1
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %5
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @LowestBitIndex(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 -1, i32 %2
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, void *, int);
char *encode16(char *buf, uint16_t data) {
  uint16_t ndata = htons(data);
  memcpy(buf, (void *)(&ndata), sizeof(uint16_t));
  return buf + sizeof(uint16_t);
}


x86 assembly (clang, -O0):
<encode16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @encode16(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htons(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %0, i8* %4, i32 4)
%7 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %7
}
void swap_store(long long *a, long long b) { *a = __builtin_bswap64(b); }


x86 assembly (clang, -O0):
<swap_store>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
bswap  %rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_store>:
bswap  %rsi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @swap_store(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 @llvm.bswap.i64(i64 %5)
%7 = load i64*, i64** %3
store i64 %6, i64* %7
ret void
}

LLVM IR (-O2):
define void @swap_store(i64* nocapture writeonly %0, i64 %1) {
%3 = tail call i64 @llvm.bswap.i64(i64 %1)
store i64 %3, i64* %0
ret void
}
void RTAvlroGCPtrRangeGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPtrRangeGet() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void ten_ms_sleep(int times) {
  int i;
  struct timespec ts;
  ts.tv_sec = 0;
  ts.tv_nsec = 10000000;
  for (i = 0; i < times; i++) {
    nanosleep(&ts, NULL);
  }
}


x86 assembly (clang, -O0):
<ten_ms_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x989680,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <ten_ms_sleep+0x48>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <ten_ms_sleep+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ten_ms_sleep>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x989680,0x8(%rsp)
test   %edi,%edi
jle    114f <ten_ms_sleep+0x3f>
mov    %edi,%ebx
lea    0x8(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0xffffffff,%ebx
jne    1140 <ten_ms_sleep+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @ten_ms_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 10000000, i32* %6
store i32 0, i32* %3
br label %7
7: ; preds = %13, %1
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = call i32 @nanosleep(%struct.timespec* %4, i32* null)
br label %13
13: ; preds = %11
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @ten_ms_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 10000000, i32* %5
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ 0, %1 ]
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %7
12: ; preds = %7, %1
ret void
}
unsigned xrop3_220_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T & stk3;
  stk1 = S | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_220_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_220_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void loop2(void) {
  int x = 0;
  while (x < 10) {
    printf("%d\n", x);
    x++;
  }
}


x86 assembly (clang, -O0):
<loop2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1146 <loop2+0x36>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <loop2+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @loop2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
ret void
}
void clearMemory(unsigned char *mem, unsigned char val, unsigned int size) {
  while (size > 0) {
    size--;
    *(mem++) = val;
  }
}


x86 assembly (clang, -O0):
<clearMemory>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jbe    113d <clearMemory+0x3d>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1111 <clearMemory+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearMemory>:
test   %edx,%edx
je     1124 <clearMemory+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @clearMemory(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %10, %3
%8 = load i32, i32* %6
%9 = icmp ugt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = add i32 %11, -1
store i32 %12, i32* %6
%13 = load i8, i8* %5
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
store i8 %13, i8* %14
br label %7
16: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @clearMemory(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
main(b) {
  for (; ~scanf("%d", &b); printf("%d ", -b * ~b / 2))
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     1180 <main+0x60>
jmp    1155 <main+0x35>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1132 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
je     118f <main+0x6f>
lea    0xeb7(%rip),%r14
lea    0xead(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
imul   %eax,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
add    %ecx,%esi
sar    %esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0xffffffff,%eax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = load i32, i32* %2
%7 = add i32 %6, 1
%8 = mul i32 %7, %6
%9 = sdiv i32 %8, 2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
int power(int, int);
int deepth(int n) {
  int i;
  for (i = 1;; ++i)
    if (n <= power(2, i) - 1)
      return i;
}


x86 assembly (clang, -O0):
<deepth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1030 <power@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     114e <deepth+0x3e>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1153 <deepth+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <deepth+0x12>

x86 assembly (clang, -O2):
<deepth>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <power@plt>
cmp    %ebp,%eax
jle    1120 <deepth+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @deepth(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @power(i32 2, i32 %6)
%8 = sub nsw i32 %7, 1
%9 = icmp sle i32 %5, %8
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = load i32, i32* %3
ret i32 %11
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
}

LLVM IR (-O2):
define i32 @deepth(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = tail call i32 @power(i32 2, i32 %3)
%5 = icmp sgt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ trap_MemFree(void *, char *, int);
void G_GS_Free(void *data) {
  trap_MemFree(data,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/"
               "heads/master/game/g_main.c",
               179);
}


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

x86 assembly (clang, -O2):
<G_GS_Free>:
lea    0xee9(%rip),%rsi
mov    $0xb3,%edx
jmp    1030 <trap_MemFree@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/game/g_main.c\00"
define void @G_GS_Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @trap_MemFree(i8* %3, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 179)
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/game/g_main.c\00"
define void @G_GS_Free(i8* %0) {
%2 = tail call i32 @trap_MemFree(i8* %0, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 179)
ret void
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("\n%d", &number);
  printf("\n%d", exact_square(number));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <exact_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_architecture(void) { printf("MIPS64"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"MIPS64\00"
define void @get_architecture() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, double, int);
int main() {
  float a = 0.002;
  double b = 0.1f;
  int c = 10.002;
  printf("%g %g %d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x14(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%g %g %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float 0x3F60624DE0000000, double 0x3FB99999A0000000, i32 10)
ret i32 0
}
int min(int a, int b) {
  if (a <= b)
    return (a);
  else
    return (b);
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RSA_free(void *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ log_error(char *, int);
void key_free(int type, int private, void *key) {
  switch (type) {
  case 1:
    free(key);
    break;
  case 2:
    RSA_free(key);
    break;
  case 0:
  default:
    log_error("key_free: unknown/unsupportedkey type %d", type);
    break;
  }
}


x86 assembly (clang, -O0):
<key_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1193 <key_free+0x63>
jmp    1155 <key_free+0x25>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
je     1177 <key_free+0x47>
jmp    1166 <key_free+0x36>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1185 <key_free+0x55>
jmp    1198 <key_free+0x68>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    11a7 <key_free+0x77>
mov    -0x10(%rbp),%rdi
call   1050 <RSA_free@plt>
jmp    11a7 <key_free+0x77>
jmp    1198 <key_free+0x68>
mov    -0x4(%rbp),%esi
lea    0xe5e(%rip),%rdi
call   1040 <log_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_free>:
cmp    $0x2,%edi
je     1144 <key_free+0x14>
mov    %edi,%esi
cmp    $0x1,%edi
jne    114c <key_free+0x1c>
mov    %rdx,%rdi
jmp    1030 <free@plt>
mov    %rdx,%rdi
jmp    1050 <RSA_free@plt>
lea    0xead(%rip),%rdi
jmp    1040 <log_error@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"key_free: unknown/unsupportedkey type %d\00"
define void @key_free(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
switch i32 %7, label %15 [
i32 1, label %8
i32 2, label %11
i32 0, label %14
]
8: ; preds = %3
%9 = load i8*, i8** %6
%10 = call i32 @free(i8* %9)
br label %18
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = call i32 @RSA_free(i8* %12)
br label %18
14: ; preds = %3
br label %15
15: ; preds = %3, %14
%16 = load i32, i32* %4
%17 = call i32 @log_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %11, %8
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"key_free: unknown/unsupportedkey type %d\00"
define void @key_free(i32 %0, i32 %1, i8* %2) {
switch i32 %0, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %3
%5 = tail call i32 @free(i8* %2)
br label %10
6: ; preds = %3
%7 = tail call i32 @RSA_free(i8* %2)
br label %10
8: ; preds = %3
%9 = tail call i32 @log_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
10: ; preds = %8, %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getQueryInputExt(int);
void getQueryInput() { getQueryInputExt(1); }


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

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

LLVM IR (-O0):
define void @getQueryInput() {
%1 = call i32 @getQueryInputExt(i32 1)
ret void
}

LLVM IR (-O2):
define void @getQueryInput() {
%1 = tail call i32 @getQueryInputExt(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ get_executable_path(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char path[PATH_MAX];
  get_executable_path(path, sizeof(path));
  printf("this program is in: %s\n", path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    %eax,%esi
call   1040 <get_executable_path@plt>
mov    -0x28(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <get_executable_path@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [24 x i8] c"this program is in: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @PATH_MAX
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i8, i64 %9
store i64 %9, i64* %7
%12 = trunc i64 %9 to i32
%13 = call i32 @get_executable_path(i8* %11, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 0, i32* %3
%15 = load i8*, i8** %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [24 x i8] c"this program is in: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @get_executable_path(i8* %5, i32 %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
unsigned long WaitKey264();
unsigned long waitkey() { return WaitKey264(); }


x86 assembly (clang, -O0):
<waitkey>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <WaitKey264@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @waitkey() {
%1 = call i64 (...) @WaitKey264()
ret i64 %1
}

LLVM IR (-O2):
define i64 @waitkey() {
%1 = tail call i64 (...) @WaitKey264()
ret i64 %1
}
void closelog_r(struct syslog_data *data) {}


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

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

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

LLVM IR (-O2):
%struct.syslog_data = type opaque
define void @closelog_r(%struct.syslog_data* nocapture %0) {
ret void
}
int atomicCompareAndSwap(volatile int *i, int before, int after) {
  return __sync_bool_compare_and_swap(i, before, after);
}


x86 assembly (clang, -O0):
<atomicCompareAndSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomicCompareAndSwap>:
mov    %esi,%eax
xor    %ecx,%ecx
lock cmpxchg %edx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atomicCompareAndSwap(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 = cmpxchg i32* %7, i32 %8, i32 %9 seq_cst seq_cst
%11 = extractvalue { i32, i1 } %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @atomicCompareAndSwap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = cmpxchg i32* %0, i32 %1, i32 %2 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
long do_ext(int *p, long a, long b) {
  long l = *p;
  long l2 = l << 4;
  return ((l2 == 0) ? a : b);
}


x86 assembly (clang, -O0):
<do_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    113f <do_ext+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1147 <do_ext+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ext>:
mov    %rsi,%rax
cmpl   $0x0,(%rdi)
cmovne %rdx,%rax
ret

LLVM IR (-O0):
define i64 @do_ext(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = shl i64 %12, 4
store i64 %13, i64* %8
%14 = load i64, i64* %8
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = load i64, i64* %5
br label %20
18: ; preds = %3
%19 = load i64, i64* %6
br label %20
20: ; preds = %18, %16
%21 = phi i64 [ %17, %16 ], [ %19, %18 ]
ret i64 %21
}

LLVM IR (-O2):
define i64 @do_ext(i32* nocapture %0, i64 %1, i64 %2) {
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i64 %1, i64 %2
ret i64 %6
}
int vrt_rdev_open(struct vrt_realdev *rdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.vrt_realdev = type opaque
define i32 @vrt_rdev_open(%struct.vrt_realdev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int tuner_i2c_write(void *, unsigned char, unsigned char, unsigned char *,
                    unsigned char);
signed int bbm_com_tuner_write(void *handle, unsigned char addr,
                               unsigned char alen, unsigned char *buffer,
                               unsigned char len) {
  signed int res;
  res = tuner_i2c_write(handle, addr, alen, buffer, len);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_tuner_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dl,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%dl
mov    -0xa(%rbp),%al
mov    -0x18(%rbp),%rcx
movzbl %dl,%esi
movzbl %al,%edx
movzbl -0x19(%rbp),%r8d
call   1030 <tuner_i2c_write@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_tuner_write>:
jmp    1030 <tuner_i2c_write@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_tuner_write(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4) {
%6 = tail call i32 @tuner_i2c_write(i8* %0, i8 zeroext %1, i8 zeroext %2, i8* %3, i8 zeroext %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int chown(const char *path, uid_t owner, gid_t group) { return 0; }


x86 assembly (clang, -O0):
<chown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @chown(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
ret i32 0
}

LLVM IR (-O2):
define i32 @chown(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
void gdk_window_object_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_object_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  printf("%s: Attempting to stop ossec.", argv[0]);
  system("net stop OssecSvc");
  system("pause");
  return (0);
}


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    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
lea    0xed4(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <system@plt>
lea    0xeed(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%s: Attempting to stop ossec.\00"
@.str.1 = [18 x i8] c"net stop OssecSvc\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s: Attempting to stop ossec.\00"
@.str.1 = [18 x i8] c"net stop OssecSvc\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}