xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void panic_tek() {
  fprintf(
      stderr,
      "This edimg cannot process *.tek or other compressed files. Aborted.\n");
  exit(-12341234);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [69 x i8] c"This edimg cannot process *.tek or other compressed files. Aborted.\0A\00"
define void @panic_tek() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -12341234)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"This edimg cannot process *.tek or other compressed files. Aborted.\0A\00"
define void @panic_tek() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -12341234)
unreachable
}
/* Type definitions */
typedef scalar_t__ int8_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ INT8_MAX;
scalar_t__ INT8_MIN;
int8_t __hsail_sat_add_s8(int8_t a, int8_t b) {
  int16_t c = (int16_t)a + (int16_t)b;
  if (c > INT8_MAX)
    return INT8_MAX;
  else if (c < INT8_MIN)
    return INT8_MIN;
  else
    return c;
}


x86 assembly (clang, -O0):
<__hsail_sat_add_s8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2eb5(%rip),%rcx
cmp    (%rcx),%rax
jle    113f <__hsail_sat_add_s8+0x3f>
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <__hsail_sat_add_s8+0x6e>
mov    -0x20(%rbp),%rax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
jge    1166 <__hsail_sat_add_s8+0x66>
mov    0x2e8e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <__hsail_sat_add_s8+0x6e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sat_add_s8>:
add    %rsi,%rdi
mov    0x2ece(%rip),%rcx
mov    0x2ed7(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rdi
cmovge %rdi,%rax
mov    (%rcx),%rcx
cmp    %rcx,%rdi
cmovg  %rcx,%rax
ret

LLVM IR (-O0):
@INT8_MAX = global i64 0
@INT8_MIN = global i64 0
define i64 @__hsail_sat_add_s8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = add nsw i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = load i64, i64* @INT8_MAX
%12 = icmp sgt i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i64, i64* @INT8_MAX
store i64 %14, i64* %3
br label %23
15: ; preds = %2
%16 = load i64, i64* %6
%17 = load i64, i64* @INT8_MIN
%18 = icmp slt i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i64, i64* @INT8_MIN
store i64 %20, i64* %3
br label %23
21: ; preds = %15
%22 = load i64, i64* %6
store i64 %22, i64* %3
br label %23
23: ; preds = %21, %19, %13
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
@INT8_MAX = global i64 0
@INT8_MIN = global i64 0
define i64 @__hsail_sat_add_s8(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = load i64, i64* @INT8_MAX
%5 = icmp sgt i64 %3, %4
%6 = load i64, i64* @INT8_MIN
%7 = icmp slt i64 %3, %6
%8 = select i1 %7, i64 %6, i64 %3
%9 = select i1 %5, i64 %4, i64 %8
ret i64 %9
}
/* Variables and functions */
char KthIndexFromEnd(char *, int);
int /*<<< orphan*/ printf(char *, char);
int main() {
  char c = KthIndexFromEnd("123456", 3);
  printf("%c\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x3,%esi
call   1030 <KthIndexFromEnd@plt>
mov    %al,-0x1(%rbp)
lea    0xec4(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"123456\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call signext i8 @KthIndexFromEnd(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %1)
ret i32 0
}
/* Type definitions */
struct cmd_context {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_lockd_type(char const *);
int /*<<< orphan*/ log_error(char *);
int lockd_gl_create(struct cmd_context *cmd, const char *def_mode,
                    const char *vg_lock_type) {
  if (is_lockd_type(vg_lock_type)) {
    log_error("Using a shared lock type requires lvmlockd.");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<lockd_gl_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <is_lockd_type@plt>
cmp    $0x0,%rax
je     115f <lockd_gl_create+0x3f>
lea    0xeb2(%rip),%rdi
call   1030 <log_error@plt>
movl   $0x0,-0x4(%rbp)
jmp    1166 <lockd_gl_create+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockd_gl_create>:
push   %rax
mov    %rdx,%rdi
call   1040 <is_lockd_type@plt>
test   %rax,%rax
je     113e <lockd_gl_create+0x1e>
lea    0xecb(%rip),%rdi
call   1030 <log_error@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cmd_context = type { i32 }
@.str = [44 x i8] c"Using a shared lock type requires lvmlockd.\00"
define i32 @lockd_gl_create(%struct.cmd_context* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.cmd_context*
%6 = alloca i8*
%7 = alloca i8*
store %struct.cmd_context* %0, %struct.cmd_context** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %7
%9 = call i64 @is_lockd_type(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @log_error(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %14
13: ; preds = %3
store i32 1, i32* %4
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
%struct.cmd_context = type { i32 }
@.str = [44 x i8] c"Using a shared lock type requires lvmlockd.\00"
define i32 @lockd_gl_create(%struct.cmd_context* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = tail call i64 @is_lockd_type(i8* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @log_error(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %9
}
int test_imm_E8int16_mem(short *val) {
  return ((*val) & (-0xE8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E8int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -232
%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_E8int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -232
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void min_heapswap(struct some **a, struct some **b) {
  struct some *tmp = *b;
  *b = *a;
  *a = tmp;
}


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

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

LLVM IR (-O0):
%struct.some = type opaque
define void @min_heapswap(%struct.some** %0, %struct.some** %1) {
%3 = alloca %struct.some**
%4 = alloca %struct.some**
%5 = alloca %struct.some*
store %struct.some** %0, %struct.some*** %3
store %struct.some** %1, %struct.some*** %4
%6 = load %struct.some**, %struct.some*** %4
%7 = load %struct.some*, %struct.some** %6
store %struct.some* %7, %struct.some** %5
%8 = load %struct.some**, %struct.some*** %3
%9 = load %struct.some*, %struct.some** %8
%10 = load %struct.some**, %struct.some*** %4
store %struct.some* %9, %struct.some** %10
%11 = load %struct.some*, %struct.some** %5
%12 = load %struct.some**, %struct.some*** %3
store %struct.some* %11, %struct.some** %12
ret void
}

LLVM IR (-O2):
%struct.some = type opaque
define void @min_heapswap(%struct.some** nocapture %0, %struct.some** nocapture %1) {
%3 = load %struct.some*, %struct.some** %1
%4 = load %struct.some*, %struct.some** %0
store %struct.some* %4, %struct.some** %1
store %struct.some* %3, %struct.some** %0
ret void
}
/* Variables and functions */
int bar(int);
int main(void) { return bar(16); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x10,%edi
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 16)
ret i32 %1
}
char *strcat(char *dest, const char *src) {
  printf("%s: not implemented\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"%s: not implemented\0A\00"
@__func__.strcat = [7 x i8] c"strcat\00"
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.strcat, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s: not implemented\0A\00"
@__func__.strcat = [7 x i8] c"strcat\00"
define noalias i8* @strcat(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.strcat, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
char *readcpustat();
int /*<<< orphan*/ sscanf(char *, char *, int *, int *, int *);
void getcputimes(int *usertime, int *nicetime, int *systime) {
  char *line = readcpustat();
  sscanf(line, "cpu %d %d %d", usertime, nicetime, systime);
}


x86 assembly (clang, -O0):
<getcputimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <readcpustat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeaa(%rip),%rsi
call   1040 <sscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcputimes>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <readcpustat@plt>
lea    0xec4(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
mov    %r15,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <sscanf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"cpu %d %d %d\00"
define void @getcputimes(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = call i8* (...) @readcpustat()
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = load i32*, i32** %4
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %10, i32* %11, i32* %12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"cpu %d %d %d\00"
define void @getcputimes(i32* %0, i32* %1, i32* %2) {
%4 = tail call i8* (...) @readcpustat()
%5 = tail call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int rand();
uint8_t co_rand_byte(void) { return (uint8_t)(rand() & 0xFF); }


x86 assembly (clang, -O0):
<co_rand_byte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_rand_byte>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @co_rand_byte() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 255
ret i32 %2
}

LLVM IR (-O2):
define i32 @co_rand_byte() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 255
ret i32 %2
}
void redecl4(void) {}


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

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

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

LLVM IR (-O2):
define void @redecl4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void commit(const char *message) {
  printf("git commit -a -m \"%s\"\n", message);
}


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

x86 assembly (clang, -O2):
<commit>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"git commit -a -m \22%s\22\0A\00"
define void @commit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"git commit -a -m \22%s\22\0A\00"
define void @commit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int do_something(int a, int b, int (*funct)(int, int)) { return funct(a, b); }


x86 assembly (clang, -O0):
<do_something>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_something>:
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @do_something(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, size_t);
void nullify(void *data, size_t size) { memset(data, '\0', size); }


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

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

LLVM IR (-O0):
define void @nullify(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 @memset(i8* %5, i8 signext 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @nullify(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i8 signext 0, i64 %1)
ret void
}
int xmlUCSIsHighSurrogates(int code) {
  return (((code >= 0xD800) && (code <= 0xDB7F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsHighSurrogates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xd800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsHighSurrogates+0x26>
cmpl   $0xdb7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsHighSurrogates>:
add    $0xffff2800,%edi
xor    %eax,%eax
cmp    $0x380,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsHighSurrogates(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 55296
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 56191
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsHighSurrogates(i32 %0) {
%2 = add i32 %0, -55296
%3 = icmp ult i32 %2, 896
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hmac_free(void *);
void crypto_free_mac_context(void *ctx, int mac) {
  switch (mac) {
  case 1:
  case 2:
    hmac_free(ctx);
  }
}


x86 assembly (clang, -O0):
<crypto_free_mac_context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x1,%eax
ja     113c <crypto_free_mac_context+0x2c>
jmp    1133 <crypto_free_mac_context+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <hmac_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_free_mac_context>:
add    $0xffffffff,%esi
cmp    $0x1,%esi
ja     111d <crypto_free_mac_context+0xd>
jmp    1030 <hmac_free@plt>
ret

LLVM IR (-O0):
define void @crypto_free_mac_context(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
switch i32 %5, label %9 [
i32 1, label %6
i32 2, label %6
]
6: ; preds = %2, %2
%7 = load i8*, i8** %3
%8 = call i32 @hmac_free(i8* %7)
br label %9
9: ; preds = %6, %2
ret void
}

LLVM IR (-O2):
define void @crypto_free_mac_context(i8* %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @hmac_free(i8* %0)
br label %7
7: ; preds = %2, %5
ret void
}
char *font_get_name(struct tff_file_hdr *tff) { return "nofontname"; }


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

x86 assembly (clang, -O2):
<font_get_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tff_file_hdr = type opaque
@.str = [11 x i8] c"nofontname\00"
define i8* @font_get_name(%struct.tff_file_hdr* %0) {
%2 = alloca %struct.tff_file_hdr*
store %struct.tff_file_hdr* %0, %struct.tff_file_hdr** %2
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tff_file_hdr = type opaque
@.str = [11 x i8] c"nofontname\00"
define i8* @font_get_name(%struct.tff_file_hdr* nocapture readnone %0) {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void print_ls_compare(char *title, long v1, long v2, char *cont) {
  if (v1 != v2) {
    printf("FAILED - %10s\n", title);
    strcpy(cont, "P");
  } else
    printf("%-10s ......OK \n", title);
}


x86 assembly (clang, -O0):
<print_ls_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     116b <print_ls_compare+0x4b>
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcpy@plt>
jmp    117b <print_ls_compare+0x5b>
mov    -0x8(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ls_compare>:
mov    %rdi,%rax
cmp    %rdx,%rsi
jne    1137 <print_ls_compare+0x17>
lea    0xee2(%rip),%rdi
mov    %rax,%rsi
jmp    1040 <printf@plt>
push   %rbx
mov    %rcx,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"FAILED - %10s\0A\00"
@.str.1 = [2 x i8] c"P\00"
@.str.2 = [17 x i8] c"%-10s ......OK \0A\00"
define void @print_ls_compare(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = icmp eq i64 %1, %2
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %9, %6
ret void
}
int test_imm_02uint16_mem(unsigned short *val) {
  return ((*val) & (-0x02 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_02uint16_mem>:
cmpw   $0x2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_02uint16_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, -2
%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_02uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 2
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((always_)) const int xispinfl(long double x) {
  return x == __builtin_infl();
}


x86 assembly (clang, -O0):
<xispinfl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xispinfl>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
ret

LLVM IR (-O0):
define i32 @xispinfl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp oeq x86_fp80 %3, 0xK7FFF8000000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @xispinfl(x86_fp80 %0) {
%2 = fcmp oeq x86_fp80 %0, 0xK7FFF8000000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int psw_read_bit(int);
int psw_read_ac(void) { return psw_read_bit(6); }


x86 assembly (clang, -O0):
<psw_read_ac>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <psw_read_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<psw_read_ac>:
mov    $0x6,%edi
jmp    1030 <psw_read_bit@plt>

LLVM IR (-O0):
define i32 @psw_read_ac() {
%1 = call i32 @psw_read_bit(i32 6)
ret i32 %1
}

LLVM IR (-O2):
define i32 @psw_read_ac() {
%1 = tail call i32 @psw_read_bit(i32 6)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int check(char *prefix, int n) {
  if (n < 0) {
    perror(prefix);
    exit(1);
  } else {
    return n;
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <check+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %esi,%esi
js     1127 <check+0x7>
mov    %esi,%eax
ret
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @check(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @check(i8* nocapture %0, i32 returned %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret i32 %1
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void add(char lhs[], char rhs[], char sum[]) {
  int lnum = atoi(lhs);
  int rnum = atoi(rhs);
  sprintf(sum, "%d", lnum + rnum);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
add    -0x20(%rbp),%edx
lea    0xea3(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <atoi@plt>
add    %eax,%ebp
lea    0xebe(%rip),%rsi
mov    %r14,%rdi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @add(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %7
%11 = load i8*, i8** %5
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %8
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = add nsw i32 %14, %15
%17 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @add(i8* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @atoi(i8* %0)
%5 = tail call i32 @atoi(i8* %1)
%6 = add nsw i32 %5, %4
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
void wx11cs(y_size) float *y_size;
{}


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

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

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

LLVM IR (-O2):
define void @wx11cs(float* nocapture %0) {
ret void
}
unsigned int ceil2(unsigned int a, unsigned int b) {
  return (b > 0) ? (a / b + ((a % b) ? 1 : 0)) : 0;
}


x86 assembly (clang, -O0):
<ceil2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1143 <ceil2+0x43>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %edx,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <ceil2+0x4d>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <ceil2+0x4d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil2>:
test   %esi,%esi
je     1111 <ceil2+0x11>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ceil2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ugt i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = udiv i32 %8, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = urem i32 %11, %12
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
%17 = add i32 %10, %16
br label %19
18: ; preds = %2
br label %19
19: ; preds = %18, %7
%20 = phi i32 [ %17, %7 ], [ 0, %18 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @ceil2(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = udiv i32 %0, %1
%6 = urem i32 %0, %1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = add i32 %5, %8
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_abi_endian(void) {
  int result = 1;
  {
    printf("C "
           "KWIML_ABI_ENDIAN_ID: unknown, FAILED\n");
    result = 0;
  }
  return result;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"C KWIML_ABI_ENDIAN_ID: unknown, FAILED\0A\00"
define i32 @test_abi_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"C KWIML_ABI_ENDIAN_ID: unknown, FAILED\00"
define i32 @test_abi_endian() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ efp_banner();
int /*<<< orphan*/ puts(int /*<<< orphan*/);
void efp_print_banner(void) { puts(efp_banner()); }


x86 assembly (clang, -O0):
<efp_print_banner>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <efp_banner@plt>
mov    %eax,%edi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<efp_print_banner>:
push   %rax
xor    %eax,%eax
call   1040 <efp_banner@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @efp_print_banner() {
%1 = call i32 (...) @efp_banner()
%2 = call i32 @puts(i32 %1)
ret void
}

LLVM IR (-O2):
define void @efp_print_banner() {
%1 = tail call i32 (...) @efp_banner()
%2 = tail call i32 @puts(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_adcimm(int /*<<< orphan*/, int);
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_cmp(int, int);
void emit_cmphi(int s1, int s2, int sr, int temp) {
  emit_andimm(sr, ~1, sr);
  emit_cmp(s1, s2);
  emit_adcimm(0, sr);
}


x86 assembly (clang, -O0):
<emit_cmphi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <emit_cmp@plt>
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1030 <emit_adcimm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmphi>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%edi
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <emit_cmp@plt>
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <emit_adcimm@plt>

LLVM IR (-O0):
define void @emit_cmphi(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @emit_andimm(i32 %9, i32 -2, i32 %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @emit_cmp(i32 %12, i32 %13)
%15 = load i32, i32* %7
%16 = call i32 @emit_adcimm(i32 0, i32 %15)
ret void
}

LLVM IR (-O2):
define void @emit_cmphi(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @emit_andimm(i32 %2, i32 -2, i32 %2)
%6 = tail call i32 @emit_cmp(i32 %0, i32 %1)
%7 = tail call i32 @emit_adcimm(i32 0, i32 %2)
ret void
}
int isAlphanumeric(char c) {
  if ('\"' == c) {
    return 0;
  }
  if ('!' <= c && '~' >= c) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isAlphanumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x22,%eax
cmp    %ecx,%eax
jne    1127 <isAlphanumeric+0x27>
movl   $0x0,-0x4(%rbp)
jmp    115c <isAlphanumeric+0x5c>
movsbl -0x5(%rbp),%ecx
mov    $0x21,%eax
cmp    %ecx,%eax
jg     1155 <isAlphanumeric+0x55>
movsbl -0x5(%rbp),%ecx
mov    $0x7e,%eax
cmp    %ecx,%eax
jl     1155 <isAlphanumeric+0x55>
movl   $0x1,-0x4(%rbp)
jmp    115c <isAlphanumeric+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlphanumeric>:
cmp    $0x22,%dil
setne  %al
add    $0xdf,%dil
cmp    $0x5e,%dil
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isAlphanumeric(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 34, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %18
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 33, %10
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 126, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %2
br label %18
17: ; preds = %12, %8
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @isAlphanumeric(i8 signext %0) {
%2 = icmp ne i8 %0, 34
%3 = add i8 %0, -33
%4 = icmp ult i8 %3, 94
%5 = and i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int sputsp(char const *, int /*<<< orphan*/ *);
int sputs(const char *s) { return (sputsp(s, NULL)); }


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

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

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

LLVM IR (-O2):
define i32 @sputs(i8* %0) {
%2 = tail call i32 @sputsp(i8* %0, i32* null)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ FE_ALL_EXCEPT;
int fetestexcept(int /*<<< orphan*/);
int get_fpu_except_flags(void) {
  int result, set_excepts;
  result = 0;
  set_excepts = fetestexcept(FE_ALL_EXCEPT);
  return result;
}


x86 assembly (clang, -O0):
<get_fpu_except_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1030 <fetestexcept@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fpu_except_flags>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <fetestexcept@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @get_fpu_except_flags() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @FE_ALL_EXCEPT
%4 = call i32 @fetestexcept(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @get_fpu_except_flags() {
%1 = load i32, i32* @FE_ALL_EXCEPT
%2 = tail call i32 @fetestexcept(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pb(char *, int);
void pw(char *s, int o) {
  pb(s, 1 + o);
  pb(s, o);
}


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

x86 assembly (clang, -O2):
<pw>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x1(%r14),%esi
call   1030 <pb@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pb@plt>

LLVM IR (-O0):
define void @pw(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = add nsw i32 1, %6
%8 = call i32 @pb(i8* %5, i32 %7)
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @pb(i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @pw(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i32 @pb(i8* %0, i32 %3)
%5 = tail call i32 @pb(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Com_Error(int /*<<< orphan*/, char *);
int /*<<< orphan*/ _Z_Free(void *, char *, int);
void Z_FreeGame(void *ptr) {
  if (!ptr)
    Com_Error(0, "Z_FreeGame: null pointer from Game DLL");
  _Z_Free(ptr, "Game DLL", 1);
}


x86 assembly (clang, -O0):
<Z_FreeGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <Z_FreeGame+0x25>
xor    %edi,%edi
lea    0xec0(%rip),%rsi
call   1040 <Com_Error@plt>
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
mov    $0x1,%edx
call   1030 <_Z_Free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Z_FreeGame>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1137 <Z_FreeGame+0x17>
lea    0xed0(%rip),%rsi
xor    %edi,%edi
call   1040 <Com_Error@plt>
lea    0xee0(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <_Z_Free@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Z_FreeGame: null pointer from Game DLL\00"
@.str.1 = [9 x i8] c"Game DLL\00"
define void @Z_FreeGame(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @Com_Error(i32 0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @_Z_Free(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Z_FreeGame: null pointer from Game DLL\00"
@.str.1 = [9 x i8] c"Game DLL\00"
define void @Z_FreeGame(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @Com_Error(i32 0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @_Z_Free(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ islower(int);
void t_islower_0x6b() {
  Assert_real((islower(107)),
              "/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_islower.c",
              540, ("islower should be 1 for k"));
}


x86 assembly (clang, -O0):
<t_islower_0x6b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6b,%edi
call   1030 <islower@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x21c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1030 <islower@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x21c,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for k\00"
define void @t_islower_0x6b() {
%1 = call i32 @islower(i32 107)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for k\00"
define void @t_islower_0x6b() {
%1 = tail call i32 @islower(i32 107)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int sys_printf(void) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void hex(FILE *out, char *buf, int len) {
  int i;
  for (i = 0; i < len; i++) {
    fprintf(out, "%02x", (unsigned char)buf[i]);
  }
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <hex+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
lea    0xeb7(%rip),%rsi
movzbl (%rax,%rcx,1),%edx
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <hex+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1149 <hex+0x39>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
movzbl (%r14,%rbx,1),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <hex+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
define void @hex(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @hex(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}