xunge/DecIR huggingface dataset:
void func_haha(void) {
  printf("%s\n", __func__);
  printf("%s\n", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/ZhangIIIr/one/refs/heads/"
                 "master/Practice/CLanguage/print_func_name.c");
  printf("%d\n", 7);
}


x86 assembly (clang, -O0):
<func_haha>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf68(%rip),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_haha>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf69(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.func_haha = [10 x i8] c"func_haha\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ZhangIIIr/one/refs/heads/master/Practice/CLanguage/print_func_name.c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @func_haha() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.func_haha, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@__func__.func_haha = [10 x i8] c"func_haha\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ZhangIIIr/one/refs/heads/master/Practice/CLanguage/print_func_name.c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @func_haha() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.func_haha, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 7)
ret void
}
__attribute__((always_)) void softlockup_tick(void) {}


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

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

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

LLVM IR (-O2):
define void @softlockup_tick() {
ret void
}
int double_input(int input) { return input * 2; }


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

x86 assembly (clang, -O2):
<double_input>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @double_input(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void stop_execnone() {}


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

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

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

LLVM IR (-O2):
define void @stop_execnone() {
ret void
}
int SetAdd(char *s, int e) {
  int rv;
  rv = s[e];
  s[e] = 1;
  return !rv;
}


x86 assembly (clang, -O0):
<SetAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetAdd>:
movslq %esi,%rcx
xor    %eax,%eax
cmpb   $0x0,(%rdi,%rcx,1)
movb   $0x1,(%rdi,%rcx,1)
sete   %al
ret

LLVM IR (-O0):
define i32 @SetAdd(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
store i32 %11, i32* %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 1, i8* %15
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @SetAdd(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
store i8 1, i8* %4
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int mongo_env_sock_init(void) {
  static int called_once;
  static int retval;
  if (called_once)
    return retval;
  called_once = 1;
  return retval;
}


x86 assembly (clang, -O0):
<mongo_env_sock_init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
je     111f <mongo_env_sock_init+0x1f>
mov    0x2f11(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <mongo_env_sock_init+0x32>
movl   $0x1,0x2efb(%rip)
mov    0x2ef9(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mongo_env_sock_init>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <mongo_env_sock_init+0x10>
movb   $0x1,0x2f14(%rip)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@mongo_env_sock_init.called_once = internal unnamed_addr global i1 false
define i32 @mongo_env_sock_init() {
%1 = load i1, i1* @mongo_env_sock_init.called_once
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @mongo_env_sock_init.called_once
br label %3
3: ; preds = %0, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_gid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
void gain_root_group_privilege(void) {
  setgid(0);
  assert_gid(0, 0);
}


x86 assembly (clang, -O0):
<gain_root_group_privilege>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <setgid@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <assert_gid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gain_root_group_privilege>:
push   %rax
xor    %edi,%edi
call   1030 <setgid@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <assert_gid@plt>

LLVM IR (-O0):
define void @gain_root_group_privilege() {
%1 = call i32 @setgid(i32 0)
%2 = call i32 @assert_gid(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @gain_root_group_privilege() {
%1 = tail call i32 @setgid(i32 0)
%2 = tail call i32 @assert_gid(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no_instrument_function))
__cyg_profile_func_exit(void *this_fn, void *call_site) {
  if (call_site == (void *)0)
    abort();
}


x86 assembly (clang, -O0):
<__cyg_profile_func_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1132 <__cyg_profile_func_exit+0x22>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
test   %rsi,%rsi
je     1116 <__cyg_profile_func_exit+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @__cyg_profile_func_exit(i8* nocapture readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sub_a_hl();
void opcode_96() { sub_a_hl(); }


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

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

LLVM IR (-O0):
define void @opcode_96() {
%1 = call i32 (...) @sub_a_hl()
ret void
}

LLVM IR (-O2):
define void @opcode_96() {
%1 = tail call i32 (...) @sub_a_hl()
ret void
}
unsigned modulo(unsigned a, unsigned b) { return a % b; }


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
ret i32 %3
}
void qux(int arg, ...) {}


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

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

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

LLVM IR (-O2):
define void @qux(i32 %0, ...) {
ret void
}
void xTimerIntEnable(unsigned long ulBase, unsigned long ulChannel,
                     unsigned long ulIntFlags) {

  ;
  if (ulIntFlags == 0x00000001) {
    (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= ulIntFlags;
  } else {
    (*((volatile unsigned long *)(ulBase + 0x0000000C))) |=
        (ulIntFlags & (0x00000002 << (ulChannel - 1)));
  }
}


x86 assembly (clang, -O0):
<xTimerIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jne    1133 <xTimerIntEnable+0x33>
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xc(%rax)
jmp    115c <xTimerIntEnable+0x5c>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %eax,%ecx
mov    $0x2,%eax
shl    %cl,%eax
cltq
and    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xTimerIntEnable>:
lea    -0x1(%rsi),%ecx
mov    $0x2,%eax
shl    %cl,%eax
cltq
and    %rdx,%rax
cmp    $0x1,%rdx
cmove  %rdx,%rax
or     %rax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @xTimerIntEnable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i64, i64* %6
%11 = load i64, i64* %4
%12 = add i64 %11, 12
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %10
store volatile i64 %15, i64* %13
br label %29
16: ; preds = %3
%17 = load i64, i64* %6
%18 = load i64, i64* %5
%19 = sub i64 %18, 1
%20 = trunc i64 %19 to i32
%21 = shl i32 2, %20
%22 = sext i32 %21 to i64
%23 = and i64 %17, %22
%24 = load i64, i64* %4
%25 = add i64 %24, 12
%26 = inttoptr i64 %25 to i64*
%27 = load volatile i64, i64* %26
%28 = or i64 %27, %23
store volatile i64 %28, i64* %26
br label %29
29: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @xTimerIntEnable(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 1
%5 = trunc i64 %1 to i32
%6 = add i32 %5, -1
%7 = shl i32 2, %6
%8 = sext i32 %7 to i64
%9 = and i64 %8, %2
%10 = select i1 %4, i64 1, i64 %9
%11 = add i64 %0, 12
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %10
store volatile i64 %14, i64* %12
ret void
}
void gtk_tree_model_filter_convert_child_path_to_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_filter_convert_child_path_to_path() {
ret void
}
void hurz(murks) {
  if (murks = 4)
    schrott();
  else
    flursen();
  if (murks = 4)
    bar();
  if (murks = 4) {
    schrott();
  }
  return;
}


x86 assembly (clang, -O0):
<hurz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1151 <hurz+0x21>
jmp    115d <hurz+0x2d>
mov    $0x0,%al
call   1030 <schrott@plt>
jmp    1164 <hurz+0x34>
mov    $0x0,%al
call   1050 <flursen@plt>
movl   $0x4,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    117a <hurz+0x4a>
jmp    1181 <hurz+0x51>
mov    $0x0,%al
call   1040 <bar@plt>
movl   $0x4,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1197 <hurz+0x67>
jmp    119e <hurz+0x6e>
mov    $0x0,%al
call   1030 <schrott@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hurz>:
push   %rax
xor    %eax,%eax
call   1030 <schrott@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <schrott@plt>

LLVM IR (-O0):
define void @hurz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %2
br i1 true, label %3, label %5
3: ; preds = %1
%4 = call i32 (...) @schrott()
br label %7
5: ; preds = %1
%6 = call i32 (...) @flursen()
br label %7
7: ; preds = %5, %3
store i32 4, i32* %2
br i1 true, label %8, label %10
8: ; preds = %7
%9 = call i32 (...) @bar()
br label %10
10: ; preds = %8, %7
store i32 4, i32* %2
br i1 true, label %11, label %13
11: ; preds = %10
%12 = call i32 (...) @schrott()
br label %13
13: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @hurz(i32 %0) {
%2 = tail call i32 (...) @schrott()
%3 = tail call i32 (...) @bar()
%4 = tail call i32 (...) @schrott()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  int i;
  int *x = (int *)malloc(10 * sizeof(*x));
  for (i = 0; i < 20; i++)
    x[i] = i * i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    115e <main+0x4e>
mov    -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1030 <malloc@plt>
movaps 0xede(%rip),%xmm0
movups %xmm0,(%rax)
movaps 0xee4(%rip),%xmm0
movups %xmm0,0x10(%rax)
movaps 0xee9(%rip),%xmm0
movups %xmm0,0x20(%rax)
movaps 0xeee(%rip),%xmm0
movups %xmm0,0x30(%rax)
movaps 0xef3(%rip),%xmm0
movups %xmm0,0x40(%rax)
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 40)
%2 = inttoptr i64 %1 to i32*
%3 = inttoptr i64 %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 4, i32 9>, <4 x i32>* %3
%4 = getelementptr inbounds i32, i32* %2, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 16, i32 25, i32 36, i32 49>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %2, i64 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 64, i32 81, i32 100, i32 121>, <4 x i32>* %7
%8 = getelementptr inbounds i32, i32* %2, i64 12
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 144, i32 169, i32 196, i32 225>, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %2, i64 16
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 256, i32 289, i32 324, i32 361>, <4 x i32>* %11
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stdout;
void term_move(int x, int y) { fprintf(stdout, "\033[%d;%dH", y + 1, x + 1); }


x86 assembly (clang, -O0):
<term_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_move>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rsi),%edx
lea    0x1(%rdi),%ecx
lea    0xeda(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @term_move(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @term_move(i32 %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = add nsw i32 %1, 1
%5 = add nsw i32 %0, 1
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
int priv_vfs_chroot_setup(int asroot, int injail, struct test *test) {
  return (0);
}


x86 assembly (clang, -O0):
<priv_vfs_chroot_setup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test = type { i32 }
define i32 @priv_vfs_chroot_setup(i32 %0, i32 %1, %struct.test* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.test*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.test* %2, %struct.test** %6
ret i32 0
}

LLVM IR (-O2):
%struct.test = type { i32 }
define i32 @priv_vfs_chroot_setup(i32 %0, i32 %1, %struct.test* nocapture readnone %2) {
ret i32 0
}
void tegra_agic_clear_pending(int irq) { return; }


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

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

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

LLVM IR (-O2):
define void @tegra_agic_clear_pending(i32 %0) {
ret void
}
/* Type definitions */
struct client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reloadmwmhints(struct client *);
void mwm_manage(struct client *c) { reloadmwmhints(c); }


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

x86 assembly (clang, -O2):
<mwm_manage>:
jmp    1030 <reloadmwmhints@plt>

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

LLVM IR (-O2):
%struct.client = type { i32 }
define void @mwm_manage(%struct.client* %0) {
%2 = tail call i32 @reloadmwmhints(%struct.client* %0)
ret void
}
void gendsrlv() {}


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

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

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

LLVM IR (-O2):
define void @gendsrlv() {
ret void
}
int mul_i32(int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @mul_i32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mul_i32(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int test_imm_84int32_mem(int *val) {
  return ((*val) & (0x84 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_84int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 132
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int dev2minor(int d) {
  if (d >= 0)
    return d;
  return (-1 - d) << 6;
}


x86 assembly (clang, -O0):
<dev2minor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <dev2minor+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <dev2minor+0x2a>
mov    $0xffffffff,%eax
sub    -0x8(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev2minor>:
mov    %edi,%eax
not    %eax
shl    $0x6,%eax
test   %edi,%edi
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @dev2minor(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = xor i32 %0, -1
%4 = shl i32 %3, 6
%5 = select i1 %2, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strend(char *, char *);
int main(int argc, char *argv[]) {
  assert(strend("abcde", "cde"));
  assert(!strend("abcde", "cdef"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <strend@plt>
mov    %eax,%edi
call   1030 <assert@plt>
lea    0xeb0(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1040 <strend@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strend@plt>
mov    %eax,%edi
call   1030 <assert@plt>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strend@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [4 x i8] c"cde\00"
@.str.2 = [5 x i8] c"cdef\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @strend(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @assert(i32 %5)
%7 = call i32 @strend(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [4 x i8] c"cde\00"
@.str.2 = [5 x i8] c"cdef\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @strend(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @strend(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int lstat(const char *path, struct stat *buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<lstat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lstat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ benchmark();
int main(int argc, const char **argv) {
  benchmark();
  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    $0x0,%al
call   1030 <benchmark@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <benchmark@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = call i32 (...) @benchmark()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @benchmark()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int border_width;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_border_width(void *_p, int _v) {
  ((XWindowAttributes *)_p)->border_width = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_border_width>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XWindowAttributes_border_width(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void network_close(int socket) { close(socket); }


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

x86 assembly (clang, -O2):
<network_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @network_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
long long __infer_nondet_long_long_int();
long long int llrintf(float x) { return __infer_nondet_long_long_int(); }


x86 assembly (clang, -O0):
<llrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_long_long_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @llrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i64 (...) @__infer_nondet_long_long_int()
ret i64 %3
}

LLVM IR (-O2):
define i64 @llrintf(float %0) {
%2 = tail call i64 (...) @__infer_nondet_long_long_int()
ret i64 %2
}
/* Variables and functions */
int hexstr_get_byte(char const **);
int hexstr_get_word(char const **p) {
  int h = hexstr_get_byte(p);
  int l = hexstr_get_byte(p);
  if (h >= 0 && l >= 0)
    return (h << 8) | l;
  return -1;
}


x86 assembly (clang, -O0):
<hexstr_get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <hexstr_get_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <hexstr_get_byte@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1159 <hexstr_get_word+0x49>
cmpl   $0x0,-0x18(%rbp)
jl     1159 <hexstr_get_word+0x49>
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <hexstr_get_word+0x50>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexstr_get_word>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <hexstr_get_byte@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <hexstr_get_byte@plt>
mov    %ebp,%ecx
shl    $0x8,%ecx
or     %eax,%ecx
or     %eax,%ebp
mov    $0xffffffff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hexstr_get_word(i8** %0) {
%2 = tail call i32 @hexstr_get_byte(i8** %0)
%3 = tail call i32 @hexstr_get_byte(i8** %0)
%4 = icmp sgt i32 %2, -1
%5 = icmp sgt i32 %3, -1
%6 = select i1 %4, i1 %5, i1 false
%7 = shl i32 %2, 8
%8 = or i32 %7, %3
%9 = select i1 %6, i32 %8, i32 -1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ clear_bit_test();
int /*<<< orphan*/ find_first_bit_test();
int /*<<< orphan*/ find_first_zero_bit_test();
int /*<<< orphan*/ set_bit_test();
int main(int argv, char **args) {
  set_bit_test();
  clear_bit_test();
  find_first_zero_bit_test();
  find_first_bit_test();
  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    $0x0,%al
call   1060 <set_bit_test@plt>
mov    $0x0,%al
call   1030 <clear_bit_test@plt>
mov    $0x0,%al
call   1040 <find_first_zero_bit_test@plt>
mov    $0x0,%al
call   1050 <find_first_bit_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <set_bit_test@plt>
xor    %eax,%eax
call   1030 <clear_bit_test@plt>
xor    %eax,%eax
call   1040 <find_first_zero_bit_test@plt>
xor    %eax,%eax
call   1050 <find_first_bit_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = call i32 (...) @set_bit_test()
%7 = call i32 (...) @clear_bit_test()
%8 = call i32 (...) @find_first_zero_bit_test()
%9 = call i32 (...) @find_first_bit_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @set_bit_test()
%4 = tail call i32 (...) @clear_bit_test()
%5 = tail call i32 (...) @find_first_zero_bit_test()
%6 = tail call i32 (...) @find_first_bit_test()
ret i32 0
}
void do_extern_action(unsigned char n) {}


x86 assembly (clang, -O0):
<do_extern_action>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_extern_action(i8 zeroext %0) {
ret void
}
int trim_char(const char c) {
  int i;
  const char trim[4] = {'\n', '\t', '\r', ' '};
  for (i = 0; i < 4; i++) {
    if (c == trim[i]) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<trim_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1158 <trim_char+0x58>
movsbl -0x5(%rbp),%eax
movslq -0xc(%rbp),%rcx
movsbl -0x10(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    1145 <trim_char+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115f <trim_char+0x5f>
jmp    114a <trim_char+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <trim_char+0x1a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_char>:
cmp    $0x20,%dil
ja     1120 <trim_char+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    1120 <trim_char+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.trim_char.trim = [4 x i8] c"\0A\09\0D "
define i32 @trim_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
%5 = alloca [4 x i8]
store i8 %0, i8* %3
%6 = bitcast [4 x i8]* %5 to i8*
store i32 0, i32* %4
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %12, %17
br i1 %18, label %19, label %20
19: ; preds = %10
store i32 1, i32* %2
br label %25
20: ; preds = %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %7
24: ; preds = %7
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @trim_char(i8 signext %0) {
switch i8 %0, label %2 [
i8 10, label %3
i8 9, label %3
i8 13, label %3
i8 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
double GetSeaLevelPressure(int, double, double);
double GetStationPressure(double SeaLevelPressure, double Altitude,
                          double TDryBulb) {
  return SeaLevelPressure / GetSeaLevelPressure(1., Altitude, TDryBulb);
}


x86 assembly (clang, -O0):
<GetStationPressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    $0x1,%edi
call   1030 <GetSeaLevelPressure@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetStationPressure>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
movapd %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <GetSeaLevelPressure@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @GetStationPressure(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @GetSeaLevelPressure(i32 1, double %8, double %9)
%11 = fdiv double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @GetStationPressure(double %0, double %1, double %2) {
%4 = tail call double @GetSeaLevelPressure(i32 1, double %1, double %2)
%5 = fdiv double %0, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("It was the best of times.\n");
  printf("It was the worse of times.\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%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
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"It was the best of times.\0A\00"
@.str.1 = [28 x i8] c"It was the worse of times.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"It was the best of times.\00"
@str.2 = [27 x i8] c"It was the worse of times.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plainstring_equals(struct plainstring const *, char const *);
int plainstring_not_equals(const struct plainstring *this_string,
                           const char *str) {
  return !plainstring_equals(this_string, str);
}


x86 assembly (clang, -O0):
<plainstring_not_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <plainstring_equals@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_not_equals>:
push   %rax
call   1030 <plainstring_equals@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define i32 @plainstring_not_equals(%struct.plainstring* %0, i8* %1) {
%3 = alloca %struct.plainstring*
%4 = alloca i8*
store %struct.plainstring* %0, %struct.plainstring** %3
store i8* %1, i8** %4
%5 = load %struct.plainstring*, %struct.plainstring** %3
%6 = load i8*, i8** %4
%7 = call i32 @plainstring_equals(%struct.plainstring* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define i32 @plainstring_not_equals(%struct.plainstring* %0, i8* %1) {
%3 = tail call i32 @plainstring_equals(%struct.plainstring* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void rtems_bsp_delay(int num) {
  while (num--) {
    asm("nop");
  }
}


x86 assembly (clang, -O0):
<rtems_bsp_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1121 <rtems_bsp_delay+0x21>
nop
jmp    1107 <rtems_bsp_delay+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtems_bsp_delay>:
test   %edi,%edi
je     1116 <rtems_bsp_delay+0x16>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
nop
add    $0xffffffff,%edi
jne    1110 <rtems_bsp_delay+0x10>
ret

LLVM IR (-O0):
define void @rtems_bsp_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @rtems_bsp_delay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long ptrace(int request, int pid, int addr, int data) {
  printf("I'm fake");
  return 0;
}


x86 assembly (clang, -O0):
<ptrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"I'm fake\00"
define i64 @ptrace(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"I'm fake\00"
define i64 @ptrace(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i64 0
}
/* Variables and functions */
int msec();
int /*<<< orphan*/ printf(char *, int);
void main() {
  while (1) {
    printf("ms: %u\r", msec());
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1040 <msec@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    1129 <main+0x9>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <msec@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"ms: %u\0D\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @msec()
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"ms: %u\0D\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @msec()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t str_get_length(char const *);
size_t str_get_size(const char *s) {
  assert(s != NULL);
  return str_get_length(s) + 1;
}


x86 assembly (clang, -O0):
<str_get_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <str_get_length@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_get_size>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <str_get_length@plt>
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @str_get_size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = call i64 @str_get_length(i8* %7)
%9 = add i64 %8, 1
ret i64 %9
}

LLVM IR (-O2):
define i64 @str_get_size(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @str_get_length(i8* %0)
%6 = add i64 %5, 1
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int number = 5678910;
  char string[1000];
  int width = 10;
  itoa(number, string, width);
  printf("%s\n", string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x56a73e,-0x4(%rbp)
movl   $0xa,-0x3f4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x3f0(%rbp),%rsi
mov    -0x3f4(%rbp),%edx
call   1040 <itoa@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    $0x56a73e,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <itoa@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 5678910, i8* %2, i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}