xunge/DecIR huggingface dataset:
int test_imm_14int8_mem(signed char *val) {
  return ((*val) & (0x14 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_14int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 20
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pr_depth(int depth) {
  for (int i = 0; i < depth; i++) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<pr_depth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <pr_depth+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <pr_depth+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_depth>:
push   %rbx
test   %edi,%edi
jle    112f <pr_depth+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <pr_depth+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @pr_depth(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
int max(a, b)
int a, b;
{
  if (a < b) {
    return (b);
  } else {
    return (a);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
void copyOrFree(void (*freeFunc)(const void *), const void *value,
                const void **valPtr) {
  if (valPtr != NULL)
    *valPtr = value;
  else
    freeFunc(value);
}


x86 assembly (clang, -O0):
<copyOrFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     112f <copyOrFree+0x2f>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    1139 <copyOrFree+0x39>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyOrFree>:
test   %rdx,%rdx
je     1109 <copyOrFree+0x9>
mov    %rsi,(%rdx)
ret
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @copyOrFree(void (i8*)* nocapture %0, i8* %1, i8** writeonly %2) {
%4 = icmp eq i8** %2, null
br i1 %4, label %6, label %5
5: ; preds = %3
store i8* %1, i8** %2
br label %7
6: ; preds = %3
tail call void %0(i8* %1)
br label %7
7: ; preds = %6, %5
ret void
}
int fn6(int x[]) { return sizeof x; }


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

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

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

LLVM IR (-O2):
define i32 @fn6(i32* nocapture readnone %0) {
ret i32 8
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cli_print(struct cli_def *, char *, char const *);
int hook_quit(struct cli_def *cli, const char *command, char *argv[],
              int argc) {
  cli_print(cli, "Hook (quit): %s", command);
  return 0;
}


x86 assembly (clang, -O0):
<hook_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rsi
call   1030 <cli_print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hook_quit>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <cli_print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [16 x i8] c"Hook (quit): %s\00"
define i32 @hook_quit(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.cli_def*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load %struct.cli_def*, %struct.cli_def** %5
%10 = load i8*, i8** %6
%11 = call i32 @cli_print(%struct.cli_def* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@.str = [16 x i8] c"Hook (quit): %s\00"
define i32 @hook_quit(%struct.cli_def* %0, i8* %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @cli_print(%struct.cli_def* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ getLine2(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char line[1000];
  while (getLine2(line) > 0) {
    reverse(line);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <getLine2@plt>
cmp    $0x0,%rax
jle    117c <main+0x4c>
lea    -0x3f0(%rbp),%rdi
call   1040 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
call   1030 <getLine2@plt>
test   %rax,%rax
jle    1180 <main+0x50>
mov    %rsp,%rbx
lea    0xeaf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <getLine2@plt>
test   %rax,%rax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @getLine2(i8* %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i64 @getLine2(i8* %2)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
int test_imm_90int32_reg(int val) { return ((val) & (0x90 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_90int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x90,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_90int32_reg>:
test   $0x90,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_90int32_reg(i32 %0) {
%2 = and i32 %0, 144
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
PutChar(c) { putchar(c); }


x86 assembly (clang, -O0):
<PutChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @PutChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @PutChar(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f2(void) { printf("f2\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"f2\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *getoptdata(char const *, int /*<<< orphan*/, char *);
char *get_option(const char *option, char *default_value) {
  return getoptdata(option, 0, default_value);
}


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

x86 assembly (clang, -O2):
<get_option>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <getoptdata@plt>

LLVM IR (-O0):
define i8* @get_option(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 i8* @getoptdata(i8* %5, i32 0, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_option(i8* %0, i8* %1) {
%3 = tail call i8* @getoptdata(i8* %0, i32 0, i8* %1)
ret i8* %3
}
/* Variables and functions */
char *PICA_id_to_base64(unsigned char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
void file_finished(const unsigned char *peer_id, int sending) {
  printf("file_finished: peer_id %s\n", PICA_id_to_base64(peer_id, NULL));
}


x86 assembly (clang, -O0):
<file_finished>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <PICA_id_to_base64@plt>
mov    %rax,%rsi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_finished>:
push   %rax
xor    %esi,%esi
call   1030 <PICA_id_to_base64@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"file_finished: peer_id %s\0A\00"
define void @file_finished(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 i8* @PICA_id_to_base64(i8* %5, i32* null)
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"file_finished: peer_id %s\0A\00"
define void @file_finished(i8* %0, i32 %1) {
%3 = tail call i8* @PICA_id_to_base64(i8* %0, i32* null)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void _M2_dtoa_finish(void) {}


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

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

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

LLVM IR (-O2):
define void @_M2_dtoa_finish() {
ret void
}
int omap5_usb_phy_partial_powerup(struct device *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define i32 @omap5_usb_phy_partial_powerup(%struct.device* nocapture readnone %0) {
ret i32 0
}
void Convert16To8Row_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @Convert16To8Row_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ convert(char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  char s[78];
  int num, base;
  scanf("%d", &num);
  scanf("%d", &base);
  convert(s, num, base);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xec1(%rip),%rdi
lea    -0x54(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x58(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1030 <convert@plt>
lea    -0x50(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [78 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [78 x i8], [78 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @convert(i8* %4, i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
void g_type_module_register_flags() {}


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

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

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

LLVM IR (-O2):
define void @g_type_module_register_flags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int lerp(int v0, int v1, int t) {
  printf("Call function "
         "lerp"
         ": ");
  return (1 - t) * v0 + t * v1;
}


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

x86 assembly (clang, -O2):
<lerp>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
sub    %ebx,%eax
imul   %r14d,%eax
imul   %ebx,%ebp
add    %eax,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Call function lerp: \00"
define i32 @lerp(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 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %6
%9 = sub nsw i32 1, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
@.str = [21 x i8] c"Call function lerp: \00"
define i32 @lerp(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = sub nsw i32 1, %2
%6 = mul nsw i32 %5, %0
%7 = mul nsw i32 %2, %1
%8 = add nsw i32 %6, %7
ret i32 %8
}
void g_pattern_spec_free() {}


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

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

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

LLVM IR (-O2):
define void @g_pattern_spec_free() {
ret void
}
int foo(int x, int y) { return x * y; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
enum nss_status _nss_inject_sethostent(int persist) {
  return NSS_STATUS_SUCCESS;
}


x86 assembly (clang, -O0):
<_nss_inject_sethostent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_inject_sethostent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_inject_sethostent(i32 %0) {
%2 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef unsigned char volatile uint32_t;

/* Variables and functions */
uint32_t USBModeGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned char *)(ui32Base + 0x00000060))) &
          (0x00000080 | 0x00000004 | 0x00000001 | 0x00000018));
}


x86 assembly (clang, -O0):
<USBModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%eax
add    $0x60,%eax
cltq
mov    (%rax),%al
movzbl %al,%eax
and    $0x9d,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBModeGet>:
mov    %dil,-0x1(%rsp)
movzbl -0x1(%rsp),%eax
mov    0x60(%rax),%al
and    $0x9d,%al
ret

LLVM IR (-O0):
define zeroext i8 @USBModeGet(i8 zeroext %0) {
%2 = alloca i8
store volatile i8 %0, i8* %2
%3 = load volatile i8, i8* %2
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, 96
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = load volatile i8, i8* %7
%9 = zext i8 %8 to i32
%10 = and i32 %9, 157
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @USBModeGet(i8 zeroext %0) {
%2 = alloca i8
store volatile i8 %0, i8* %2
%3 = load volatile i8, i8* %2
%4 = zext i8 %3 to i64
%5 = add nuw nsw i64 %4, 96
%6 = inttoptr i64 %5 to i8*
%7 = load volatile i8, i8* %6
%8 = and i8 %7, -99
ret i8 %8
}
void le_write32(void *addr, const unsigned value) {
  unsigned char *p = (unsigned char *)addr;
  p[0] = value;
  p[1] = value >> 8;
  p[2] = value >> 16;
  p[3] = value >> 24;
}


x86 assembly (clang, -O0):
<le_write32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @le_write32(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
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = lshr i32 %16, 16
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i32, i32* %4
%22 = lshr i32 %21, 24
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @le_write32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x8c() {
  Assert_real((isalpha(140) == 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_isalpha.c",
              705, ("isalpha should be 0 for 0x8c"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x8c>:
push   %rax
mov    $0x8c,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2c1,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x8c\00"
define void @t_isalpha_0x8c() {
%1 = call i64 @isalpha(i32 140)
%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 705, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x8c\00"
define void @t_isalpha_0x8c() {
%1 = tail call i64 @isalpha(i32 140)
%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 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int libaft_internal_surfmeshrefiner_ss_setup(double);
int surface_refine_setup_cf(double cf) {
  return libaft_internal_surfmeshrefiner_ss_setup(cf);
}


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

x86 assembly (clang, -O2):
<surface_refine_setup_cf>:
jmp    1030 <libaft_internal_surfmeshrefiner_ss_setup@plt>

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

LLVM IR (-O2):
define i32 @surface_refine_setup_cf(double %0) {
%2 = tail call i32 @libaft_internal_surfmeshrefiner_ss_setup(double %0)
ret i32 %2
}
int __syscall3(int call, unsigned long arg0, unsigned long arg1,
               unsigned long arg2) {
  int rc;
  asm volatile("movl %[call], %%eax	\n"
               "movl %[arg0], %%ebx	\n"
               "movl %[arg1], %%ecx	\n"
               "movl %[arg2], %%edx	\n"
               "int  %[xnum]		\n"
               "movl %%eax, %[rc]	\n"
               : [rc] "=g"(rc)
               : [call] "g"(call), [arg0] "g"(arg0), [arg1] "g"(arg1),
                 [arg2] "g"(arg2), [xnum] "i"(0x80)
               : "%eax", "%ebx", "%ecx", "%edx", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<__syscall3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %esi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x38(%rbp),%ebx
mov    -0x40(%rbp),%ecx
mov    -0x48(%rbp),%edx
int    $0x80
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__syscall3(i32 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store i32 %0, i32* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i32, i32* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i32, i32* %9
ret i32 %14
}

LLVM IR (-O2):
/* Variables and functions */
int usleep(int);
int delay(int ms) { return usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define i32 @delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void mc_printer_assign(int flag) { do_csi("?%di", flag ? 18 : 19); }


x86 assembly (clang, -O0):
<mc_printer_assign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x13,%esi
mov    $0x12,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xecb(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_printer_assign>:
xor    %esi,%esi
test   %edi,%edi
sete   %sil
or     $0x12,%esi
lea    0xede(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"?%di\00"
define void @mc_printer_assign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 18, i32 19
%7 = call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"?%di\00"
define void @mc_printer_assign(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 19, i32 18
%4 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int sort_utils_string_cmp(const void *const a, const void *const b) {
  const char **x = (const char **)a;
  const char **y = (const char **)b;
  return strcmp(*x, *y);
}


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

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

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

LLVM IR (-O2):
define i32 @sort_utils_string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int geti();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ syscall(int, int, int /*<<< orphan*/);
int exit() {
  int exitValue;
  printf("enter an exitValue: ");
  exitValue = geti();
  printf("enter kernel to die with exitValue=%d\n", exitValue);
  syscall(6, exitValue, 0);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <geti@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    $0x6,%edi
xor    %edx,%edx
call   1040 <syscall@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <geti@plt>
mov    %eax,%ebx
lea    0xec6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x6,%edi
mov    %ebx,%esi
xor    %edx,%edx
call   1040 <syscall@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"enter an exitValue: \00"
@.str.1 = [39 x i8] c"enter kernel to die with exitValue=%d\0A\00"
define i32 @exit() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @geti()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @syscall(i32 6, i32 %6, i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"enter an exitValue: \00"
@.str.1 = [39 x i8] c"enter kernel to die with exitValue=%d\0A\00"
define i32 @exit() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @geti()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @syscall(i32 6, i32 %2, i32 0)
unreachable
}
int test_imm_13uint16_mem(unsigned short *val) {
  return ((*val) & (-0x13 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_13uint16_mem>:
movzwl (%rdi),%eax
test   $0xffed,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_13uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -19
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_NextRepeatOutOfContext(long p_position) {
  _Error(p_position, "'next repeat' must appear within a repeat");
}


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

x86 assembly (clang, -O2):
<Error_NextRepeatOutOfContext>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"'next repeat' must appear within a repeat\00"
define void @Error_NextRepeatOutOfContext(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"'next repeat' must appear within a repeat\00"
define void @Error_NextRepeatOutOfContext(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int is_bad_inode(struct inode *);
int VN_BAD(struct inode *vp) { return is_bad_inode(vp); }


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

x86 assembly (clang, -O2):
<VN_BAD>:
jmp    1030 <is_bad_inode@plt>

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

LLVM IR (-O2):
%struct.inode = type { i32 }
define i32 @VN_BAD(%struct.inode* %0) {
%2 = tail call i32 @is_bad_inode(%struct.inode* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ emu_reset();
int cmd_reset() {
  emu_reset();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @cmd_reset() {
%1 = call i32 (...) @emu_reset()
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_reset() {
%1 = tail call i32 (...) @emu_reset()
ret i32 0
}
float *herwig6_addressf_(float *arg) { return arg; }


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

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

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

LLVM IR (-O2):
define float* @herwig6_addressf_(float* readnone returned %0) {
ret float* %0
}
__attribute__((no, noclone)) unsigned short foo5(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1 << (sizeof(char) * 8 - 1)) : 0) + 1 ||
      arg + 1 > ((!1) ? ((1 << (sizeof(char) * 8 - 1)) - 1)
                      : ((1 << (sizeof(char) * 8)) - 1)) -
                    1)
    return ret;
  arg = arg + 1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo5>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x1,%eax
jl     1133 <foo5+0x33>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xfe,%eax
jle    1140 <foo5+0x40>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115e <foo5+0x5e>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo5>:
lea    0x1(%rdi),%ecx
cmp    $0xfe,%edi
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo5(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %7, 1
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 1
%13 = icmp sgt i32 %12, 254
br i1 %13, label %14, label %16
14: ; preds = %9, %1
%15 = load i16, i16* %4
store i16 %15, i16* %2
br label %25
16: ; preds = %9
%17 = load i16, i16* %3
%18 = zext i16 %17 to i32
%19 = add nsw i32 %18, 1
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i16, i16* %3
%22 = trunc i16 %21 to i8
%23 = zext i8 %22 to i16
store i16 %23, i16* %4
%24 = load i16, i16* %3
store i16 %24, i16* %2
br label %25
25: ; preds = %16, %14
%26 = load i16, i16* %2
ret i16 %26
}

LLVM IR (-O2):
define zeroext i16 @foo5(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 253
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
/* Variables and functions */
int fright(int);
int getch();
int findright(void) {
  int c = getch();
  if (c < 0 || c > 255)
    return 1;
  return fright(c);
}


x86 assembly (clang, -O0):
<findright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1149 <findright+0x29>
cmpl   $0xff,-0x8(%rbp)
jle    1155 <findright+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1160 <findright+0x40>
mov    -0x8(%rbp),%edi
call   1040 <fright@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findright>:
push   %rax
xor    %eax,%eax
call   1030 <getch@plt>
cmp    $0xff,%eax
jbe    1136 <findright+0x16>
mov    $0x1,%eax
pop    %rcx
ret
mov    %eax,%edi
pop    %rax
jmp    1040 <fright@plt>

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

LLVM IR (-O2):
define i32 @findright() {
%1 = tail call i32 (...) @getch()
%2 = icmp ugt i32 %1, 255
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fright(i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 1, %0 ]
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_cb_90_res_2(uint8_t value) { return value & 0xfb; }


x86 assembly (clang, -O0):
<z80_cb_90_res_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfb,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z80_cb_90_res_2>:
mov    %edi,%eax
and    $0xfb,%eax
ret

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

LLVM IR (-O2):
define i32 @z80_cb_90_res_2(i32 %0) {
%2 = and i32 %0, 251
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int error_raise(int /*<<< orphan*/);
int /*<<< orphan*/ strerror(scalar_t__);
int error_raise_errno(void) {
  assert(errno != 0);
  return (error_raise(strerror(errno)));
}


x86 assembly (clang, -O0):
<error_raise_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rdi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1040 <error_raise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_raise_errno>:
push   %rbx
mov    0x2ea8(%rip),%rbx
xor    %edi,%edi
cmpq   $0x0,(%rbx)
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%rdi
call   1050 <strerror@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <error_raise@plt>

LLVM IR (-O0):
@errno = global i64 0
define i32 @error_raise_errno() {
%1 = load i64, i64* @errno
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = load i64, i64* @errno
%6 = call i32 @strerror(i64 %5)
%7 = call i32 @error_raise(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @error_raise_errno() {
%1 = load i64, i64* @errno
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i64, i64* @errno
%6 = tail call i32 @strerror(i64 %5)
%7 = tail call i32 @error_raise(i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ SYS_fcntl;
int syscall3(int /*<<< orphan*/, int, int, int);
int sys_fcntl(int fd, int cmd, int arg) {
  return syscall3(SYS_fcntl, fd, cmd, arg);
}


x86 assembly (clang, -O0):
<sys_fcntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <syscall3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_fcntl>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall3@plt>

LLVM IR (-O0):
@SYS_fcntl = global i32 0
define i32 @sys_fcntl(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* @SYS_fcntl
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @syscall3(i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@SYS_fcntl = global i32 0
define i32 @sys_fcntl(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @SYS_fcntl
%5 = tail call i32 @syscall3(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32 %5
}
void dummy_bswap4(unsigned char *b) { ; }


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

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

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

LLVM IR (-O2):
define void @dummy_bswap4(i8* nocapture %0) {
ret void
}
void um_early_printk(const char *s, unsigned int n) { printf("%.*s", n, s); }


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

x86 assembly (clang, -O2):
<um_early_printk>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.*s\00"
define void @um_early_printk(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret void
}
/* Variables and functions */
float log(float);
double logaritmica(float t) {
  float resultado;
  resultado = log(t);
  return resultado;
}


x86 assembly (clang, -O0):
<logaritmica>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logaritmica>:
push   %rax
call   1030 <log@plt>
cvtss2sd %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logaritmica(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @log(float %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fpext float %6 to double
ret double %7
}

LLVM IR (-O2):
define double @logaritmica(float %0) {
%2 = tail call float @log(float %0)
%3 = fpext float %2 to double
ret double %3
}
void dumper_finalize() {}


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

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

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

LLVM IR (-O2):
define void @dumper_finalize() {
ret void
}