xunge/DecIR huggingface dataset:
int media_write(unsigned long sector, unsigned char *buffer) { return 1; }


x86 assembly (clang, -O0):
<media_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @media_write(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
ret i32 1
}

LLVM IR (-O2):
define i32 @media_write(i64 %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x84() {
  Assert_real((isgraph(132) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              665, ("isgraph should be 0 for 0x84"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x84\00"
define void @t_isgraph_0x84() {
%1 = tail call i64 @isgraph(i32 132)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 665, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *getenv(char *);
char *get_conf_file() {
  char *ev = getenv("LIBTIMEMACHINE_CONF");
  char *conf_file = "/tmp/libtimemachine.conf";
  if (ev) {
    conf_file = ev;
  }
  return conf_file;
}


x86 assembly (clang, -O0):
<get_conf_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
lea    0xee5(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <get_conf_file+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_conf_file>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xeed(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"LIBTIMEMACHINE_CONF\00"
@.str.1 = [25 x i8] c"/tmp/libtimemachine.conf\00"
define i8* @get_conf_file() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %1
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i8*, i8** %1
store i8* %7, i8** %2
br label %8
8: ; preds = %6, %0
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [20 x i8] c"LIBTIMEMACHINE_CONF\00"
@.str.1 = [25 x i8] c"/tmp/libtimemachine.conf\00"
define i8* @get_conf_file() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gcd(int a, int b) {
  int r;
  assert(a > 0 && b > 0);
  while (b > 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jle    1137 <gcd+0x27>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1169 <gcd+0x59>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <gcd+0x34>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
test   %edi,%edi
setg   %al
test   %esi,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
test   %ebp,%ebp
jle    1141 <gcd+0x31>
nop
mov    %ebp,%ecx
mov    %ebx,%eax
cltd
idiv   %ebp
mov    %ebp,%ebx
mov    %edx,%ebp
test   %edx,%edx
jg     1130 <gcd+0x20>
jmp    1143 <gcd+0x33>
mov    %ebx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
br i1 %4, label %8, label %13
8: ; preds = %2, %8
%9 = phi i32 [ %10, %8 ], [ %0, %2 ]
%10 = phi i32 [ %11, %8 ], [ %1, %2 ]
%11 = srem i32 %9, %10
%12 = icmp sgt i32 %11, 0
br i1 %12, label %8, label %13
13: ; preds = %8, %2
%14 = phi i32 [ %0, %2 ], [ %10, %8 ]
ret i32 %14
}
long factorial(long number) {
  if (number <= 1) {
    return 1;
  } else {
    return (number * factorial(number - 1));
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jg     1134 <factorial+0x24>
movq   $0x1,-0x8(%rbp)
jmp    1158 <factorial+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%rdi
jl     1121 <factorial+0x21>
mov    $0x1,%eax
imul   %rdi,%rax
lea    -0x1(%rdi),%rcx
cmp    $0x2,%rdi
mov    %rcx,%rdi
ja     1110 <factorial+0x10>
ret

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

LLVM IR (-O2):
define i64 @factorial(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 1, %1 ]
%6 = add nsw i64 %4, -1
%7 = mul nsw i64 %4, %5
%8 = icmp ult i64 %4, 3
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %10
}
int finditem(int item, int *list, int size) {
  int i;
  for (i = 0; i < size; i++, list++)
    if (*list == item)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<finditem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <finditem+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    113c <finditem+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1162 <finditem+0x62>
jmp    1141 <finditem+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <finditem+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<finditem>:
test   %edx,%edx
jle    111d <finditem+0x1d>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1120 <finditem+0x20>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <finditem+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @finditem(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%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 0, i32* %8
br label %9
9: ; preds = %20, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = load i32, i32* %5
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %4
br label %26
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i32 1
store i32* %24, i32** %6
br label %9
25: ; preds = %9
store i32 0, i32* %4
br label %26
26: ; preds = %25, %18
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @finditem(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %10
%6 = phi i32 [ %11, %10 ], [ 0, %3 ]
%7 = phi i32* [ %12, %10 ], [ %1, %3 ]
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = add nuw nsw i32 %6, 1
%12 = getelementptr inbounds i32, i32* %7, i64 1
%13 = icmp eq i32 %11, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %3
%15 = phi i32 [ 0, %3 ], [ 0, %10 ], [ 1, %5 ]
ret i32 %15
}
int put_io_context(struct io_context *ioc) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.io_context = type opaque
define i32 @put_io_context(%struct.io_context* nocapture readnone %0) {
ret i32 1
}
void __attribute__((constructor)) tiz_platform_load(void) {}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @tiz_platform_load, i8* null }]
define void @tiz_platform_load() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @tiz_platform_load() {
ret void
}
const char *convert_testfile_name(const char *fn) {
  if (fn[0] == '-' && fn[1] == '\0') {
    return "(STDIN)";
  }
  return fn;
}


x86 assembly (clang, -O0):
<convert_testfile_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1139 <convert_testfile_name+0x39>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1139 <convert_testfile_name+0x39>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1141 <convert_testfile_name+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_testfile_name>:
mov    %rdi,%rax
cmpb   $0x2d,(%rdi)
jne    110e <convert_testfile_name+0xe>
cmpb   $0x0,0x1(%rax)
je     110f <convert_testfile_name+0xf>
ret
lea    0xeea(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"(STDIN)\00"
define i8* @convert_testfile_name(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i8* [ %0, %8 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %4 ]
ret i8* %10
}
void driveRaw(int motorFL, int motorBL, int motorFR, int motorBR) {}


x86 assembly (clang, -O0):
<driveRaw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @driveRaw(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
ret void
}

LLVM IR (-O2):
define void @driveRaw(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
void free_env_val(char *value) {}


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

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

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

LLVM IR (-O2):
define void @free_env_val(i8* nocapture %0) {
ret void
}
void ExttDatacenterAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttDatacenterAuxTable() {
ret void
}
/* Variables and functions */
double *malloc(int);
void do_dbl_alloc(void **ppv) {
  double *pd = malloc(sizeof(double) * 3);
  pd[0] = 41;
  pd[1] = 42;
  pd[2] = 43;
  *ppv = pd;
}


x86 assembly (clang, -O0):
<do_dbl_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_dbl_alloc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x18,%edi
call   1030 <malloc@plt>
movaps 0xedb(%rip),%xmm0
movups %xmm0,(%rax)
movabs $0x4045800000000000,%rcx
80 45 40
mov    %rcx,0x10(%rax)
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @do_dbl_alloc(i8** %0) {
%2 = alloca i8**
%3 = alloca double*
store i8** %0, i8*** %2
%4 = call double* @malloc(i32 24)
store double* %4, double** %3
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
store double 4.100000e+01, double* %6
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 1
store double 4.200000e+01, double* %8
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 2
store double 4.300000e+01, double* %10
%11 = load double*, double** %3
%12 = bitcast double* %11 to i8*
%13 = load i8**, i8*** %2
store i8* %12, i8** %13
ret void
}

LLVM IR (-O2):
define void @do_dbl_alloc(i8** nocapture writeonly %0) {
%2 = tail call double* @malloc(i32 24)
%3 = bitcast double* %2 to <2 x double>*
store <2 x double> <double 4.100000e+01, double 4.200000e+01>, <2 x double>* %3
%4 = getelementptr inbounds double, double* %2, i64 2
store double 4.300000e+01, double* %4
%5 = bitcast i8** %0 to double**
store double* %2, double** %5
ret void
}
int f() { return (unsigned char)("\377"[0]); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movzbl 0xef5(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"\FF\00"
define i32 @f() {
%1 = load i8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%2 = zext i8 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @f() {
ret i32 255
}
int __attribute__((__no__)) f(unsigned *p, int *x) {
  int y = *p++ & 0xfff;
  *x++ = y;
  *x = *p;
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
and    $0xfff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0xfff,%eax
and    (%rdi),%eax
mov    %eax,(%rsi)
mov    0x4(%rdi),%ecx
mov    %ecx,0x4(%rsi)
ret

LLVM IR (-O0):
define i32 @f(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %3
%8 = load i32, i32* %6
%9 = and i32 %8, 4095
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %4
store i32 %10, i32* %11
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @f(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %0
%5 = and i32 %4, 4095
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %1
%7 = load i32, i32* %3
store i32 %7, i32* %6
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void stor_16(void *p, uint16_t v) {
  *(uint8_t *)p = v & 0xff;
  *(uint8_t *)(p + 1) = v >> 8;
}


x86 assembly (clang, -O0):
<stor_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stor_16>:
movzbl %sil,%eax
mov    %eax,(%rdi)
sar    $0x8,%esi
mov    %esi,0x1(%rdi)
ret

LLVM IR (-O0):
define void @stor_16(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 = and i32 %5, 255
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = load i8*, i8** %3
%12 = getelementptr i8, i8* %11, i64 1
%13 = bitcast i8* %12 to i32*
store i32 %10, i32* %13
ret void
}

LLVM IR (-O2):
define void @stor_16(i8* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = bitcast i8* %0 to i32*
store i32 %3, i32* %4
%5 = ashr i32 %1, 8
%6 = getelementptr i8, i8* %0, i64 1
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}
int is_hrv(int band) {
  int segs = 8;
  if (band == 12)
    segs = 24;
  return segs;
}


x86 assembly (clang, -O0):
<is_hrv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
cmpl   $0xc,-0x4(%rbp)
jne    111f <is_hrv+0x1f>
movl   $0x18,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hrv>:
xor    %eax,%eax
cmp    $0xc,%edi
sete   %al
shl    $0x4,%eax
or     $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @is_hrv(i32 %0) {
%2 = icmp eq i32 %0, 12
%3 = select i1 %2, i32 24, i32 8
ret i32 %3
}
/* Variables and functions */
char *strncat(char *, char const *, size_t);
char *r_strncat(char *dest, const char *src, size_t n) {
  return strncat(dest, src, n);
}


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

x86 assembly (clang, -O2):
<r_strncat>:
jmp    1030 <strncat@plt>

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

LLVM IR (-O2):
define i8* @r_strncat(i8* returned %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @strncat(i8* dereferenceable(1) %0, i8* %1, i64 %2)
ret i8* %0
}
int is_pythangorean(int a, int b, int c) {
  if (a * a + b * b == c * c)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_pythangorean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <is_pythangorean+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <is_pythangorean+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pythangorean>:
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
imul   %edx,%edx
xor    %eax,%eax
cmp    %edx,%esi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_pythangorean(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, %0
%5 = mul nsw i32 %1, %1
%6 = add nuw nsw i32 %5, %4
%7 = mul nsw i32 %2, %2
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ safe_raw_copy(char *, char const *, size_t, int);
void safe_char_copy(char *destination, const char *source, size_t number) {
  safe_raw_copy(destination, source, number, sizeof(char));
}


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

x86 assembly (clang, -O2):
<safe_char_copy>:
mov    $0x1,%ecx
jmp    1030 <safe_raw_copy@plt>

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

LLVM IR (-O2):
define void @safe_char_copy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @safe_raw_copy(i8* %0, i8* %1, i64 %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ report(int /*<<< orphan*/, unsigned int, char *, int,
                          int /*<<< orphan*/);
int /*<<< orphan*/ thread_start(int);
void signal_usr2(int signal) {
  report(0, ((unsigned int)0x00000020) | ((unsigned int)0x00000001),
         "Received signal %d (thread %d)\nEnabling Pipe thread\n", signal,
         pthread_self());
  thread_start(2);
}


x86 assembly (clang, -O0):
<signal_usr2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x8(%rbp),%ecx
mov    %eax,%r8d
xor    %edi,%edi
mov    $0x21,%esi
lea    0xea4(%rip),%rdx
call   1050 <report@plt>
mov    $0x2,%edi
call   1030 <thread_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_usr2>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xebf(%rip),%rdx
xor    %edi,%edi
mov    $0x21,%esi
mov    %ebx,%ecx
mov    %eax,%r8d
call   1050 <report@plt>
mov    $0x2,%edi
pop    %rbx
jmp    1030 <thread_start@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Received signal %d (thread %d)\0AEnabling Pipe thread\0A\00"
define void @signal_usr2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @pthread_self()
%5 = call i32 @report(i32 0, i32 33, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @thread_start(i32 2)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Received signal %d (thread %d)\0AEnabling Pipe thread\0A\00"
define void @signal_usr2(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @report(i32 0, i32 33, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
%4 = tail call i32 @thread_start(i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
scalar_t__ ZWRAP_isLittleEndian();
int ZWRAP_swap32(unsigned int);
int /*<<< orphan*/ memcpy(unsigned int *, void const *, int);
unsigned ZWRAP_readLE32(const void *ptr) {
  unsigned value;
  memcpy(&value, ptr, sizeof(value));
  if (ZWRAP_isLittleEndian())
    return value;
  else
    return ZWRAP_swap32(value);
}


x86 assembly (clang, -O0):
<ZWRAP_readLE32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    $0x0,%al
call   1050 <ZWRAP_isLittleEndian@plt>
cmp    $0x0,%rax
je     116a <ZWRAP_readLE32+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <ZWRAP_readLE32+0x45>
mov    -0x14(%rbp),%edi
call   1030 <ZWRAP_swap32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZWRAP_readLE32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
call   1050 <ZWRAP_isLittleEndian@plt>
mov    %rax,%rcx
mov    0x4(%rsp),%eax
test   %rcx,%rcx
je     1158 <ZWRAP_readLE32+0x28>
pop    %rcx
ret
mov    %eax,%edi
call   1030 <ZWRAP_swap32@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ZWRAP_readLE32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = call i64 (...) @ZWRAP_isLittleEndian()
%6 = icmp eq i64 %5, 0
%7 = load i32, i32* %2
br i1 %6, label %8, label %10
8: ; preds = %1
%9 = call i32 @ZWRAP_swap32(i32 %7)
br label %10
10: ; preds = %1, %8
%11 = phi i32 [ %9, %8 ], [ %7, %1 ]
ret i32 %11
}
/* Variables and functions */
int abs(int);
int formula(int stevilo, int a, int b) {
  return abs(stevilo * stevilo + a * stevilo + b);
}


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

x86 assembly (clang, -O2):
<formula>:
lea    (%rsi,%rdi,1),%ecx
imul   %edi,%ecx
add    %edx,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @formula(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* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = add nsw i32 %9, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = call i32 @abs(i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @formula(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, %0
%5 = mul i32 %4, %0
%6 = add nsw i32 %5, %2
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
ret i32 %7
}
int test_imm_81uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x81 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_81uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x81,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_81uint64_midword_reg>:
test   $0x810000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_81uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 129
%6 = icmp ne i64 %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_81uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8454144
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t strlncpy(char *, size_t, char const *, size_t);
size_t strlcpy(char *dst, const char *src, size_t len) {
  return strlncpy(dst, len, src, (size_t)-1);
}


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

x86 assembly (clang, -O2):
<strlcpy>:
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
mov    $0xffffffffffffffff,%rcx
jmp    1030 <strlncpy@plt>

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

LLVM IR (-O2):
define i64 @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlncpy(i8* %0, i64 %2, i8* %1, i64 -1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void quit() {
  fprintf(stderr, "split: write error\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"split: write error\0A\00"
define void @quit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"split: write error\0A\00"
define void @quit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ open_rdonly(char *);
int /*<<< orphan*/ statfs(char *, struct statfs *);
int execute_statfs() {
  struct statfs data;
  close(open_rdonly("syscalls.txt"));
  statfs("syscalls.txt", &data);
  statfs("hopefully_no_such_filename_exists.txt", &data);
  return 0;
}


x86 assembly (clang, -O0):
<execute_statfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,%edi
call   1040 <close@plt>
lea    0xeae(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <statfs@plt>
lea    0xeab(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <statfs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_statfs>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    %r14,%rdi
call   1030 <open_rdonly@plt>
mov    %eax,%edi
call   1040 <close@plt>
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <statfs@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1050 <statfs@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [13 x i8] c"syscalls.txt\00"
@.str.1 = [38 x i8] c"hopefully_no_such_filename_exists.txt\00"
define i32 @execute_statfs() {
%1 = alloca %struct.statfs
%2 = call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @close(i32 %2)
%4 = call i32 @statfs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%5 = call i32 @statfs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), %struct.statfs* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [13 x i8] c"syscalls.txt\00"
@.str.1 = [38 x i8] c"hopefully_no_such_filename_exists.txt\00"
define i32 @execute_statfs() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = tail call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @close(i32 %3)
%5 = call i32 @statfs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%6 = call i32 @statfs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), %struct.statfs* %1)
ret i32 0
}
void foo772() {}


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

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

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

LLVM IR (-O2):
define void @foo772() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprint(char *);
void kmain(void *mbd, unsigned int magic) {
  char *boot_loader_name = (char *)((long *)mbd)[16];
  if (magic != 0x2BADB002) {
  }
  kprint(boot_loader_name);
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x80(%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2badb002,-0xc(%rbp)
je     1140 <kmain+0x30>
jmp    1140 <kmain+0x30>
mov    -0x18(%rbp),%rdi
call   1030 <kprint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmain>:
mov    0x80(%rdi),%rdi
jmp    1030 <kprint@plt>

LLVM IR (-O0):
define void @kmain(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
%8 = getelementptr inbounds i64, i64* %7, i64 16
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 732803074
br i1 %12, label %13, label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %2
%15 = load i8*, i8** %5
%16 = call i32 @kprint(i8* %15)
ret void
}

LLVM IR (-O2):
define void @kmain(i8* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 128
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @kprint(i8* %6)
ret void
}
int main(void) {
  int a = 10;
  int b = 1;
  if (a > 1 && b)
    a = 0;
  else
    a = 1;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1139 <main+0x39>
cmpl   $0x0,-0xc(%rbp)
je     1139 <main+0x39>
movl   $0x0,-0x8(%rbp)
jmp    1140 <main+0x40>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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
store i32 10, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 0, i32* %2
br label %11
10: ; preds = %6, %0
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 10;
  int b = 20;
  int d;
  d = add(a, b);
  printf("%d+%d=%d\n", a, b, d);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d+%d=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 10, i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 %1)
ret i32 0
}
/* Variables and functions */
bool testme(char **name) {
  *name = "testme";
  return true;
}


x86 assembly (clang, -O0):
<testme>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xeed(%rip),%rcx
mov    %rcx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testme>:
lea    0xef9(%rip),%rax
mov    %rax,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"testme\00"
define i32 @testme(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
ret i32 1
}

LLVM IR (-O2):
@.str = [7 x i8] c"testme\00"
define i32 @testme(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %0
ret i32 1
}
void CRYPTO_dbg_set_options(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_dbg_set_options() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
const char *trim(const char *str) {
  while (isspace(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <trim+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <trim+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <trim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int BIT(int);
int wpa_key_mgmt_cckm(int akm) { return akm == BIT(14); }


x86 assembly (clang, -O0):
<wpa_key_mgmt_cckm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xe,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @wpa_key_mgmt_cckm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @BIT(i32 14)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_cckm(i32 %0) {
%2 = tail call i32 @BIT(i32 14)
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int mkdir(char *, int);
int /*<<< orphan*/ printf(char *);
void main() {
  int status = mkdir("tempdir", 0511);
  if (status != 0) {
    printf("mkdir failed!\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x149,%esi
call   1030 <mkdir@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1152 <main+0x32>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x149,%esi
call   1030 <mkdir@plt>
test   %eax,%eax
je     1143 <main+0x23>
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"tempdir\00"
@.str.1 = [15 x i8] c"mkdir failed!\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @mkdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 329)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"tempdir\00"
@str = [14 x i8] c"mkdir failed!\00"
define void @main() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 329)
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
const char *extract_long_option(const char *arg) { return &arg[2]; }


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

x86 assembly (clang, -O2):
<extract_long_option>:
lea    0x2(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @extract_long_option(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %2
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_start(void *bus) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_start>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_start(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Sound30(unsigned long, unsigned long);
void sound(unsigned long hz, unsigned long t) { Sound30(hz, t); }


x86 assembly (clang, -O0):
<sound>:
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 <Sound30@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sound>:
jmp    1030 <Sound30@plt>

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

LLVM IR (-O2):
define void @sound(i64 %0, i64 %1) {
%3 = tail call i32 @Sound30(i64 %0, i64 %1)
ret void
}