xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int speed, limit;
  scanf("%d%d", &speed, &limit);
  if (speed > limit) {
    printf("violation\n");
  } else {
    printf("ok\n");
  }
  return 0;
}


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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1160 <main+0x40>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <main+0x4c>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    (%rsp),%eax
lea    0xec5(%rip),%rax
lea    0xebb(%rip),%rdi
cmovg  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@str = [3 x i8] c"ok\00"
@str.3 = [10 x i8] c"violation\00"
define i32 @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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %6, %7
%9 = select i1 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
void copia(void) {
  extern char linea[], linea_max[];
  int i;
  i = 0;
  while (*(linea + i) != '\0') {
    *(linea_max + i) = *(linea + i);
    i++;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2eda(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114d <copia+0x4d>
movslq -0x4(%rbp),%rcx
mov    0x2ec2(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2e9c(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copia+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%cl
test   %cl,%cl
je     1130 <copia+0x30>
xor    %edx,%edx
mov    0x2ec2(%rip),%rsi
cs nopw 0x0(%rax,%rax,1)
mov    %cl,(%rsi,%rdx,1)
movzbl 0x1(%rax,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <copia+0x20>
ret

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

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %7, %3 ], [ 0, %0 ]
%5 = phi i8 [ %9, %3 ], [ %1, %0 ]
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %4
store i8 %5, i8* %6
%7 = add nuw nsw i64 %4, 1
%8 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  signed int nr = -12;
  nr >>= 1;
  printf("Nr e acum %d", nr);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Nr e acum %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 -6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
__attribute__((__always___)) void sys_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<sys_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sys_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_timer(int /*<<< orphan*/, int, int,
                                int /*<<< orphan*/, int);
int /*<<< orphan*/ write_mbus_register(int, int, int);
int main() {
  config_timer(0, 1, 1, 0, 10000);
  write_mbus_register(0xDD, 0x12, 0x345678);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %ecx,%ecx
mov    $0x1,%edx
mov    $0x2710,%r8d
mov    %ecx,%edi
mov    %edx,%esi
call   1030 <config_timer@plt>
mov    $0xdd,%edi
mov    $0x12,%esi
mov    $0x345678,%edx
call   1040 <write_mbus_register@plt>
jmp    1159 <main+0x39>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x2710,%r8d
call   1030 <config_timer@plt>
mov    $0xdd,%edi
mov    $0x12,%esi
mov    $0x345678,%edx
call   1040 <write_mbus_register@plt>
xchg   %ax,%ax
jmp    1150 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @config_timer(i32 0, i32 1, i32 1, i32 0, i32 10000)
%3 = call i32 @write_mbus_register(i32 221, i32 18, i32 3430008)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @config_timer(i32 0, i32 1, i32 1, i32 0, i32 10000)
%2 = tail call i32 @write_mbus_register(i32 221, i32 18, i32 3430008)
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int IsMatchUnchecked(unsigned char const, char const *, char const *);
int IsEndCharMatch(const unsigned char *offset, const unsigned char *end,
                   const char *key, const char *multibyte_start) {
  if ((offset) >= end)
    return 0;
  return IsMatchUnchecked(*offset ^ 0x80, key, multibyte_start);
}


x86 assembly (clang, -O0):
<IsEndCharMatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1142 <IsEndCharMatch+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1161 <IsEndCharMatch+0x51>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
xor    $0x80,%eax
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movzbl %al,%edi
call   1030 <IsMatchUnchecked@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEndCharMatch>:
cmp    %rsi,%rdi
jae    1129 <IsEndCharMatch+0x19>
movzbl (%rdi),%edi
xor    $0x80,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <IsMatchUnchecked@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @IsEndCharMatch(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = icmp uge i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
store i32 0, i32* %5
br label %23
14: ; preds = %4
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = xor i32 %17, 128
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %8
%21 = load i8*, i8** %9
%22 = call i32 @IsMatchUnchecked(i8 zeroext %19, i8* %20, i8* %21)
store i32 %22, i32* %5
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @IsEndCharMatch(i8* %0, i8* readnone %1, i8* %2, i8* %3) {
%5 = icmp ult i8* %0, %1
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i8, i8* %0
%8 = xor i8 %7, -128
%9 = tail call i32 @IsMatchUnchecked(i8 zeroext %8, i8* %2, i8* %3)
br label %10
10: ; preds = %4, %6
%11 = phi i32 [ %9, %6 ], [ 0, %4 ]
ret i32 %11
}
/* Type definitions */
struct trace_seq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ trace_seq_printf(struct trace_seq *, char const *, ...);
void print_str_to_seq(struct trace_seq *s, const char *format, int len_arg,
                      const char *str) {
  if (len_arg >= 0) {
    trace_seq_printf(s, format, len_arg, str);
  } else {
    trace_seq_printf(s, format, str);
  }
}


x86 assembly (clang, -O0):
<print_str_to_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     114c <print_str_to_seq+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1030 <trace_seq_printf@plt>
jmp    115f <print_str_to_seq+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1030 <trace_seq_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str_to_seq>:
test   %edx,%edx
js     111b <print_str_to_seq+0xb>
xor    %eax,%eax
jmp    1030 <trace_seq_printf@plt>
mov    %rcx,%rdx
xor    %eax,%eax
jmp    1030 <trace_seq_printf@plt>

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
define void @print_str_to_seq(%struct.trace_seq* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca %struct.trace_seq*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store %struct.trace_seq* %0, %struct.trace_seq** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load %struct.trace_seq*, %struct.trace_seq** %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = call i32 (%struct.trace_seq*, i8*, ...) @trace_seq_printf(%struct.trace_seq* %12, i8* %13, i32 %14, i8* %15)
br label %22
17: ; preds = %4
%18 = load %struct.trace_seq*, %struct.trace_seq** %5
%19 = load i8*, i8** %6
%20 = load i8*, i8** %8
%21 = call i32 (%struct.trace_seq*, i8*, ...) @trace_seq_printf(%struct.trace_seq* %18, i8* %19, i8* %20)
br label %22
22: ; preds = %17, %11
ret void
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
define void @print_str_to_seq(%struct.trace_seq* %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp sgt i32 %2, -1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (%struct.trace_seq*, i8*, ...) @trace_seq_printf(%struct.trace_seq* %0, i8* %1, i32 %2, i8* %3)
br label %10
8: ; preds = %4
%9 = tail call i32 (%struct.trace_seq*, i8*, ...) @trace_seq_printf(%struct.trace_seq* %0, i8* %1, i8* %3)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void *thread(void *arg) {
  long i = (long)arg;
  printf("t: running!\n");
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<thread>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"t: running!\0A\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [12 x i8] c"t: running!\00"
define noalias i8* @thread(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int RGB2Y(int r, int g, int b) {
  return (257 * r + 504 * g + 98 * b + 16500) / 1000;
}


x86 assembly (clang, -O0):
<RGB2Y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x101,-0x4(%rbp),%eax
imul   $0x1f8,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x62,-0xc(%rbp),%ecx
add    %ecx,%eax
add    $0x4074,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB2Y>:
mov    %edi,%eax
shl    $0x8,%eax
add    %edi,%eax
imul   $0x1f8,%esi,%ecx
add    %eax,%ecx
imul   $0x62,%edx,%eax
add    %ecx,%eax
add    $0x4074,%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @RGB2Y(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 = mul nsw i32 257, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 504, %9
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 98, %12
%14 = add nsw i32 %11, %13
%15 = add nsw i32 %14, 16500
%16 = sdiv i32 %15, 1000
ret i32 %16
}

LLVM IR (-O2):
define i32 @RGB2Y(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 257
%5 = mul nsw i32 %1, 504
%6 = mul nsw i32 %2, 98
%7 = add i32 %4, 16500
%8 = add i32 %7, %5
%9 = add i32 %8, %6
%10 = sdiv i32 %9, 1000
ret i32 %10
}
/* Variables and functions */
void *malloc(size_t);
void *barebox_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<barebox_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @barebox_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int k;
  if (!(0 <= k && k <= 1 && i == 1))
    return 0;
  while (1) {
    i = i + 1;
    k = k - 1;
    assert(1 <= i + k && i + k <= 2 && i >= 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jg     113e <main+0x2e>
cmpl   $0x1,-0xc(%rbp)
jg     113e <main+0x2e>
cmpl   $0x1,-0x8(%rbp)
je     1146 <main+0x36>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    114b <main+0x3b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edx
add    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jg     1193 <main+0x83>
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
mov    %al,-0xd(%rbp)
jg     1193 <main+0x83>
cmpl   $0x1,-0x8(%rbp)
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    114b <main+0x3b>

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ event;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
unsigned long get_XCirculateEvent_event(void *_p) {
  return (unsigned long)((XCirculateEvent *)_p)->event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XCirculateEvent_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XCirculateEvent_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ msim_setSouthWall(unsigned int, unsigned int, int);
void msim_setNorthWall(unsigned int x, unsigned int y, int existsWall) {
  msim_setSouthWall(x, y + 1, existsWall);
}


x86 assembly (clang, -O0):
<msim_setNorthWall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
call   1030 <msim_setSouthWall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msim_setNorthWall>:
add    $0x1,%esi
jmp    1030 <msim_setSouthWall@plt>

LLVM IR (-O0):
define void @msim_setNorthWall(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 = add i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @msim_setSouthWall(i32 %7, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @msim_setNorthWall(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, 1
%5 = tail call i32 @msim_setSouthWall(i32 %0, i32 %4, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int b = 4;
  char array[100];
  int **p = (int **)(array + 7);
  *p = &b;
  p = 0;
  int *q = *((int **)(array + 7));
  *q = 3;
  test_assert(b == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
lea    -0x70(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
lea    -0x8(%rbp),%rcx
mov    %rcx,(%rax)
movq   $0x0,-0x78(%rbp)
mov    -0x69(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
movl   $0x3,(%rax)
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = alloca i32**
%5 = alloca i32*
store i32 0, i32* %1
store i32 4, i32* %2
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 7
%8 = bitcast i8* %7 to i32**
store i32** %8, i32*** %4
%9 = load i32**, i32*** %4
store i32* %2, i32** %9
store i32** null, i32*** %4
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 7
%12 = bitcast i8* %11 to i32**
%13 = load i32*, i32** %12
store i32* %13, i32** %5
%14 = load i32*, i32** %5
store i32 3, i32* %14
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 3
%17 = zext i1 %16 to i32
%18 = call i32 @test_assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyn_equal_rgneffects(struct Cyc_List_List *,
                                              struct Cyc_List_List *);
int Cyc_IOEffect_cmp_effect(struct Cyc_List_List *f1,
                            struct Cyc_List_List *f2) {
  return f1 == f2 || ({ Cyc_Absyn_equal_rgneffects(f1, f2); });
}


x86 assembly (clang, -O0):
<Cyc_IOEffect_cmp_effect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    -0x10(%rbp),%rcx
mov    %al,-0x15(%rbp)
je     114d <Cyc_IOEffect_cmp_effect+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_Absyn_equal_rgneffects@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_IOEffect_cmp_effect>:
cmp    %rsi,%rdi
je     1129 <Cyc_IOEffect_cmp_effect+0x19>
push   %rax
call   1030 <Cyc_Absyn_equal_rgneffects@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_IOEffect_cmp_effect(%struct.Cyc_List_List* %0, %struct.Cyc_List_List* %1) {
%3 = alloca %struct.Cyc_List_List*
%4 = alloca %struct.Cyc_List_List*
%5 = alloca i32
store %struct.Cyc_List_List* %0, %struct.Cyc_List_List** %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %3
%7 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%8 = icmp eq %struct.Cyc_List_List* %6, %7
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %3
%11 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%12 = call i32 @Cyc_Absyn_equal_rgneffects(%struct.Cyc_List_List* %10, %struct.Cyc_List_List* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %9, %2
%16 = phi i1 [ true, %2 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.Cyc_List_List = type { i32 }
define i32 @Cyc_IOEffect_cmp_effect(%struct.Cyc_List_List* %0, %struct.Cyc_List_List* %1) {
%3 = icmp eq %struct.Cyc_List_List* %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @Cyc_Absyn_equal_rgneffects(%struct.Cyc_List_List* %0, %struct.Cyc_List_List* %1)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 1, %2 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void markovcurrylambdahardware() { printf("markovcurrylambdahardware\n"); }


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"markovcurrylambdahardware\00"
define void @markovcurrylambdahardware() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_STENCIL_TEST;
int /*<<< orphan*/ glDepthMask(int);
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void setupNormalDrawingState(void) {
  glDisable(GL_STENCIL_TEST);
  glEnable(GL_DEPTH_TEST);
  glDepthMask(1);
}


x86 assembly (clang, -O0):
<setupNormalDrawingState>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <glDisable@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    $0x1,%edi
call   1040 <glDepthMask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupNormalDrawingState>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1050 <glDisable@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <glDepthMask@plt>

LLVM IR (-O0):
@GL_STENCIL_TEST = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @setupNormalDrawingState() {
%1 = load i32, i32* @GL_STENCIL_TEST
%2 = call i32 @glDisable(i32 %1)
%3 = load i32, i32* @GL_DEPTH_TEST
%4 = call i32 @glEnable(i32 %3)
%5 = call i32 @glDepthMask(i32 1)
ret void
}

LLVM IR (-O2):
@GL_STENCIL_TEST = global i32 0
@GL_DEPTH_TEST = global i32 0
define void @setupNormalDrawingState() {
%1 = load i32, i32* @GL_STENCIL_TEST
%2 = tail call i32 @glDisable(i32 %1)
%3 = load i32, i32* @GL_DEPTH_TEST
%4 = tail call i32 @glEnable(i32 %3)
%5 = tail call i32 @glDepthMask(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo2() {
  int a[100];
  int i;
  int x = 10;
  for (i = 0; i <= 99; i += 1) {
    a[i] = x;
    x = i;
  }
  printf("x=%d", x);
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0xa,-0x198(%rbp)
movl   $0x0,-0x194(%rbp)
cmpl   $0x63,-0x194(%rbp)
jg     1170 <foo2+0x60>
mov    -0x198(%rbp),%ecx
movslq -0x194(%rbp),%rax
mov    %ecx,-0x190(%rbp,%rax,4)
mov    -0x194(%rbp),%eax
mov    %eax,-0x198(%rbp)
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    112f <foo2+0x1f>
mov    -0x198(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"x=%d\00"
define void @foo2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 99)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ stackmon_minfree();
scalar_t__ stackmon_stacksize();
uint16_t stackmon_maxdepth(void) {
  return stackmon_stacksize() - stackmon_minfree();
}


x86 assembly (clang, -O0):
<stackmon_maxdepth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <stackmon_stacksize@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <stackmon_minfree@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stackmon_maxdepth>:
push   %rbx
xor    %eax,%eax
call   1040 <stackmon_stacksize@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <stackmon_minfree@plt>
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @stackmon_maxdepth() {
%1 = call i64 (...) @stackmon_stacksize()
%2 = call i64 (...) @stackmon_minfree()
%3 = sub nsw i64 %1, %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @stackmon_maxdepth() {
%1 = tail call i64 (...) @stackmon_stacksize()
%2 = tail call i64 (...) @stackmon_minfree()
%3 = sub nsw i64 %1, %2
ret i64 %3
}
/* Variables and functions */
unsigned int numReversed(unsigned int);
bool isNumPalindrome(unsigned int number) {
  if (number == numReversed(number))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<isNumPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <numReversed@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jne    1142 <isNumPalindrome+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <isNumPalindrome+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumPalindrome>:
push   %rbx
mov    %edi,%ebx
call   1030 <numReversed@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isNumPalindrome(i32 %0) {
%2 = tail call i32 @numReversed(i32 %0)
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wcsftime(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/ *,
                            struct tm *);
void uninitvar_wcsftime(wchar_t *ptr) {
  size_t maxsize;
  wchar_t *format;
  struct tm *timeptr;
  (void)wcsftime(ptr, maxsize, format, timeptr);
}


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

x86 assembly (clang, -O2):
<uninitvar_wcsftime>:
jmp    1030 <wcsftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @uninitvar_wcsftime(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i32*
%5 = alloca %struct.tm*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i64, i64* %3
%8 = load i32*, i32** %4
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @wcsftime(i32* %6, i64 %7, i32* %8, %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @uninitvar_wcsftime(i32* %0) {
%2 = tail call i32 @wcsftime(i32* %0, i64 undef, i32* undef, %struct.tm* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("gnome-terminal -e './ifme --gui'");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"gnome-terminal -e './ifme --gui'\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"gnome-terminal -e './ifme --gui'\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sched_param {
  scalar_t__ sched_priority;
};

/* Variables and functions */
int /*<<< orphan*/ SCHED_OTHER;
int /*<<< orphan*/ perror(char *);
int sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                       struct sched_param *);
void scheduler_standard() {
  struct sched_param p;
  p.sched_priority = 0;
  if (sched_setscheduler(0, SCHED_OTHER, &p) == -1) {
    perror("Failed to switch to normal scheduler.");
  }
}


x86 assembly (clang, -O0):
<scheduler_standard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
cmp    $0xffffffff,%eax
jne    1159 <scheduler_standard+0x39>
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scheduler_standard>:
push   %rax
movq   $0x0,(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1030 <sched_setscheduler@plt>
cmp    $0xffffffff,%eax
je     1143 <scheduler_standard+0x23>
pop    %rax
ret
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
@.str = [38 x i8] c"Failed to switch to normal scheduler.\00"
define void @scheduler_standard() {
%1 = alloca %struct.sched_param
%2 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i32 0, i32 0
store i64 0, i64* %2
%3 = load i32, i32* @SCHED_OTHER
%4 = call i32 @sched_setscheduler(i32 0, i32 %3, %struct.sched_param* %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
@.str = [38 x i8] c"Failed to switch to normal scheduler.\00"
define void @scheduler_standard() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @SCHED_OTHER
%5 = call i32 @sched_setscheduler(i32 0, i32 %4, %struct.sched_param* %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t USBDevSpeedGet(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  if ((*((volatile uint8_t *)(ui32Base + 0x00000001))) & 0x00000010) {
    return (0x00000002);
  }
  return (0x00000001);
}


x86 assembly (clang, -O0):
<USBDevSpeedGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x40050000,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1151 <USBDevSpeedGet+0x41>
movl   $0x2,-0x4(%rbp)
jmp    1158 <USBDevSpeedGet+0x48>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevSpeedGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x1(%rax),%eax
and    $0x10,%eax
cmp    $0x1,%eax
mov    $0x2,%eax
sbb    $0x0,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @USBDevSpeedGet(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 1
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 16
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 1, i32 2
ret i32 %11
}
void gtk_entry_get_has_frame() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_get_has_frame() {
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
void vt_mode_get(struct termios *mode_ptr) {
  tcgetattr(STDOUT_FILENO, mode_ptr);
}


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

x86 assembly (clang, -O2):
<vt_mode_get>:
mov    %rdi,%rsi
mov    0x2ed6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <tcgetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDOUT_FILENO = global i32 0
define void @vt_mode_get(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = load %struct.termios*, %struct.termios** %2
%5 = call i32 @tcgetattr(i32 %3, %struct.termios* %4)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDOUT_FILENO = global i32 0
define void @vt_mode_get(%struct.termios* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @tcgetattr(i32 %2, %struct.termios* %0)
ret void
}
/* Variables and functions */
int write(int, int *, int);
int my_termprint(int c) { return write(1, &c, sizeof(char)); }


x86 assembly (clang, -O0):
<my_termprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edx
lea    -0x4(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_termprint>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_termprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i32* %2, i32 1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @my_termprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 1, i32* %2, i32 1)
ret i32 %3
}
/* Variables and functions */
double pow(double, int);
double powUnguarded(double x, int y) { return pow(x, y); }


x86 assembly (clang, -O0):
<powUnguarded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powUnguarded>:
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @powUnguarded(double %0, i32 %1) {
%3 = tail call double @pow(double %0, i32 %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) check(intptr_t p) {
  if ((p & 15) != 0)
    abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
je     1135 <check+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   $0xf,%dil
jne    1117 <check+0x7>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 15
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @check(i64 %0) {
%2 = and i64 %0, 15
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int ksm_max_kernel_pages();
int write_value(int, char *);
int start(void) {
  if (access("/sys/kernel/mm/ksm/max_kernel_pages", R_OK) >= 0)
    write_value(ksm_max_kernel_pages(), "/sys/kernel/mm/ksm/max_kernel_pages");
  return write_value(1, "/sys/kernel/mm/ksm/run");
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1050 <access@plt>
cmp    $0x0,%rax
jl     1168 <start+0x38>
mov    $0x0,%al
call   1040 <ksm_max_kernel_pages@plt>
mov    %eax,%edi
lea    0xe9d(%rip),%rsi
call   1030 <write_value@plt>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <write_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <access@plt>
test   %rax,%rax
js     1160 <start+0x30>
xor    %eax,%eax
call   1040 <ksm_max_kernel_pages@plt>
lea    0xea7(%rip),%rsi
mov    %eax,%edi
call   1030 <write_value@plt>
lea    0xebd(%rip),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1030 <write_value@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"/sys/kernel/mm/ksm/max_kernel_pages\00"
@R_OK = global i32 0
@.str.1 = [23 x i8] c"/sys/kernel/mm/ksm/run\00"
define i32 @start() {
%1 = load i32, i32* @R_OK
%2 = call i64 @access(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sge i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 (...) @ksm_max_kernel_pages()
%6 = call i32 @write_value(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %0
%8 = call i32 @write_value(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
@.str = [36 x i8] c"/sys/kernel/mm/ksm/max_kernel_pages\00"
@R_OK = global i32 0
@.str.1 = [23 x i8] c"/sys/kernel/mm/ksm/run\00"
define i32 @start() {
%1 = load i32, i32* @R_OK
%2 = tail call i64 @access(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i64 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @ksm_max_kernel_pages()
%6 = tail call i32 @write_value(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %0
%8 = tail call i32 @write_value(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 %8
}
unsigned int ConvertGrayToBinary16(unsigned int num) {
  unsigned int numBits = 16;
  unsigned int shift;
  for (shift = 1; shift < numBits; shift = 2 * shift)
    num = num ^ (num >> shift);
  return num;
}


x86 assembly (clang, -O0):
<ConvertGrayToBinary16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x10,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1141 <ConvertGrayToBinary16+0x41>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <ConvertGrayToBinary16+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertGrayToBinary16>:
mov    %edi,%eax
shr    %eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shr    $0x4,%edx
xor    %ecx,%edx
mov    %edx,%eax
shr    $0x8,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ConvertGrayToBinary16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 16, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp ult i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = lshr i32 %11, %12
%14 = xor i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = mul i32 2, %16
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @ConvertGrayToBinary16(i32 %0) {
%2 = lshr i32 %0, 1
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 2
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 8
%9 = xor i32 %8, %7
ret i32 %9
}