xunge/DecIR huggingface dataset:
int isdirectory(char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isdirectory(i8* nocapture readnone %0) {
ret i32 0
}
int xmax(int a, int b) { return a > b ? a : b; }


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

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

LLVM IR (-O0):
define i32 @xmax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @xmax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void and_m32_imm32(unsigned int *m32, unsigned int imm32) {
  put8(0x81);
  put8(0x25);
  put32((unsigned int)(m32));
  put32(imm32);
}


x86 assembly (clang, -O0):
<and_m32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x25,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
mov    -0xc(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_m32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x81,%edi
call   1030 <put8@plt>
mov    $0x25,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @and_m32_imm32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 129)
%6 = call i32 @put8(i32 37)
%7 = load i32*, i32** %3
%8 = ptrtoint i32* %7 to i32
%9 = call i32 @put32(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @put32(i32 %10)
ret void
}

LLVM IR (-O2):
define void @and_m32_imm32(i32* %0, i32 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = tail call i32 @put8(i32 37)
%5 = ptrtoint i32* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @put32(i32 %6)
%8 = tail call i32 @put32(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ afficherHighscore();
int /*<<< orphan*/ appuyezEntree(char *);
int /*<<< orphan*/ menuPrincipal();
void highscore(void) {
  afficherHighscore();
  appuyezEntree("Appuyez sur ENTREE pour revenir au menu principal...");
  menuPrincipal();
}


x86 assembly (clang, -O0):
<highscore>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <afficherHighscore@plt>
lea    0xebe(%rip),%rdi
call   1040 <appuyezEntree@plt>
mov    $0x0,%al
call   1030 <menuPrincipal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<highscore>:
push   %rax
xor    %eax,%eax
call   1050 <afficherHighscore@plt>
lea    0xec1(%rip),%rdi
call   1040 <appuyezEntree@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <menuPrincipal@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Appuyez sur ENTREE pour revenir au menu principal...\00"
define void @highscore() {
%1 = call i32 (...) @afficherHighscore()
%2 = call i32 @appuyezEntree(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @menuPrincipal()
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Appuyez sur ENTREE pour revenir au menu principal...\00"
define void @highscore() {
%1 = tail call i32 (...) @afficherHighscore()
%2 = tail call i32 @appuyezEntree(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @menuPrincipal()
ret void
}
void XSetLineAttributes() {}


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

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

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

LLVM IR (-O2):
define void @XSetLineAttributes() {
ret void
}
int execute_renameat() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_renameat() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_renameat() {
ret i32 0
}
/* Variables and functions */
int *Carto_evalbot_spiral(int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ print(char *, int, int, int);
int main() {
  int *call = Carto_evalbot_spiral(1);
  print("%i,%i,%i\n", call[0], call[1], call[2]);
  free(call);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <Carto_evalbot_spiral@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
lea    0xe9f(%rip),%rdi
call   1040 <print@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1050 <Carto_evalbot_spiral@plt>
mov    %rax,%rbx
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
lea    0xeb3(%rip),%rdi
call   1040 <print@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%i,%i,%i\0A\00"
define i32 @main() {
%1 = tail call i32* @Carto_evalbot_spiral(i32 1)
%2 = load i32, i32* %1
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = load i32, i32* %5
%7 = tail call i32 @print(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6)
%8 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Print MD2 (128-bit) checksums\n");
  printf("usage: md2sum <FILE>...\n\n");
  printf("  --help     display this help and exit\n");
  printf("  --version  output version information and exit\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
lea    0xf23(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Print MD2 (128-bit) checksums\0A\00"
@.str.1 = [26 x i8] c"usage: md2sum <FILE>...\0A\0A\00"
@.str.2 = [41 x i8] c" --help display this help and exit\0A\00"
@.str.3 = [50 x i8] c" --version output version information and exit\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Print MD2 (128-bit) checksums\00"
@str.4 = [25 x i8] c"usage: md2sum <FILE>...\0A\00"
@str.5 = [40 x i8] c" --help display this help and exit\00"
@str.6 = [49 x i8] c" --version output version information and exit\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
void service_clean(void) {
  unlink("/tmp/kbpm.sock");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<service_clean>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<service_clean>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/tmp/kbpm.sock\00"
@EXIT_SUCCESS = global i32 0
define void @service_clean() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"/tmp/kbpm.sock\00"
@EXIT_SUCCESS = global i32 0
define void @service_clean() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void disable_early_log(void) {}


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

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

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

LLVM IR (-O2):
define void @disable_early_log() {
ret void
}
float ffabs(float x) { return ((x >= 0) << 1) * x - x; }


x86 assembly (clang, -O0):
<ffabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffabs>:
xorps  %xmm2,%xmm2
cmpless %xmm0,%xmm2
movss  0xef0(%rip),%xmm1
andps  %xmm2,%xmm1
mulss  %xmm0,%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ffabs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = shl i32 %5, 1
%7 = sitofp i32 %6 to float
%8 = load float, float* %2
%9 = load float, float* %2
%10 = fneg float %9
%11 = call float @llvm.fmuladd.f32(float %7, float %8, float %10)
ret float %11
}

LLVM IR (-O2):
define float @ffabs(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 2.000000e+00, float 0.000000e+00
%4 = fneg float %0
%5 = tail call float @llvm.fmuladd.f32(float %3, float %0, float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintUsage(void) {
  printf("Usage: bdf2c [OPTIONs]\n"
         "\t-h or -?\tPrints this short page on stdout\n"
         "\t-b\tRead bdf file from stdin, write to stdout\n"
         "\t-c\tCreate font header on stdout\n"
         "\t-C file\tCreate font header file\n"
         "\t-n name\tName of c font variable (place it before -b)\n"
         "\t-O\tCreate outline for the font.\n");
  printf("\n\tOnly idiots print usage on stderr\n");
}


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

x86 assembly (clang, -O2):
<PrintUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [266 x i8] c"Usage: bdf2c [OPTIONs]\0A\09-h or -?\09Prints this short page on stdout\0A\09-b\09Read bdf file from stdin, write to stdout\0A\09-c\09Create font header on stdout\0A\09-C file\09Create font header file\0A\09-n name\09Name of c font variable (place it before -b)\0A\09-O\09Create outline for the font.\0A\00"
@.str.1 = [37 x i8] c"\0A\09Only idiots print usage on stderr\0A\00"
define void @PrintUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [265 x i8] c"Usage: bdf2c [OPTIONs]\0A\09-h or -?\09Prints this short page on stdout\0A\09-b\09Read bdf file from stdin, write to stdout\0A\09-c\09Create font header on stdout\0A\09-C file\09Create font header file\0A\09-n name\09Name of c font variable (place it before -b)\0A\09-O\09Create outline for the font.\00"
@str.2 = [36 x i8] c"\0A\09Only idiots print usage on stderr\00"
define void @PrintUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([265 x i8], [265 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0))
ret void
}
int number() { return 24; }


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

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

LLVM IR (-O0):
define i32 @number() {
ret i32 24
}

LLVM IR (-O2):
define i32 @number() {
ret i32 24
}
int is_terminator(const char *arg) { return arg[1] == '-' && arg[2] == '\0'; }


x86 assembly (clang, -O0):
<is_terminator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    112f <is_terminator+0x2f>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_terminator>:
xor    %eax,%eax
cmpb   $0x2d,0x1(%rdi)
jne    1111 <is_terminator+0x11>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_terminator(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void write16(volatile void *addr, uint16_t val) {
  *(volatile uint16_t *)addr = val;
}


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

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

LLVM IR (-O0):
define void @write16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @write16(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
int test_imm_79int64_midword_reg(long long val) {
  return ((val >> 16) & (0x79 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_79int64_midword_reg(i64 %0) {
%2 = and i64 %0, 7929856
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abms_system(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *);
void abms_chmod(char *perm, char *path) {
  char lcmd[255];
  sprintf(lcmd, "%s%s %s %s", "/app/os/sys/bin/", "chmod", perm, path);
  abms_system(lcmd);
}


x86 assembly (clang, -O0):
<abms_chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    0xeb7(%rip),%rsi
lea    0xebb(%rip),%rdx
lea    0xec5(%rip),%rcx
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <abms_system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abms_chmod>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xed9(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s%s %s %s\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [6 x i8] c"chmod\00"
define void @abms_chmod(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [255 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @abms_system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s%s %s %s\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [6 x i8] c"chmod\00"
define void @abms_chmod(i8* %0, i8* %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @abms_system(i8* %4)
ret void
}
unsigned int hash(char *s) {
  unsigned int hashval = 0;
  for (int i = 0; *(s + i) != '\0'; ++i) {
    hashval = s + hashval * 31;
  }
  return hashval % 100;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1149 <hash+0x49>
mov    -0x8(%rbp),%rax
imul   $0x1f,-0xc(%rbp),%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash+0x16>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
cmpb   $0x0,(%rdi)
je     1139 <hash+0x39>
lea    0x1(%rdi),%rcx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %rdx,%rax
add    %rdi,%rax
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x51eb851f,%rcx,%rcx
shr    $0x25,%rcx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %20, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = mul i32 %15, 31
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = ptrtoint i8* %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %5
23: ; preds = %5
%24 = load i32, i32* %3
%25 = urem i32 %24, 100
ret i32 %25
}

LLVM IR (-O2):
define i32 @hash(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %8, label %10
4: ; preds = %10
%5 = ptrtoint i8* %15 to i64
%6 = trunc i64 %5 to i32
%7 = urem i32 %6, 100
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
10: ; preds = %1, %10
%11 = phi i64 [ %17, %10 ], [ 0, %1 ]
%12 = phi i64 [ %16, %10 ], [ 0, %1 ]
%13 = mul i64 %12, 31
%14 = and i64 %13, 4294967295
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = ptrtoint i8* %15 to i64
%17 = add nuw nsw i64 %11, 1
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %4, label %10
}
/* Variables and functions */
int /*<<< orphan*/ strtr_in_place(char *, size_t, char, char);
void replace_cr_ln_in_place(char *s, size_t l) {
  strtr_in_place(s, l, '\r', ' ');
  strtr_in_place(s, l, '\n', ' ');
}


x86 assembly (clang, -O0):
<replace_cr_ln_in_place>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xd,%edx
mov    $0x20,%ecx
call   1030 <strtr_in_place@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xa,%edx
mov    $0x20,%ecx
call   1030 <strtr_in_place@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_cr_ln_in_place>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xd,%edx
mov    $0x20,%ecx
call   1030 <strtr_in_place@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
mov    $0x20,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strtr_in_place@plt>

LLVM IR (-O0):
define void @replace_cr_ln_in_place(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @strtr_in_place(i8* %5, i64 %6, i8 signext 13, i8 signext 32)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @strtr_in_place(i8* %8, i64 %9, i8 signext 10, i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @replace_cr_ln_in_place(i8* %0, i64 %1) {
%3 = tail call i32 @strtr_in_place(i8* %0, i64 %1, i8 signext 13, i8 signext 32)
%4 = tail call i32 @strtr_in_place(i8* %0, i64 %1, i8 signext 10, i8 signext 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tk_putc(int /*<<< orphan*/);
void tk_puts_n(char *msg, int n) {
  char *s;
  s = msg;
  while (n--) {
    tk_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<tk_puts_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1157 <tk_puts_n+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
call   1030 <tk_putc@plt>
jmp    1127 <tk_puts_n+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tk_puts_n>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <tk_puts_n+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <tk_putc@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <tk_puts_n+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @tk_puts_n(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
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = call i32 @tk_putc(i32 %15)
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @tk_puts_n(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = tail call i32 @tk_putc(i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __test1();
int /*<<< orphan*/ __test2();
int main(int argc, char **argv) {
  __test1();
  __test2();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__test1@plt>
mov    $0x0,%al
call   1040 <__test2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @__test1()
%7 = call i32 (...) @__test2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @__test1()
%4 = tail call i32 (...) @__test2()
ret i32 0
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
int hea_u32_bit(int);
int hea_test_u32_bit(__u32 v, int b) { return !!(v & hea_u32_bit(b)); }


x86 assembly (clang, -O0):
<hea_test_u32_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <hea_u32_bit@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_test_u32_bit>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <hea_u32_bit@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hea_test_u32_bit(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 = call i32 @hea_u32_bit(i32 %6)
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @hea_test_u32_bit(i32 %0, i32 %1) {
%3 = tail call i32 @hea_u32_bit(i32 %1)
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog = [55 x i8] c"SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog\00"
define void @SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @__func__.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog = [55 x i8] c"SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog\00"
define void @SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @__func__.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_min_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_min_ss(__m128 A, __m128 B) { return _mm_min_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_min_ss>:
jmp    1030 <_mm_min_ss@plt>

LLVM IR (-O0):
define i32 @test_mm_min_ss(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 = call i32 @_mm_min_ss(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_min_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_min_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ malloc_recursive(int);
int main(void) {
  malloc_recursive(100);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @malloc_recursive(i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @malloc_recursive(i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmx_fio_close(int);
void close_trn(int fp) { gmx_fio_close(fp); }


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

x86 assembly (clang, -O2):
<close_trn>:
jmp    1030 <gmx_fio_close@plt>

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

LLVM IR (-O2):
define void @close_trn(i32 %0) {
%2 = tail call i32 @gmx_fio_close(i32 %0)
ret void
}
/* Variables and functions */
#define EAGAIN 130
#define ENOMEM 129
#define EPERM 128
int cop_translate_err(int err) {
  switch (err) {
  case 0:
    return 0;
  case EPERM:
    return (3);
  case EAGAIN:
    return (1);
  case ENOMEM:
    return (6);
  default:
    return (5);
  }
}


x86 assembly (clang, -O0):
<cop_translate_err>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1153 <cop_translate_err+0x53>
jmp    111a <cop_translate_err+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
je     115f <cop_translate_err+0x5f>
jmp    112d <cop_translate_err+0x2d>
mov    -0xc(%rbp),%eax
sub    $0x81,%eax
je     1177 <cop_translate_err+0x77>
jmp    1140 <cop_translate_err+0x40>
mov    -0xc(%rbp),%eax
sub    $0x82,%eax
je     116b <cop_translate_err+0x6b>
jmp    1183 <cop_translate_err+0x83>
movl   $0x0,-0x4(%rbp)
jmp    118a <cop_translate_err+0x8a>
movl   $0x3,-0x4(%rbp)
jmp    118a <cop_translate_err+0x8a>
movl   $0x1,-0x4(%rbp)
jmp    118a <cop_translate_err+0x8a>
movl   $0x6,-0x4(%rbp)
jmp    118a <cop_translate_err+0x8a>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_translate_err>:
mov    %edi,%eax
cmp    $0x80,%edi
jg     111b <cop_translate_err+0x1b>
test   %eax,%eax
je     1134 <cop_translate_err+0x34>
cmp    $0x80,%eax
jne    112f <cop_translate_err+0x2f>
mov    $0x3,%eax
ret
cmp    $0x81,%eax
je     1135 <cop_translate_err+0x35>
cmp    $0x82,%eax
jne    112f <cop_translate_err+0x2f>
mov    $0x1,%eax
ret
mov    $0x5,%eax
ret
mov    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @cop_translate_err(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 128, label %6
i32 130, label %7
i32 129, label %8
]
5: ; preds = %1
store i32 0, i32* %2
br label %10
6: ; preds = %1
store i32 3, i32* %2
br label %10
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1
store i32 6, i32* %2
br label %10
9: ; preds = %1
store i32 5, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @cop_translate_err(i32 %0) {
switch i32 %0, label %5 [
i32 0, label %6
i32 128, label %2
i32 130, label %3
i32 129, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i32 [ 5, %5 ], [ 6, %4 ], [ 1, %3 ], [ 3, %2 ], [ %0, %1 ]
ret i32 %7
}
int poll(struct pollfd *pfds, int nfds, int timeout) {
  int r;
  __asm__ __volatile__("\tint $0x80\n"
                       : "=a"(r)
                       : "a"(168), "b"(pfds), "c"(nfds), "d"(timeout)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<poll>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
mov    $0xa8,%eax
int    $0x80
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x0,%al
call   1030 <set_errno@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<poll>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rbx
mov    $0xa8,%eax
int    $0x80
mov    %eax,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
%struct.pollfd = type opaque
define i32 @poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pollfd*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.pollfd* %0, %struct.pollfd** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.pollfd*, %struct.pollfd** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 168, %struct.pollfd* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.pollfd = type opaque
define i32 @poll(%struct.pollfd* %0, i32 %1, i32 %2) {
%4 = tail call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 168, %struct.pollfd* %0, i32 %1, i32 %2)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %4)
ret i32 %5
}
/* Variables and functions */
double aa_horner3(double, int, int, int);
double aa_tf_sinc_series2(double theta2) {
  return aa_horner3(theta2, 1., -1. / 6, 1. / 120);
}


x86 assembly (clang, -O0):
<aa_tf_sinc_series2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <aa_horner3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_tf_sinc_series2>:
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <aa_horner3@plt>

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

LLVM IR (-O2):
define double @aa_tf_sinc_series2(double %0) {
%2 = tail call double @aa_horner3(double %0, i32 1, i32 0, i32 0)
ret double %2
}
int toupper(int c) { return (c >= 'a' && c <= 'z') ? c + ('A' - 'a') : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1129 <toupper+0x29>
cmpl   $0x7a,-0x4(%rbp)
jg     1129 <toupper+0x29>
mov    -0x4(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <toupper+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int main(void) {
  int a = 1;
  int *b;
  b += a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = load i32*, i32** %3
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
store i32* %7, i32** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void bar(__int128_t *dst, __int128_t src) { *dst = ~src; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rdi,-0x18(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
not    %rcx
not    %rdx
mov    -0x18(%rbp),%rax
mov    %rdx,0x8(%rax)
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
not    %rsi
not    %rdx
mov    %rdx,0x8(%rdi)
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @bar(i128* %0, i64 %1, i64 %2) {
%4 = alloca i128
%5 = alloca i128*
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %1, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %2, i64* %9
%10 = load i128, i128* %4
store i128* %0, i128** %5
store i128 %10, i128* %6
%11 = load i128, i128* %6
%12 = xor i128 %11, -1
%13 = load i128*, i128** %5
store i128 %12, i128* %13
ret void
}

LLVM IR (-O2):
define void @bar(i128* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = zext i64 %2 to i128
%5 = shl nuw i128 %4, 64
%6 = zext i64 %1 to i128
%7 = or i128 %5, %6
%8 = xor i128 %7, -1
store i128 %8, i128* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void writelines(char *lineptr[], int nlines) {
  while (nlines-- > 0)
    printf("%s\n", *lineptr++);
}


x86 assembly (clang, -O0):
<writelines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1158 <writelines+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <writelines+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelines>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <writelines+0x36>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x8,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <writelines+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8** [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp ugt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret void
}
int mdrv_sd_get_status(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @mdrv_sd_get_status() {
ret i32 0
}

LLVM IR (-O2):
define i32 @mdrv_sd_get_status() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(int /*<<< orphan*/ *);
void EVP_MD_meth_free(EVP_MD *md) { OPENSSL_free(md); }


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

x86 assembly (clang, -O2):
<EVP_MD_meth_free>:
jmp    1030 <OPENSSL_free@plt>

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

LLVM IR (-O2):
define void @EVP_MD_meth_free(i32* %0) {
%2 = tail call i32 @OPENSSL_free(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ yyparse();
void parseConfigFile() {
  extern FILE *yyin;
  yyin = fopen("pwatch.conf", "r");
  if (!yyin) {
    (void)perror("failed to open config file: ");
  } else {
    (void)yyparse();
    (void)fclose(yyin);
  }
}


x86 assembly (clang, -O0):
<parseConfigFile>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rcx
mov    0x2e7f(%rip),%rax
mov    %rcx,(%rax)
mov    0x2e75(%rip),%rax
cmpq   $0x0,(%rax)
jne    1186 <parseConfigFile+0x46>
lea    0xe92(%rip),%rdi
call   1060 <perror@plt>
jmp    119c <parseConfigFile+0x5c>
mov    $0x0,%al
call   1030 <yyparse@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%rdi
call   1040 <fclose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseConfigFile>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1050 <fopen@plt>
mov    0x2e85(%rip),%rbx
mov    %rax,(%rbx)
test   %rax,%rax
je     1173 <parseConfigFile+0x33>
xor    %eax,%eax
call   1030 <yyparse@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1040 <fclose@plt>
lea    0xe94(%rip),%rdi
pop    %rbx
jmp    1060 <perror@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"pwatch.conf\00"
@.str.1 = [2 x i8] c"r\00"
@yyin = external global i32*
@.str.2 = [29 x i8] c"failed to open config file: \00"
define void @parseConfigFile() {
%1 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %1, i32** @yyin
%2 = load i32*, i32** @yyin
%3 = icmp ne i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %10
6: ; preds = %0
%7 = call i32 (...) @yyparse()
%8 = load i32*, i32** @yyin
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"pwatch.conf\00"
@.str.1 = [2 x i8] c"r\00"
@yyin = external global i32*
@.str.2 = [29 x i8] c"failed to open config file: \00"
define void @parseConfigFile() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %1, i32** @yyin
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = tail call i32 (...) @yyparse()
%7 = load i32*, i32** @yyin
%8 = tail call i32 @fclose(i32* %7)
br label %9
9: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_capad_function_list();
void capad_init() { register_capad_function_list(); }


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

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

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

LLVM IR (-O2):
define void @capad_init() {
%1 = tail call i32 (...) @register_capad_function_list()
ret void
}