xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_semaphore_new() {
  printf("NOT IMPLEMENTED:"
         "pa_semaphore_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_semaphore_new\0A\00"
define i32 @pa_semaphore_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_semaphore_new\00"
define i32 @pa_semaphore_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void gtk_tree_view_column_clear() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_clear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void end() { printf("That is one way of reaching the end. Level Cleared\n"); }


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"That is one way of reaching the end. Level Cleared\0A\00"
define void @end() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"That is one way of reaching the end. Level Cleared\00"
define void @end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int __m128i;

/* Variables and functions */
int _mm_slli_epi32(int, int);
int _mm_srli_epi32(int, int);
__m128i rotate(__m128i x, int bits) {
  return _mm_slli_epi32(x, bits) | _mm_srli_epi32(x, 32 - bits);
}


x86 assembly (clang, -O0):
<rotate>:
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_slli_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
sub    -0x8(%rbp),%esi
call   1040 <_mm_srli_epi32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <_mm_slli_epi32@plt>
mov    %eax,%r14d
mov    $0x20,%esi
sub    %ebx,%esi
mov    %ebp,%edi
call   1040 <_mm_srli_epi32@plt>
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rotate(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_slli_epi32(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = call i32 @_mm_srli_epi32(i32 %8, i32 %10)
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotate(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_slli_epi32(i32 %0, i32 %1)
%4 = sub nsw i32 32, %1
%5 = tail call i32 @_mm_srli_epi32(i32 %0, i32 %4)
%6 = or i32 %5, %3
ret i32 %6
}
int Double_to_MINUS_int(double x) { return (int)x; }


x86 assembly (clang, -O0):
<Double_to_MINUS_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double_to_MINUS_int>:
cvttsd2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @Double_to_MINUS_int(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
void InitializeInterrupts() {}


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

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

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

LLVM IR (-O2):
define void @InitializeInterrupts() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_carry(uintptr_t, uintptr_t);
void fiat_25519_carry(uint64_t out1[5], const uint64_t arg1[5]) {
  internal_fiat_25519_carry((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_25519_carry>:
jmp    1030 <internal_fiat_25519_carry@plt>

LLVM IR (-O0):
define void @fiat_25519_carry(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_25519_carry(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_carry(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_25519_carry(i64 %3, i64 %4)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char *data;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_data(void *_p, void *_v) { ((XImage *)_p)->data = (char *)_v; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i8* }
define void @set_XImage_data(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i8* %5, i8** %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_data(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
void HMAC(void) {}


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

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

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

LLVM IR (-O2):
define void @HMAC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showOK(char url[], int n) {
  if (n != 0) {
    printf("%-50s [ Found ]\n", url);
  } else {
    printf("%-50s [ Not Found ]\n", url);
  }
}


x86 assembly (clang, -O0):
<showOK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <showOK+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <showOK+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showOK>:
mov    %rdi,%rax
test   %esi,%esi
lea    0xef5(%rip),%rcx
lea    0xedd(%rip),%rdi
cmove  %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%-50s [ Found ]\0A\00"
@.str.1 = [21 x i8] c"%-50s [ Not Found ]\0A\00"
define void @showOK(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 ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%-50s [ Found ]\0A\00"
@.str.1 = [21 x i8] c"%-50s [ Not Found ]\0A\00"
define void @showOK(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %0)
ret void
}
void executeInstruction(unsigned char opcode) {}


x86 assembly (clang, -O0):
<executeInstruction>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @executeInstruction(i8 zeroext %0) {
ret void
}
unsigned char __attribute__((always_)) mytoupper(unsigned char c) {
  if (c >= 'a' && c <= 'z')
    c -= 'a' - 'A';
  return c;
}


x86 assembly (clang, -O0):
<mytoupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     112e <mytoupper+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     112e <mytoupper+0x2e>
movzbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @mytoupper(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = sub nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @mytoupper(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ handle_36(int /*<<< orphan*/);
int gen_36() {
  handle_36(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_36>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_36@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_36() {
%1 = call i32 @handle_36(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_36() {
%1 = tail call i32 @handle_36(i32 0)
ret i32 0
}
/* Variables and functions */
int close(int);
int mongo_env_close_socket(int socket) { return close(socket); }


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

x86 assembly (clang, -O2):
<mongo_env_close_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @mongo_env_close_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int fun1156() { return 1156; }


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

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

LLVM IR (-O0):
define i32 @fun1156() {
ret i32 1156
}

LLVM IR (-O2):
define i32 @fun1156() {
ret i32 1156
}
/* Variables and functions */
int ULONG_MAX;
char *calloc(int, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *c = calloc(ULONG_MAX / 64, 65);
  printf("%p\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    $0x41,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
lea    0x3f(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x6,%edi
mov    $0x41,%esi
call   1040 <calloc@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ULONG_MAX = global i32 0
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = load i32, i32* @ULONG_MAX
%4 = sdiv i32 %3, 64
%5 = call i8* @calloc(i32 %4, i32 65)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@ULONG_MAX = global i32 0
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = load i32, i32* @ULONG_MAX
%2 = sdiv i32 %1, 64
%3 = tail call i8* @calloc(i32 %2, i32 65)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x54() {
  Assert_real((isalnum(84)),
              "/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_isalnum.c",
              425, ("isalnum should be 1 for T"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x54>:
push   %rax
mov    $0x54,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1a9,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for T\00"
define void @t_isalnum_0x54() {
%1 = call i32 @isalnum(i32 84)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 425, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for T\00"
define void @t_isalnum_0x54() {
%1 = tail call i32 @isalnum(i32 84)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 425, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int property_get(const char *key, char *value, const char *default_value) {
  return 0;
}


x86 assembly (clang, -O0):
<property_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @property_get(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @property_get(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void rop3_72_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_72_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_72_1_0>:
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_72_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = or i32 %27, %33
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %4
store i8 %35, i8* %36
ret void
}

LLVM IR (-O2):
define void @rop3_72_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
char *tim_strrevstr(char *, unsigned int, char const *);
char *tim_strstr(char *, unsigned int, char const *);
char *buffer_find2(char *haystack, size_t haystack_sz, const char *needle,
                   unsigned off, int dir) {
  return dir < 0 ? tim_strrevstr(haystack, off, needle)
                 : tim_strstr(haystack + off, haystack_sz - off, needle);
}


x86 assembly (clang, -O0):
<buffer_find2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    115e <buffer_find2+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <tim_strrevstr@plt>
mov    %rax,-0x28(%rbp)
jmp    1181 <buffer_find2+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1040 <tim_strstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_find2>:
test   %r8d,%r8d
js     1131 <buffer_find2+0x11>
mov    %ecx,%eax
add    %rax,%rdi
sub    %ecx,%esi
jmp    1040 <tim_strstr@plt>
mov    %ecx,%esi
jmp    1030 <tim_strrevstr@plt>

LLVM IR (-O0):
define i8* @buffer_find2(i8* %0, i64 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %9
%16 = load i8*, i8** %8
%17 = call i8* @tim_strrevstr(i8* %14, i32 %15, i8* %16)
br label %30
18: ; preds = %5
%19 = load i8*, i8** %6
%20 = load i32, i32* %9
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i64, i64* %7
%24 = load i32, i32* %9
%25 = zext i32 %24 to i64
%26 = sub i64 %23, %25
%27 = trunc i64 %26 to i32
%28 = load i8*, i8** %8
%29 = call i8* @tim_strstr(i8* %22, i32 %27, i8* %28)
br label %30
30: ; preds = %18, %13
%31 = phi i8* [ %17, %13 ], [ %29, %18 ]
ret i8* %31
}

LLVM IR (-O2):
define i8* @buffer_find2(i8* %0, i64 %1, i8* %2, i32 %3, i32 %4) {
%6 = icmp slt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i8* @tim_strrevstr(i8* %0, i32 %3, i8* %2)
br label %15
9: ; preds = %5
%10 = zext i32 %3 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = trunc i64 %1 to i32
%13 = sub i32 %12, %3
%14 = tail call i8* @tim_strstr(i8* %11, i32 %13, i8* %2)
br label %15
15: ; preds = %9, %7
%16 = phi i8* [ %8, %7 ], [ %14, %9 ]
ret i8* %16
}
void zero_neighbours(int *arr, int *arr_len) {
  register int i;
  for (i = 0; i < 20000; i++) {
    arr[i] = 0;
  }
  *arr_len = 0;
}


x86 assembly (clang, -O0):
<zero_neighbours>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4e20,-0x14(%rbp)
jge    113d <zero_neighbours+0x3d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <zero_neighbours+0x13>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_neighbours>:
push   %rbx
mov    %rsi,%rbx
mov    $0x13880,%edx
xor    %esi,%esi
call   1030 <memset@plt>
movl   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @zero_neighbours(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = bitcast i32* %0 to i8*
store i32 0, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLbitfield;

/* Variables and functions */
int /*<<< orphan*/ glPushClientAttrib(int /*<<< orphan*/);
void PushClientAttrib(GLbitfield mask) { glPushClientAttrib(mask); }


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

x86 assembly (clang, -O2):
<PushClientAttrib>:
jmp    1030 <glPushClientAttrib@plt>

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

LLVM IR (-O2):
define void @PushClientAttrib(i32 %0) {
%2 = tail call i32 @glPushClientAttrib(i32 %0)
ret void
}
/* Variables and functions */
int parse_read(char **, char **, int /*<<< orphan*/);
int /*<<< orphan*/ strspn(char *, char *);
int parse_read_consec(char **buf, char **readbuf, char *accept) {
  return parse_read(buf, readbuf, strspn(*buf, accept));
}


x86 assembly (clang, -O0):
<parse_read_consec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strspn@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <parse_read@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_read_consec>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    %rdx,%rsi
call   1040 <strspn@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <parse_read@plt>

LLVM IR (-O0):
define i32 @parse_read_consec(i8** %0, i8** %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i8*
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = load i8**, i8*** %5
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = load i8*, i8** %6
%12 = call i32 @strspn(i8* %10, i8* %11)
%13 = call i32 @parse_read(i8** %7, i8** %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @parse_read_consec(i8** %0, i8** %1, i8* nocapture %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @strspn(i8* %4, i8* %2)
%6 = tail call i32 @parse_read(i8** %0, i8** %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int atoi(char *);
int foo(int);
int main(int argc, char *argv[]) {
  int dwarf_test_local;
  if (argc != 55) {
    dwarf_test_local = 55;
  } else if (argc == 54) {
    dwarf_test_local = atoi(argv[1]);
  } else {
    dwarf_test_local = -1;
  }
  if (argc != 54) {
    return foo(dwarf_test_local);
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x37,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x37,-0x14(%rbp)
jmp    1177 <main+0x57>
cmpl   $0x36,-0x8(%rbp)
jne    116b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1172 <main+0x52>
movl   $0xffffffff,-0x14(%rbp)
jmp    1177 <main+0x57>
cmpl   $0x36,-0x8(%rbp)
je     1191 <main+0x71>
mov    -0x14(%rbp),%edi
call   1030 <foo@plt>
mov    %eax,-0x4(%rbp)
jmp    1198 <main+0x78>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x36,%edi
jne    111b <main+0xb>
mov    $0xffffffff,%eax
ret
cmp    $0x37,%edi
mov    $0xffffffff,%eax
mov    $0x37,%edi
cmove  %eax,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 55
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 55, i32* %6
br label %20
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 54
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %6
br label %19
18: ; preds = %10
store i32 -1, i32* %6
br label %19
19: ; preds = %18, %13
br label %20
20: ; preds = %19, %9
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 54
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %6
%25 = call i32 @foo(i32 %24)
store i32 %25, i32* %3
br label %27
26: ; preds = %20
store i32 -1, i32* %3
br label %27
27: ; preds = %26, %23
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 54
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 55
%6 = select i1 %5, i32 -1, i32 55
%7 = tail call i32 @foo(i32 %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_pawns_able_to_capture_west(int, int);
void b_pawns_able_to_capture_west_test(void **state) {
  assert_int_equal(
      0x0000000800000000ul,
      b_pawns_able_to_capture_west(0x00E3140800000000ul, 0x000000000C10E300ul));
}


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

x86 assembly (clang, -O2):
<b_pawns_able_to_capture_west_test>:
push   %rax
xor    %edi,%edi
mov    $0xc10e300,%esi
call   1040 <b_pawns_able_to_capture_west@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @b_pawns_able_to_capture_west_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @b_pawns_able_to_capture_west(i32 0, i32 202433280)
%4 = call i32 @assert_int_equal(i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
define void @b_pawns_able_to_capture_west_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_pawns_able_to_capture_west(i32 0, i32 202433280)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Type definitions */
struct ps_process {
  int dummy;
};
struct obus_server {
  int dummy;
};
struct obus_object {
  int dummy;
};

/* Variables and functions */
int obus_server_unregister_object(struct obus_server *, struct obus_object *);
int ps_process_unregister(struct obus_server *server,
                          struct ps_process *object) {
  struct obus_object *obj = (struct obus_object *)object;
  return obus_server_unregister_object(server, obj);
}


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

x86 assembly (clang, -O2):
<ps_process_unregister>:
jmp    1030 <obus_server_unregister_object@plt>

LLVM IR (-O0):
%struct.obus_server = type { i32 }
%struct.ps_process = type { i32 }
%struct.obus_object = type { i32 }
define i32 @ps_process_unregister(%struct.obus_server* %0, %struct.ps_process* %1) {
%3 = alloca %struct.obus_server*
%4 = alloca %struct.ps_process*
%5 = alloca %struct.obus_object*
store %struct.obus_server* %0, %struct.obus_server** %3
store %struct.ps_process* %1, %struct.ps_process** %4
%6 = load %struct.ps_process*, %struct.ps_process** %4
%7 = bitcast %struct.ps_process* %6 to %struct.obus_object*
store %struct.obus_object* %7, %struct.obus_object** %5
%8 = load %struct.obus_server*, %struct.obus_server** %3
%9 = load %struct.obus_object*, %struct.obus_object** %5
%10 = call i32 @obus_server_unregister_object(%struct.obus_server* %8, %struct.obus_object* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.obus_server = type { i32 }
%struct.ps_process = type { i32 }
%struct.obus_object = type { i32 }
define i32 @ps_process_unregister(%struct.obus_server* %0, %struct.ps_process* %1) {
%3 = bitcast %struct.ps_process* %1 to %struct.obus_object*
%4 = tail call i32 @obus_server_unregister_object(%struct.obus_server* %0, %struct.obus_object* %3)
ret i32 %4
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ my_free(void *);
void my_malloc_and_free(void **x) {
  *x = malloc(100);
  if (*x)
    my_free(*x);
  return;
}


x86 assembly (clang, -O0):
<my_malloc_and_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     115a <my_malloc_and_free+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <my_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc_and_free>:
push   %rbx
mov    %rdi,%rbx
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     113f <my_malloc_and_free+0x1f>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <my_free@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @my_malloc_and_free(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
store i8* %2, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @my_free(i8* %2)
br label %6
6: ; preds = %4, %1
ret void
}
int empty(unsigned char c) { return (!((c & 1) || (c & 2))); }


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x1,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    112f <empty+0x2f>
movzbl -0x1(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @empty(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 2
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ true, %1 ], [ %11, %7 ]
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @empty(i8 zeroext %0) {
%2 = and i8 %0, 3
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func1(void) {
  printf("This is func1\n");
  return (1);
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"This is func1\00"
define i32 @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t OneWireIntStatus(uint32_t ui32Base, bool bMasked) {
  ASSERT(ui32Base == 0x400B6000);
  if (bMasked) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000108))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000104))));
  }
}


x86 assembly (clang, -O0):
<OneWireIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x400b6000,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0xc(%rbp)
je     1150 <OneWireIntStatus+0x40>
mov    -0x8(%rbp),%eax
add    $0x108,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <OneWireIntStatus+0x4f>
mov    -0x8(%rbp),%eax
add    $0x104,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireIntStatus>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400b6000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
lea    0x104(,%rax,4),%eax
movslq %ebp,%rcx
mov    (%rax,%rcx,1),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @OneWireIntStatus(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1074487296
%8 = zext i1 %7 to i32
%9 = call i32 @ASSERT(i32 %8)
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 264
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
store i32 %17, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 260
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
store i32 %23, i32* %3
br label %24
24: ; preds = %18, %12
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @OneWireIntStatus(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074487296
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i32 260, i32 264
%8 = add nsw i32 %7, %0
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 %11
}
/* Type definitions */
struct myproc {
  int dummy;
};

/* Variables and functions */
struct myproc *proc_find_n(char const *, struct myproc **, int /*<<< orphan*/);
struct myproc *proc_find(const char *str, struct myproc **ps) {
  return proc_find_n(str, ps, 0);
}


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

x86 assembly (clang, -O2):
<proc_find>:
xor    %edx,%edx
jmp    1030 <proc_find_n@plt>

LLVM IR (-O0):
%struct.myproc = type { i32 }
define %struct.myproc* @proc_find(i8* %0, %struct.myproc** %1) {
%3 = alloca i8*
%4 = alloca %struct.myproc**
store i8* %0, i8** %3
store %struct.myproc** %1, %struct.myproc*** %4
%5 = load i8*, i8** %3
%6 = load %struct.myproc**, %struct.myproc*** %4
%7 = call %struct.myproc* @proc_find_n(i8* %5, %struct.myproc** %6, i32 0)
ret %struct.myproc* %7
}

LLVM IR (-O2):
%struct.myproc = type { i32 }
define %struct.myproc* @proc_find(i8* %0, %struct.myproc** %1) {
%3 = tail call %struct.myproc* @proc_find_n(i8* %0, %struct.myproc** %1, i32 0)
ret %struct.myproc* %3
}
int putnowhere(char c) { return (0); }


x86 assembly (clang, -O0):
<putnowhere>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @putnowhere(i8 signext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern char *sherror(void) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i8* @sherror() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define noalias i8* @sherror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *array, int p, int r) {
  if (p < r) {
    int q;
    q = partition(array, p, r);
    quick_sort(array, p, q - 1);
    quick_sort(array, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
char iscntrl(unsigned char c) {
  if (c <= 0x1F || c == 0x7f)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x1f,%eax
jle    1124 <iscntrl+0x24>
movzbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jne    112d <iscntrl+0x2d>
movb   $0x1,-0x1(%rbp)
jmp    1131 <iscntrl+0x31>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%dil
setb   %cl
cmp    $0x7f,%dil
sete   %al
or     %cl,%al
ret

LLVM IR (-O0):
define signext i8 @iscntrl(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sle i32 %5, 31
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 127
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 1, i8* %2
br label %13
12: ; preds = %7
store i8 0, i8* %2
br label %13
13: ; preds = %12, %11
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @iscntrl(i8 zeroext %0) {
%2 = icmp ult i8 %0, 32
%3 = icmp eq i8 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  if (!(y > 0 || x > 0))
    return 0;
  while (1) {
    if (x > 0)
      x++;
    else
      y++;
    assert(x > 0 || y > 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     113b <main+0x2b>
cmpl   $0x0,-0x8(%rbp)
jg     113b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1140 <main+0x30>
cmpl   $0x0,-0x8(%rbp)
jle    1158 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jg     117a <main+0x6a>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1140 <main+0x30>

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
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6
ret i32 0
10: ; preds = %6, %0
br label %11
11: ; preds = %10, %26
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %20
17: ; preds = %11
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sgt i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i32, i32* %3
%25 = icmp sgt i32 %24, 0
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ true, %20 ], [ %25, %23 ]
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
br label %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ c_plsfam(int, int, int);
int opt_fam(const char *opt, const char *myoptarg, void *client_data) {
  (void)opt;
  (void)myoptarg;
  (void)client_data;
  c_plsfam(1, -1, -1);
  return 0;
}


x86 assembly (clang, -O0):
<opt_fam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1030 <c_plsfam@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_fam>:
push   %rax
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1030 <c_plsfam@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opt_fam(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @c_plsfam(i32 1, i32 -1, i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ idc(int *);
int test13(int *q) {
  int *p = q;
  idc(p);
  return *p;
}


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

x86 assembly (clang, -O2):
<test13>:
push   %rbx
mov    %rdi,%rbx
call   1030 <idc@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test13(i32* %0) {
%2 = tail call i32 @idc(i32* %0)
%3 = load i32, i32* %0
ret i32 %3
}
void I_NoAppServicesShutdown(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @execute_getresuid32() {
ret i32 0
}