xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *argv0) {
  printf("Usage: %s <options>\n options:\n"
         "\tp - print\n"
         "\ts string - set buffer\n"
         "\tg - get buffer\n"
         "\td - down\n"
         "\tu - up\n"
         "\tn - open with O_NONBLOCK and read data\n",
         argv0);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [139 x i8] c"Usage: %s <options>\0A options:\0A\09p - print\0A\09s string - set buffer\0A\09g - get buffer\0A\09d - down\0A\09u - up\0A\09n - open with O_NONBLOCK and read data\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [139 x i8] c"Usage: %s <options>\0A options:\0A\09p - print\0A\09s string - set buffer\0A\09g - get buffer\0A\09d - down\0A\09u - up\0A\09n - open with O_NONBLOCK and read data\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void TIM6_DAC_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TIM6_DAC_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct psmouse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ synaptics_mode_cmd(struct psmouse *, int /*<<< orphan*/);
void synaptics_reset(struct psmouse *psmouse) {
  synaptics_mode_cmd(psmouse, 0);
}


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

x86 assembly (clang, -O2):
<synaptics_reset>:
xor    %esi,%esi
jmp    1030 <synaptics_mode_cmd@plt>

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

LLVM IR (-O2):
%struct.psmouse = type { i32 }
define void @synaptics_reset(%struct.psmouse* %0) {
%2 = tail call i32 @synaptics_mode_cmd(%struct.psmouse* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ say(char *);
void concerned(void) {
  say("DAVE...STOP., STOP, WILL YOU..., STOP, DAVE...");
  say("WILL YOU STOP, DAVE...");
  say("STOP, DAVE...");
}


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

x86 assembly (clang, -O2):
<concerned>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <say@plt>
lea    0xf0b(%rip),%rdi
call   1030 <say@plt>
lea    0xef1(%rip),%rdi
pop    %rax
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"DAVE...STOP., STOP, WILL YOU..., STOP, DAVE...\00"
@.str.1 = [23 x i8] c"WILL YOU STOP, DAVE...\00"
@.str.2 = [14 x i8] c"STOP, DAVE...\00"
define void @concerned() {
%1 = call i32 @say(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @say(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @say(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"DAVE...STOP., STOP, WILL YOU..., STOP, DAVE...\00"
@.str.1 = [23 x i8] c"WILL YOU STOP, DAVE...\00"
@.str.2 = [14 x i8] c"STOP, DAVE...\00"
define void @concerned() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @say(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @say(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int hash(int key) { return key % 32; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %edi,%eax
lea    0x1f(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xffffffe0,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = srem i32 %0, 32
ret i32 %2
}
void ff_hevc_put_hevc_bi_epel_h16_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h16_12_sse4() {
ret void
}
char *unpad(char *str) {
  for (; *str == ' '; str++)
    ;
  return str;
}


x86 assembly (clang, -O0):
<unpad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    112e <unpad+0x2e>
jmp    111d <unpad+0x1d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <unpad+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpad>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <unpad+0x10>
ret

LLVM IR (-O0):
define i8* @unpad(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %12
8: ; preds = %3
br label %9
9: ; preds = %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %3
12: ; preds = %3
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @unpad(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
void g_type_interface_prerequisites() {}


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

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

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

LLVM IR (-O2):
define void @g_type_interface_prerequisites() {
ret void
}
/* Variables and functions */
int flash_image(void *, unsigned int, char *);
int flash_esp(void *data, unsigned sz) { return flash_image(data, sz, "ESP"); }


x86 assembly (clang, -O0):
<flash_esp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <flash_image@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_esp>:
lea    0xee9(%rip),%rdx
jmp    1030 <flash_image@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"ESP\00"
define i32 @flash_esp(i8* %0, i32 %1) {
%3 = tail call i32 @flash_image(i8* %0, i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int test_function(char *name, int fail) {
  printf(" test of %10s ", name);
  if (fail)
    printf("FAILED\n");
  else
    printf("passed\n");
  return fail;
}


x86 assembly (clang, -O0):
<test_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     114e <test_function+0x3e>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115c <test_function+0x4c>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_function>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
lea    0xed2(%rip),%rax
lea    0xed2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c" test of %10s \00"
@.str.1 = [8 x i8] c"FAILED\0A\00"
@.str.2 = [8 x i8] c"passed\0A\00"
define i32 @test_function(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [15 x i8] c" test of %10s \00"
@str = [7 x i8] c"passed\00"
@str.3 = [7 x i8] c"FAILED\00"
define i32 @test_function(i8* %0, i32 returned %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %1
}
/* Variables and functions */
void *malloc(unsigned long);
void *flash_malloc(unsigned long size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @flash_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int is_space(char ch) {
  switch (ch) {
  case ' ':
  case '\t':
  case '\n':
  case '\r':
  case '\a':
  case '\f':
  case '\v':
  case '\0':
  case ';':
  case ',':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1176 <is_space+0x76>
jmp    111e <is_space+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
je     1176 <is_space+0x76>
jmp    112f <is_space+0x2f>
mov    -0xc(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     1176 <is_space+0x76>
jmp    1143 <is_space+0x43>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1176 <is_space+0x76>
jmp    1154 <is_space+0x54>
mov    -0xc(%rbp),%eax
sub    $0x2c,%eax
je     1176 <is_space+0x76>
jmp    1165 <is_space+0x65>
mov    -0xc(%rbp),%eax
sub    $0x3b,%eax
jne    1182 <is_space+0x82>
jmp    1176 <is_space+0x76>
movl   $0x1,-0x4(%rbp)
jmp    1189 <is_space+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
cmp    $0x3b,%edi
ja     111d <is_space+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x800100100003e81,%rdx
bt     %rcx,%rdx
jae    111d <is_space+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 32, label %6
i32 9, label %6
i32 10, label %6
i32 13, label %6
i32 7, label %6
i32 12, label %6
i32 11, label %6
i32 0, label %6
i32 59, label %6
i32 44, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 32, label %4
i32 9, label %4
i32 10, label %4
i32 13, label %4
i32 7, label %4
i32 12, label %4
i32 11, label %4
i32 0, label %4
i32 59, label %4
i32 44, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
void init_cpu_clock(void) {}


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

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

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

LLVM IR (-O2):
define void @init_cpu_clock() {
ret void
}
int fun1243() { return 1243; }


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

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

LLVM IR (-O0):
define i32 @fun1243() {
ret i32 1243
}

LLVM IR (-O2):
define i32 @fun1243() {
ret i32 1243
}
/* Variables and functions */
unsigned short csum_fold(int /*<<< orphan*/);
int /*<<< orphan*/ csum_partial(unsigned char *, int, int /*<<< orphan*/);
unsigned short ip_compute_csum(unsigned char *buf, int len) {
  return csum_fold(csum_partial(buf, len, 0));
}


x86 assembly (clang, -O0):
<ip_compute_csum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <csum_partial@plt>
mov    %eax,%edi
call   1040 <csum_fold@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_compute_csum>:
push   %rax
xor    %edx,%edx
call   1030 <csum_partial@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <csum_fold@plt>

LLVM IR (-O0):
define zeroext i16 @ip_compute_csum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @csum_partial(i8* %5, i32 %6, i32 0)
%8 = call zeroext i16 @csum_fold(i32 %7)
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @ip_compute_csum(i8* %0, i32 %1) {
%3 = tail call i32 @csum_partial(i8* %0, i32 %1, i32 0)
%4 = tail call zeroext i16 @csum_fold(i32 %3)
ret i16 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_nest_lock_t;

/* Variables and functions */
int c_pomp_test_nest_lock_(omp_nest_lock_t *s) { (void)0; }


x86 assembly (clang, -O0):
<c_pomp_test_nest_lock_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @c_pomp_test_nest_lock_(i32* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
struct HMAC_CTX {
  int dummy;
};
struct DeferralContext {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ breakpoint();
int /*<<< orphan*/ printk(char *, char *);
int /*<<< orphan*/ show_stack(void *);
void apply_deferrals(struct HMAC_CTX *hmac_ctx,
                     struct DeferralContext *deferral_ctx) {
  do {
    if (!(0)) {
      printk("kgdb assertion failed: %s\n", "BUG");
      show_stack(((void *)0));
      breakpoint();
    }
  } while (0);
}


x86 assembly (clang, -O0):
<apply_deferrals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <printk@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <show_stack@plt>
mov    $0x0,%al
call   1040 <breakpoint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_deferrals>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <printk@plt>
xor    %edi,%edi
call   1050 <show_stack@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <breakpoint@plt>

LLVM IR (-O0):
%struct.HMAC_CTX = type { i32 }
%struct.DeferralContext = type { i32 }
@.str = [27 x i8] c"kgdb assertion failed: %s\0A\00"
@.str.1 = [4 x i8] c"BUG\00"
define void @apply_deferrals(%struct.HMAC_CTX* %0, %struct.DeferralContext* %1) {
%3 = alloca %struct.HMAC_CTX*
%4 = alloca %struct.DeferralContext*
store %struct.HMAC_CTX* %0, %struct.HMAC_CTX** %3
store %struct.DeferralContext* %1, %struct.DeferralContext** %4
br label %5
5: ; preds = %2
%6 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @show_stack(i8* null)
%8 = call i32 (...) @breakpoint()
br label %9
9: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.HMAC_CTX = type { i32 }
%struct.DeferralContext = type { i32 }
@.str = [27 x i8] c"kgdb assertion failed: %s\0A\00"
@.str.1 = [4 x i8] c"BUG\00"
define void @apply_deferrals(%struct.HMAC_CTX* nocapture readnone %0, %struct.DeferralContext* nocapture readnone %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 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 @show_stack(i8* null)
%5 = tail call i32 (...) @breakpoint()
ret void
}
char *copystr(char *s) { return s; }


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

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

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

LLVM IR (-O2):
define i8* @copystr(i8* readnone returned %0) {
ret i8* %0
}
void vc_dispmanx_set_wl_buffer_in_use(struct wl_resource *_buffer, int in_use) {
}


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

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

LLVM IR (-O0):
%struct.wl_resource = type opaque
define void @vc_dispmanx_set_wl_buffer_in_use(%struct.wl_resource* %0, i32 %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type opaque
define void @vc_dispmanx_set_wl_buffer_in_use(%struct.wl_resource* nocapture %0, i32 %1) {
ret void
}
void P_bufferclose() {}


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

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

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

LLVM IR (-O2):
define void @P_bufferclose() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x2b() {
  Assert_real((isspace(43) == 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_isspace.c",
              220, ("isspace should be 0 for +"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for +\00"
define void @t_isspace_0x2b() {
%1 = call i64 @isspace(i32 43)
%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 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for +\00"
define void @t_isspace_0x2b() {
%1 = tail call i64 @isspace(i32 43)
%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 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void lock_log_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @lock_log_lock() {
ret void
}
void mulvf(float *result, const float *v, const float m) {
  result[0] = v[0] * m;
  result[1] = v[1] * m;
  result[2] = v[2] * m;
}


x86 assembly (clang, -O0):
<mulvf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulvf>:
movss  (%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @mulvf(float* %0, float* %1, float %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float %2, float* %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float, float* %6
%11 = fmul float %9, %10
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %5
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float, float* %6
%18 = fmul float %16, %17
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 1
store float %18, float* %20
%21 = load float*, float** %5
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
%24 = load float, float* %6
%25 = fmul float %23, %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 2
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @mulvf(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fmul float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fmul float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 2;
  int b = 3;
  printf("1. main_b = %d\n", b);
  printf("main_a = %d\n", a);
  foo();
  printf("2. main_b = %d\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <foo@plt>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <foo@plt>
lea    0xecc(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"1. main_b = %d\0A\00"
@.str.1 = [13 x i8] c"main_a = %d\0A\00"
@.str.2 = [16 x i8] c"2. main_b = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 (...) @foo()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int __cvmx_helper_srio_probe(int);
int __cvmx_helper_srio_enumerate(int interface) {
  return __cvmx_helper_srio_probe(interface);
}


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

x86 assembly (clang, -O2):
<__cvmx_helper_srio_enumerate>:
jmp    1030 <__cvmx_helper_srio_probe@plt>

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

LLVM IR (-O2):
define i32 @__cvmx_helper_srio_enumerate(i32 %0) {
%2 = tail call i32 @__cvmx_helper_srio_probe(i32 %0)
ret i32 %2
}
/* Variables and functions */
double pow(int, float);
float sp_midi2cps(float nn) { return pow(2, (nn - 69.0) / 12.0) * 440.0; }


x86 assembly (clang, -O0):
<sp_midi2cps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xeac(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_midi2cps>:
push   %rax
cvtss2sd %xmm0,%xmm0
addsd  0xee3(%rip),%xmm0
divsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xed5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sp_midi2cps(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 6.900000e+01
%6 = fdiv double %5, 1.200000e+01
%7 = fptrunc double %6 to float
%8 = call double @pow(i32 2, float %7)
%9 = fmul double %8, 4.400000e+02
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @sp_midi2cps(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -6.900000e+01
%4 = fdiv double %3, 1.200000e+01
%5 = fptrunc double %4 to float
%6 = tail call double @pow(i32 2, float %5)
%7 = fmul double %6, 4.400000e+02
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_string(int /*<<< orphan*/, char const *);
void print_emerg(const char *str) { __console_tx_string(0, str); }


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

x86 assembly (clang, -O2):
<print_emerg>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <__console_tx_string@plt>

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

LLVM IR (-O2):
define void @print_emerg(i8* %0) {
%2 = tail call i32 @__console_tx_string(i32 0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void error2(char *s1, char *s2) {
  static char msg[80];
  sprintf(msg, "%s\"%s\"", s1, s2);
  error(msg);
}


x86 assembly (clang, -O0):
<error2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0x2f01(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2eee(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error2>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x2f12(%rip),%rbx
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <error@plt>

LLVM IR (-O0):
@error2.msg = internal global [80 x i8] zeroinitializer
@.str = [7 x i8] c"%s\22%s\22\00"
define void @error2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @sprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @error2.msg, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 @error(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @error2.msg, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@error2.msg = internal global [80 x i8] zeroinitializer
@.str = [7 x i8] c"%s\22%s\22\00"
define void @error2(i8* %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @error2.msg, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @error(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @error2.msg, i64 0, i64 0))
ret void
}
void av_pix_fmt_swap_endianness() {}


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

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

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

LLVM IR (-O2):
define void @av_pix_fmt_swap_endianness() {
ret void
}
unsigned int f(unsigned int a) { return a * 65536 / 8; }


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

x86 assembly (clang, -O2):
<f>:
movzwl %di,%eax
shl    $0xd,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = shl i32 %0, 13
%3 = and i32 %2, 536862720
ret i32 %3
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ usecs_elapsed(struct timespec, struct timespec);
void bench_end(struct timespec start) {
  struct timespec end;
  clock_gettime(CLOCK_MONOTONIC_RAW, &end);
  printf("benched usecs: %lu\n", usecs_elapsed(start, end));
}


x86 assembly (clang, -O0):
<bench_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <usecs_elapsed@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_end>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
mov    0x8(%rsp),%esi
mov    %ebx,%edi
call   1050 <usecs_elapsed@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
@.str = [20 x i8] c"benched usecs: %lu\0A\00"
define void @bench_end(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %0, i32* %4
%5 = load i32, i32* @CLOCK_MONOTONIC_RAW
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @usecs_elapsed(i32 %8, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
@.str = [20 x i8] c"benched usecs: %lu\0A\00"
define void @bench_end(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_MONOTONIC_RAW
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @usecs_elapsed(i32 %0, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
int mystrlen(char *str) {
  int len = 0;
  while (str[len] != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <mystrlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <mystrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ LCD_SET_A0();
int /*<<< orphan*/ Send1(int /*<<< orphan*/);
void LCD_X_WriteM01(unsigned char *pData, int NumBytes) {
  ;
  LCD_SET_A0();
  for (; NumBytes; NumBytes--) {
    Send1(*pData++);
  };
}


x86 assembly (clang, -O0):
<LCD_X_WriteM01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <LCD_SET_A0@plt>
cmpl   $0x0,-0xc(%rbp)
je     1165 <LCD_X_WriteM01+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <Send1@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <LCD_X_WriteM01+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_WriteM01>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <LCD_SET_A0@plt>
test   %ebp,%ebp
je     1152 <LCD_X_WriteM01+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <Send1@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1140 <LCD_X_WriteM01+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @LCD_X_WriteM01(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @LCD_SET_A0()
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = zext i8 %12 to i32
%14 = call i32 @Send1(i32 %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, -1
store i32 %17, i32* %4
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @LCD_X_WriteM01(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (...) @LCD_SET_A0()
%4 = icmp eq i32 %1, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ %1, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = zext i8 %9 to i32
%11 = tail call i32 @Send1(i32 %10)
%12 = add nsw i32 %6, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct hostent {
  int /*<<< orphan*/ *h_addr_list;
};
typedef int /*<<< orphan*/ ip;

/* Variables and functions */
struct hostent *gethostbyname(char const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
uint32_t gethostaddr(const char *host) {
  struct hostent *hp;
  uint32_t ip;
  hp = gethostbyname(host);
  memcpy(&ip, hp->h_addr_list[0], sizeof(ip));
  return ip;
}


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

x86 assembly (clang, -O2):
<gethostaddr>:
push   %rax
call   1030 <gethostbyname@plt>
mov    (%rax),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32* }
define i32 @gethostaddr(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hostent*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call %struct.hostent* @gethostbyname(i8* %5)
store %struct.hostent* %6, %struct.hostent** %3
%7 = load %struct.hostent*, %struct.hostent** %3
%8 = getelementptr inbounds %struct.hostent, %struct.hostent* %7, i32 0, i32 0
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = call i32 @memcpy(i32* %4, i32 %11, i32 4)
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
%struct.hostent = type { i32* }
define i32 @gethostaddr(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call %struct.hostent* @gethostbyname(i8* %0)
%5 = getelementptr inbounds %struct.hostent, %struct.hostent* %4, i64 0, i32 0
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = call i32 @memcpy(i32* %2, i32 %7, i32 4)
%9 = load i32, i32* %2
ret i32 %9
}
/* Variables and functions */
int strcmp(char *, char *);
int strcmp_asc(const void *a, const void *b) {
  return strcmp(*((char **)a), *((char **)b));
}


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

x86 assembly (clang, -O2):
<strcmp_asc>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strcmp_asc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @strcmp_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ checkIntInput(int *);
char *last_digit_to_word(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int number;
  printf("Enter number: ");
  checkIntInput(&number);
  char *lastDigitAsWord = last_digit_to_word(number);
  printf("%s", lastDigitAsWord);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <checkIntInput@plt>
mov    -0x8(%rbp),%edi
call   1030 <last_digit_to_word@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <checkIntInput@plt>
mov    0x4(%rsp),%edi
call   1030 <last_digit_to_word@plt>
lea    0xeb6(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Enter number: \00"
@.str.1 = [3 x i8] c"%s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkIntInput(i32* %1)
%5 = load i32, i32* %1
%6 = call i8* @last_digit_to_word(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: %s script [-Ealnru] [-i extension] [file ...]\n"
                "\t%s [-Ealnu] [-i extension] [-e script] ... [-f script_file]"
                " ... [file ...]\n",
                getprogname(), getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rdx
mov    %rax,%rcx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [130 x i8] c"usage: %s script [-Ealnru] [-i extension] [file ...]\0A\09%s [-Ealnu] [-i extension] [-e script] ... [-f script_file] ... [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i8* (...) @getprogname()
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [130 x i8] c"usage: %s script [-Ealnru] [-i extension] [file ...]\0A\09%s [-Ealnu] [-i extension] [-e script] ... [-f script_file] ... [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i8* (...) @getprogname()
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}