xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int strcmp(char *, char *);
int cmp_nlabel(const uint8_t *L1, const uint8_t *L2) {
  return strcmp((char *)L1, (char *)L2);
}


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

x86 assembly (clang, -O2):
<cmp_nlabel>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp_nlabel(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 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = call i32 @strcmp(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @cmp_nlabel(i32* nocapture %0, i32* nocapture %1) {
%3 = bitcast i32* %0 to i8*
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
int attr_name_to_id(name)
char *name;
{ return 0; }


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

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

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

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


x86 assembly (clang, -O0):
<rop3_12_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%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
movzbl -0xa(%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    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%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_12_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_12_1_1(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* %6
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = and i32 %14, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i8, i8* %6
%26 = zext i8 %25 to i32
%27 = xor i32 %26, -1
%28 = and i32 %24, %27
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = or i32 %28, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_12_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x66() {
  Assert_real((isodigit(102) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              515, ("isodigit should be 0 for f"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x66>:
push   %rax
mov    $0x66,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x203,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for f\00"
define void @t_isodigit_0x66() {
%1 = call i64 @isodigit(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for f\00"
define void @t_isodigit_0x66() {
%1 = tail call i64 @isodigit(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stdout;
void my_c_bye(const char *msg) { fprintf(stdout, msg); }


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

x86 assembly (clang, -O2):
<my_c_bye>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @my_c_bye(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @my_c_bye(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ...) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "clone");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
lea    0xede(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"clone\00"
define i32 @clone(i32 (i8*)* %0, i8* %1, i32 %2, i8* %3, ...) {
%5 = alloca i32
%6 = alloca i32 (i8*)*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i32 (i8*)* %0, i32 (i8*)** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @assert(i32 0)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"clone\00"
define i32 @clone(i32 (i8*)* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, ...) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @assert(i32 0)
ret i32 undef
}
int tls13_server_key_update_send(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_server_key_update_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
unsigned int __atomic_fetch_and_4(volatile void *atom, unsigned int value,
                                  int memorder) {
  unsigned int xchg;
  unsigned int cmp;
  __atomic_load((unsigned int *)atom, (unsigned int *)&cmp, 0);
  do {
    xchg = ((cmp & value));
  } while (
      !__atomic_compare_exchange((unsigned int *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_and_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
mov    %al,-0x21(%rbp)
mov    %ecx,-0x20(%rbp)
test   $0x1,%al
jne    1147 <__atomic_fetch_and_4+0x47>
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1117 <__atomic_fetch_and_4+0x17>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_and_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %eax,%edx
and    %esi,%edx
lock cmpxchg %edx,(%rdi)
jne    1110 <__atomic_fetch_and_4+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__atomic_fetch_and_4(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load atomic i32, i32* %11 monotonic
store i32 %12, i32* %8
br label %13
13: ; preds = %26, %3
%14 = load i32, i32* %8
%15 = load i32, i32* %5
%16 = and i32 %14, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = cmpxchg weak i32* %19, i32 %20, i32 %21 seq_cst seq_cst
%23 = extractvalue { i32, i1 } %22, 0
%24 = extractvalue { i32, i1 } %22, 1
br i1 %24, label %26, label %25
25: ; preds = %17
store i32 %23, i32* %8
br label %26
26: ; preds = %25, %17
%27 = zext i1 %24 to i8
store i8 %27, i8* %9
%28 = load i8, i8* %9
%29 = trunc i8 %28 to i1
%30 = xor i1 %29, true
br i1 %30, label %13, label %31
31: ; preds = %26
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @__atomic_fetch_and_4(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load atomic i32, i32* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i32 [ %5, %3 ], [ %11, %6 ]
%8 = and i32 %7, %1
%9 = cmpxchg weak i32* %4, i32 %7, i32 %8 seq_cst seq_cst
%10 = extractvalue { i32, i1 } %9, 1
%11 = extractvalue { i32, i1 } %9, 0
br i1 %10, label %12, label %6
12: ; preds = %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gl_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<gl_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @gl_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void metil_mpi_finalize() {}


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

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

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

LLVM IR (-O2):
define void @metil_mpi_finalize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
#define SIGHUP 129
#define SIGTERM 128
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_handler(int sig) {
  switch (sig) {
  case SIGHUP:
    break;
  case SIGTERM:
    exit(EXIT_SUCCESS);
    break;
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x80,%eax
je     1149 <signal_handler+0x39>
jmp    1131 <signal_handler+0x21>
mov    -0x8(%rbp),%eax
sub    $0x81,%eax
jne    1157 <signal_handler+0x47>
jmp    1144 <signal_handler+0x34>
jmp    1157 <signal_handler+0x47>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
cmp    $0x80,%edi
je     1119 <signal_handler+0x9>
ret
push   %rax
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 129, label %4
i32 128, label %5
]
4: ; preds = %1
br label %8
5: ; preds = %1
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %1, %4
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @signal_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %1
ret void
}
void _io_inputize_cursor(void) {}


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

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

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

LLVM IR (-O2):
define void @_io_inputize_cursor() {
ret void
}
int hash(char *s, int l) {
  int i;
  for (i = 0; *s != '\0'; s++)
    i = (i * 10 + *s) % l;
  return (i);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1147 <hash+0x47>
imul   $0xa,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <hash+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     112a <hash+0x2a>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movsbl %al,%eax
lea    (%rdx,%rdx,4),%ecx
lea    (%rax,%rcx,2),%eax
cltd
idiv   %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
mov    %edx,%eax
ret
xor    %edx,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add nsw i32 %10, %9
%12 = srem i32 %11, %1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
/* Variables and functions */
scalar_t__ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ mkpath(char *, char const *, char const *, char const *);
const char *xmlfile(const char *name, const char *modifier) {
  const char *datapath = "%R"
                         "var/lib/mingw-get/data"
                         "%/M/%F.xml";
  char *datafile = (char *)(malloc(mkpath(NULL, datapath, name, modifier)));
  mkpath(datafile, datapath, name, modifier);
  return (const char *)(datafile);
}


x86 assembly (clang, -O0):
<xmlfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
call   1040 <mkpath@plt>
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1040 <mkpath@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlfile>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
lea    0xecb(%rip),%r15
xor    %edi,%edi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1040 <mkpath@plt>
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1040 <mkpath@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"%Rvar/lib/mingw-get/data%/M/%F.xml\00"
define i8* @xmlfile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @mkpath(i8* null, i8* %7, i8* %8, i8* %9)
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @mkpath(i8* %13, i8* %14, i8* %15, i8* %16)
%18 = load i8*, i8** %6
ret i8* %18
}

LLVM IR (-O2):
@.str = [35 x i8] c"%Rvar/lib/mingw-get/data%/M/%F.xml\00"
define i8* @xmlfile(i8* %0, i8* %1) {
%3 = tail call i32 @mkpath(i8* null, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @mkpath(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %5
}
/* Variables and functions */
void *realloc(void *, size_t);
void *xmalloc_fatal(size_t);
void *xrealloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (p == NULL)
    return xmalloc_fatal(size);
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <xrealloc+0x3e>
mov    -0x18(%rbp),%rdi
call   1040 <xmalloc_fatal@plt>
mov    %rax,-0x8(%rbp)
jmp    1166 <xrealloc+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %rsi,%rbx
call   1030 <realloc@plt>
test   %rax,%rax
je     1130 <xrealloc+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <xmalloc_fatal@plt>

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i64, i64* %5
%14 = call i8* @xmalloc_fatal(i64 %13)
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @xmalloc_fatal(i64 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ %3, %2 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(void) {
  sleep(1);
  return 128;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 1)
ret i32 128
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insertAtbottom(struct stack *, int);
scalar_t__ isEmpty(struct stack *);
int pop(struct stack *);
void reverseStack(struct stack *S) {
  if (isEmpty(S))
    return;
  int data = pop(S);
  reverseStack(S);
  insertAtbottom(S, data);
}


x86 assembly (clang, -O0):
<reverseStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <isEmpty@plt>
cmp    $0x0,%rax
je     1164 <reverseStack+0x24>
jmp    1185 <reverseStack+0x45>
mov    -0x8(%rbp),%rdi
call   1040 <pop@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverseStack@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <insertAtbottom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseStack>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <isEmpty@plt>
test   %rax,%rax
je     1157 <reverseStack+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1040 <pop@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <reverseStack@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <insertAtbottom@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
define void @reverseStack(%struct.stack* %0) {
%2 = alloca %struct.stack*
%3 = alloca i32
store %struct.stack* %0, %struct.stack** %2
%4 = load %struct.stack*, %struct.stack** %2
%5 = call i64 @isEmpty(%struct.stack* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %15
8: ; preds = %1
%9 = load %struct.stack*, %struct.stack** %2
%10 = call i32 @pop(%struct.stack* %9)
store i32 %10, i32* %3
%11 = load %struct.stack*, %struct.stack** %2
%12 = load %struct.stack*, %struct.stack** %2
%13 = load i32, i32* %3
%14 = call i32 @insertAtbottom(%struct.stack* %12, i32 %13)
br label %15
15: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @reverseStack(%struct.stack* %0) {
%2 = tail call i64 @isEmpty(%struct.stack* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = tail call i32 @pop(%struct.stack* %0)
tail call void @reverseStack(%struct.stack* %0)
%7 = tail call i32 @insertAtbottom(%struct.stack* %0, i32 %6)
br label %4
}
/* Variables and functions */
double computeCircleArea(double);
double computeTriangleArea(double, double, double);
double computeInCircleArea(double a, double b, double c) {
  double semiPerimeter = (a + b + c) / 2;
  return computeCircleArea(computeTriangleArea(a, b, c) / semiPerimeter);
}


x86 assembly (clang, -O0):
<computeInCircleArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <computeTriangleArea@plt>
divsd  -0x20(%rbp),%xmm0
call   1030 <computeCircleArea@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeInCircleArea>:
push   %rax
movapd %xmm0,%xmm3
addsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
mulsd  0xecb(%rip),%xmm3
movsd  %xmm3,(%rsp)
call   1040 <computeTriangleArea@plt>
divsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <computeCircleArea@plt>

LLVM IR (-O0):
define double @computeInCircleArea(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fadd double %8, %9
%11 = load double, double* %6
%12 = fadd double %10, %11
%13 = fdiv double %12, 2.000000e+00
store double %13, double* %7
%14 = load double, double* %4
%15 = load double, double* %5
%16 = load double, double* %6
%17 = call double @computeTriangleArea(double %14, double %15, double %16)
%18 = load double, double* %7
%19 = fdiv double %17, %18
%20 = call double @computeCircleArea(double %19)
ret double %20
}

LLVM IR (-O2):
define double @computeInCircleArea(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %4, %2
%6 = fmul double %5, 5.000000e-01
%7 = tail call double @computeTriangleArea(double %0, double %1, double %2)
%8 = fdiv double %7, %6
%9 = tail call double @computeCircleArea(double %8)
ret double %9
}
/* Variables and functions */
char *memchr(char const *, char, unsigned int);
unsigned int web_get_word(const char *data, unsigned int size, char delim) {
  char *p;
  if (!size)
    return 0;
  p = memchr(data, delim, size);
  if (p == 0)
    return size;
  return p - data;
}


x86 assembly (clang, -O0):
<web_get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    113a <web_get_word+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1174 <web_get_word+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x15(%rbp),%al
mov    -0x14(%rbp),%edx
movsbl %al,%esi
call   1030 <memchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1166 <web_get_word+0x56>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <web_get_word+0x64>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<web_get_word>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     1133 <web_get_word+0x23>
mov    %esi,%ebx
mov    %rdi,%r14
movsbl %dl,%esi
mov    %ebx,%edx
call   1030 <memchr@plt>
test   %rax,%rax
je     1135 <web_get_word+0x25>
sub    %r14d,%eax
mov    %eax,%ebx
jmp    1135 <web_get_word+0x25>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @web_get_word(i8* %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8 %2, i8* %7
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %3
store i32 0, i32* %4
br label %28
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i8, i8* %7
%15 = load i32, i32* %6
%16 = call i8* @memchr(i8* %13, i8 signext %14, i32 %15)
store i8* %16, i8** %8
%17 = load i8*, i8** %8
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = load i32, i32* %6
store i32 %20, i32* %4
br label %28
21: ; preds = %12
%22 = load i8*, i8** %8
%23 = load i8*, i8** %5
%24 = ptrtoint i8* %22 to i64
%25 = ptrtoint i8* %23 to i64
%26 = sub i64 %24, %25
%27 = trunc i64 %26 to i32
store i32 %27, i32* %4
br label %28
28: ; preds = %21, %19, %11
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @web_get_word(i8* %0, i32 %1, i8 signext %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = tail call i8* @memchr(i8* %0, i8 signext %2, i32 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = ptrtoint i8* %6 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %5, %3, %8
%14 = phi i32 [ %12, %8 ], [ 0, %3 ], [ %1, %5 ]
ret i32 %14
}
void free_2d_int(int **arr, int row) {
  int i;
  for (i = 0; i < row; i++)
    free(arr[i]);
  free(arr);
}


x86 assembly (clang, -O0):
<free_2d_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_2d_int+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_2d_int+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2d_int>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_2d_int+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2d_int+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2d_int(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32**, i32*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
%16 = bitcast i32* %15 to i8*
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i32**, i32*** %3
%22 = bitcast i32** %21 to i8*
ret void
}

LLVM IR (-O2):
define void @free_2d_int(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int add(int, int);
int main(void) { return add(1, 2); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 1, i32 2)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ flushAllRegisters();
void SIGHUPHandler(int sig) {
  flushAllRegisters();
  exit(1);
}


x86 assembly (clang, -O0):
<SIGHUPHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <flushAllRegisters@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<SIGHUPHandler>:
push   %rax
xor    %eax,%eax
call   1030 <flushAllRegisters@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @SIGHUPHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @flushAllRegisters()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @SIGHUPHandler(i32 %0) {
%2 = tail call i32 (...) @flushAllRegisters()
%3 = tail call i32 @exit(i32 1)
unreachable
}
void rop3_75_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D | stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_75_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_75_0_1>:
mov    %esi,%eax
not    %eax
movzbl (%rdi),%r8d
mov    %r8d,%ecx
or     %eax,%ecx
xor    %edx,%ecx
and    %ecx,%esi
and    %edx,%eax
not    %edx
and    %ecx,%edx
and    %r8d,%eax
or     %esi,%eax
or     %edx,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_75_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = xor i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = or i32 %31, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = xor i32 %42, -1
%44 = and i32 %40, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %44, %47
%49 = or i32 %38, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_75_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i32
%5 = xor i32 %4, -1
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = trunc i32 %5 to i8
%9 = or i8 %6, %8
%10 = zext i8 %2 to i32
%11 = xor i8 %9, %2
%12 = zext i8 %11 to i32
%13 = and i8 %11, %1
%14 = zext i8 %13 to i32
%15 = xor i32 %10, -1
%16 = and i32 %12, %15
%17 = and i32 %10, %5
%18 = and i32 %17, %7
%19 = or i32 %18, %14
%20 = or i32 %19, %16
%21 = trunc i32 %20 to i8
store i8 %21, i8* %0
ret void
}
/* Variables and functions */
double F(double, double, double);
double rhs(double t, double x, double v) {
  double mass;
  mass = 1.0;
  return F(t, x, v) / mass;
}


x86 assembly (clang, -O0):
<rhs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <F@plt>
divsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rhs>:
jmp    1030 <F@plt>

LLVM IR (-O0):
define double @rhs(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 1.000000e+00, double* %7
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @F(double %8, double %9, double %10)
%12 = load double, double* %7
%13 = fdiv double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @rhs(double %0, double %1, double %2) {
%4 = tail call double @F(double %0, double %1, double %2)
ret double %4
}
void __this_cpu_preempt_check(const char *op) {}


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

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

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

LLVM IR (-O2):
define void @__this_cpu_preempt_check(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void httpSetCookie(char name[], char content[]) {
  if (name == NULL || content == NULL) {
    return;
  } else {
    printf("Set-Cookie: %s=%s\n", name, content);
  }
}


x86 assembly (clang, -O0):
<httpSetCookie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <httpSetCookie+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113b <httpSetCookie+0x2b>
jmp    114f <httpSetCookie+0x3f>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpSetCookie>:
test   %rdi,%rdi
je     112c <httpSetCookie+0x1c>
mov    %rsi,%rdx
test   %rsi,%rsi
je     112c <httpSetCookie+0x1c>
mov    %rdi,%rsi
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Set-Cookie: %s=%s\0A\00"
define void @httpSetCookie(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int unixSectorSize(sqlite3_file *NotUsed) {
  (void)(NotUsed);
  return 512;
}


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

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

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

LLVM IR (-O2):
define i32 @unixSectorSize(i32* nocapture readnone %0) {
ret i32 512
}
char *strcpy(char *dst, const char *src) {
  while (*src) {
    *dst++ = *src++;
  }
  *dst = 0;
  return 0;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <strcpy+0x10>
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* null
}
void glUniform4f(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform4f() {
ret void
}
signed long signedlong_ignoring_signedshort(signed long x, signed short y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlong_ignoring_signedshort(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlong_ignoring_signedshort(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Type definitions */
typedef scalar_t__ int_fast8_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_int_fast8_t(int_fast8_t const k1,
                                          int_fast8_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_int_fast8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_int_fast8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_fast8_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_fast8_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ AD1_GetValue16(unsigned char *);
int /*<<< orphan*/ AS1_SendChar(unsigned char);
void TI1_OnInterrupt(void) {
  unsigned char t[2];
  AD1_GetValue16(t);
  AS1_SendChar(t[0]);
  AS1_SendChar(t[1]);
}


x86 assembly (clang, -O0):
<TI1_OnInterrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
call   1030 <AD1_GetValue16@plt>
movzbl -0x2(%rbp),%edi
call   1040 <AS1_SendChar@plt>
movzbl -0x1(%rbp),%edi
call   1040 <AS1_SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TI1_OnInterrupt>:
push   %rax
lea    0x6(%rsp),%rdi
call   1030 <AD1_GetValue16@plt>
movzbl 0x6(%rsp),%edi
call   1040 <AS1_SendChar@plt>
movzbl 0x7(%rsp),%edi
call   1040 <AS1_SendChar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @TI1_OnInterrupt() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @AD1_GetValue16(i8* %2)
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
%6 = call i32 @AS1_SendChar(i8 zeroext %5)
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%8 = load i8, i8* %7
%9 = call i32 @AS1_SendChar(i8 zeroext %8)
ret void
}

LLVM IR (-O2):
define void @TI1_OnInterrupt() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @AD1_GetValue16(i8* %2)
%4 = load i8, i8* %2
%5 = call i32 @AS1_SendChar(i8 zeroext %4)
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%7 = load i8, i8* %6
%8 = call i32 @AS1_SendChar(i8 zeroext %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Null();
int main(int argc, char **argv) {
  Null();
  for (;;)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Null@plt>
jmp    112d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Null@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @Null()
br label %7
7: ; preds = %7, %2
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Null()
br label %4
4: ; preds = %4, %2
br label %4
}
char *strerror(int errnum) {
  printf("%s: not implemented\n", __func__);
  return 0;
}


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

x86 assembly (clang, -O2):
<strerror>:
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__.strerror = [9 x i8] c"strerror\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.strerror, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s: not implemented\0A\00"
@__func__.strerror = [9 x i8] c"strerror\00"
define noalias i8* @strerror(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.strerror, i64 0, i64 0))
ret i8* null
}