xunge/DecIR huggingface dataset:
__attribute__((always_)) int irq_set_affinity_hint(unsigned int irq,
                                                   const struct cpumask *m) {
  return -22;
}


x86 assembly (clang, -O0):
<irq_set_affinity_hint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffea,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cpumask = type opaque
define i32 @irq_set_affinity_hint(i32 %0, %struct.cpumask* %1) {
%3 = alloca i32
%4 = alloca %struct.cpumask*
store i32 %0, i32* %3
store %struct.cpumask* %1, %struct.cpumask** %4
ret i32 -22
}

LLVM IR (-O2):
%struct.cpumask = type opaque
define i32 @irq_set_affinity_hint(i32 %0, %struct.cpumask* nocapture readnone %1) {
ret i32 -22
}
/* Type definitions */
typedef int /*<<< orphan*/ Pixmap;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int SetPixmapDataToAttribute(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/,
                             int /*<<< orphan*/, char *);
int XNVCTRLSetScanoutOffset(Display *xDpy, int screenId, int nvDpyId,
                            Pixmap offsetPixmap, Bool blendAfterWarp) {
  return SetPixmapDataToAttribute(xDpy, screenId, nvDpyId, offsetPixmap,
                                  blendAfterWarp, "OffsetTexture");
}


x86 assembly (clang, -O0):
<XNVCTRLSetScanoutOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xebf(%rip),%r9
call   1030 <SetPixmapDataToAttribute@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XNVCTRLSetScanoutOffset>:
lea    0xee9(%rip),%r9
jmp    1030 <SetPixmapDataToAttribute@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"OffsetTexture\00"
define i32 @XNVCTRLSetScanoutOffset(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @SetPixmapDataToAttribute(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %6
}
void _M2_snooker_finish(__attribute__((unused)) int argc,
                        __attribute__((unused)) char *argv[]) {}


x86 assembly (clang, -O0):
<_M2_snooker_finish>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_M2_snooker_finish(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_snooker_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void xfgets(char *str, int size, FILE *in) {
  if (fgets(str, size, in) == NULL) {
    fprintf(stderr, "\nError in reading or end of file.\n");
  }
}


x86 assembly (clang, -O0):
<xfgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1162 <xfgets+0x42>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfgets>:
push   %rax
call   1030 <fgets@plt>
test   %rax,%rax
je     112d <xfgets+0xd>
pop    %rax
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"\0AError in reading or end of file.\0A\00"
define void @xfgets(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @fgets(i8* %7, i32 %8, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"\0AError in reading or end of file.\0A\00"
define void @xfgets(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %3
ret void
}
void testStruct() {
  struct {
    char buf[16];
    int length;
  } tainted;
  char buffer[16];
  int sock;
  sock = socket(2, 1, 0);
  read(sock, &tainted, sizeof(tainted));
  __builtin_memcpy(buffer, tainted.buf, tainted.length);
}


x86 assembly (clang, -O0):
<testStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1050 <socket@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x14,%edx
mov    $0x0,%al
call   1030 <read@plt>
lea    -0x30(%rbp),%rdi
lea    -0x18(%rbp),%rsi
movslq -0x8(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStruct>:
sub    $0x18,%rsp
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <socket@plt>
mov    %rsp,%rsi
mov    $0x14,%edx
mov    %eax,%edi
xor    %eax,%eax
call   1030 <read@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { [16 x i8], i32 }
define void @testStruct() {
%1 = alloca %struct.anon
%2 = alloca [16 x i8]
%3 = alloca i32
%4 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @socket to i32 (i32, i32, i32, ...)*)(i32 2, i32 1, i32 0)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (i32, %struct.anon*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, %struct.anon*, i64, ...)*)(i32 %5, %struct.anon* %1, i64 20)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%10 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
ret void
}

LLVM IR (-O2):
%struct.anon = type { [16 x i8], i32 }
define void @testStruct() {
%1 = alloca %struct.anon
%2 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 0, i64 0
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @socket to i32 (i32, i32, i32, ...)*)(i32 2, i32 1, i32 0)
%4 = call i32 (i32, %struct.anon*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, %struct.anon*, i64, ...)*)(i32 %3, %struct.anon* %1, i64 20)
ret void
}
/* Type definitions */
struct ps_process {
  int dummy;
};

/* Variables and functions */
int obus_object_destroy(int /*<<< orphan*/);
int /*<<< orphan*/ ps_process_object(struct ps_process *);
int ps_process_destroy(struct ps_process *object) {
  return obus_object_destroy(ps_process_object(object));
}


x86 assembly (clang, -O0):
<ps_process_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ps_process_object@plt>
mov    %eax,%edi
call   1040 <obus_object_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_process_destroy>:
push   %rax
call   1030 <ps_process_object@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <obus_object_destroy@plt>

LLVM IR (-O0):
%struct.ps_process = type { i32 }
define i32 @ps_process_destroy(%struct.ps_process* %0) {
%2 = alloca %struct.ps_process*
store %struct.ps_process* %0, %struct.ps_process** %2
%3 = load %struct.ps_process*, %struct.ps_process** %2
%4 = call i32 @ps_process_object(%struct.ps_process* %3)
%5 = call i32 @obus_object_destroy(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.ps_process = type { i32 }
define i32 @ps_process_destroy(%struct.ps_process* %0) {
%2 = tail call i32 @ps_process_object(%struct.ps_process* %0)
%3 = tail call i32 @obus_object_destroy(i32 %2)
ret i32 %3
}
/* Type definitions */
struct in_addr {
  scalar_t__ s_addr;
};

/* Variables and functions */
int inet_aton(char const *, struct in_addr *);
unsigned int iphash_v4(const char *ipv4, unsigned int nhash) {
  struct in_addr addr;
  unsigned int result = 0;
  if (inet_aton(ipv4, &addr) == 1) {
    result = (unsigned int)addr.s_addr % nhash;
  }
  return result;
}


x86 assembly (clang, -O0):
<iphash_v4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <inet_aton@plt>
cmp    $0x1,%eax
jne    1148 <iphash_v4+0x38>
mov    -0x18(%rbp),%rax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iphash_v4>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
call   1030 <inet_aton@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1134 <iphash_v4+0x24>
mov    0x8(%rsp),%eax
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i64 }
define i32 @iphash_v4(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.in_addr
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %6
%7 = load i8*, i8** %3
%8 = call i32 @inet_aton(i8* %7, %struct.in_addr* %5)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = load i32, i32* %4
%15 = urem i32 %13, %14
store i32 %15, i32* %6
br label %16
16: ; preds = %10, %2
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
%struct.in_addr = type { i64 }
define i32 @iphash_v4(i8* %0, i32 %1) {
%3 = alloca %struct.in_addr
%4 = bitcast %struct.in_addr* %3 to i8*
%5 = call i32 @inet_aton(i8* %0, %struct.in_addr* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = urem i32 %10, %1
br label %12
12: ; preds = %7, %2
%13 = phi i32 [ %11, %7 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
char *strsignal(int);
char *octave_strsignal_wrapper(int signum) { return strsignal(signum); }


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

x86 assembly (clang, -O2):
<octave_strsignal_wrapper>:
jmp    1030 <strsignal@plt>

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

LLVM IR (-O2):
define i8* @octave_strsignal_wrapper(i32 %0) {
%2 = tail call i8* @strsignal(i32 %0)
ret i8* %2
}
/* Type definitions */
struct user_regs_struct {
  long rax;
};

/* Variables and functions */
long ptrace_retval(struct user_regs_struct *regs) { return regs->rax; }


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

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

LLVM IR (-O0):
%struct.user_regs_struct = type { i64 }
define i64 @ptrace_retval(%struct.user_regs_struct* %0) {
%2 = alloca %struct.user_regs_struct*
store %struct.user_regs_struct* %0, %struct.user_regs_struct** %2
%3 = load %struct.user_regs_struct*, %struct.user_regs_struct** %2
%4 = getelementptr inbounds %struct.user_regs_struct, %struct.user_regs_struct* %3, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i64 }
define i64 @ptrace_retval(%struct.user_regs_struct* nocapture %0) {
%2 = getelementptr inbounds %struct.user_regs_struct, %struct.user_regs_struct* %0, i64 0, i32 0
%3 = load i64, i64* %2
ret i64 %3
}
void delay(int a) {}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
void *__ioremap(unsigned long, unsigned long, int);
extern void *ioremap_writethrough(unsigned long physaddr, unsigned long size) {
  return __ioremap(physaddr, size, 3);
}


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

x86 assembly (clang, -O2):
<ioremap_writethrough>:
mov    $0x3,%edx
jmp    1030 <__ioremap@plt>

LLVM IR (-O0):
define i8* @ioremap_writethrough(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 = call i8* @__ioremap(i64 %5, i64 %6, i32 3)
ret i8* %7
}

LLVM IR (-O2):
define i8* @ioremap_writethrough(i64 %0, i64 %1) {
%3 = tail call i8* @__ioremap(i64 %0, i64 %1, i32 3)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void CLOSELOG(void) {
  closelog();
  return;
}


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

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

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

LLVM IR (-O2):
define void @CLOSELOG() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ keyFeature(unsigned char, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void menuFeature(int item) { keyFeature((unsigned char)item, 0, 0); }


x86 assembly (clang, -O0):
<menuFeature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <keyFeature@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuFeature>:
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <keyFeature@plt>

LLVM IR (-O0):
define void @menuFeature(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @keyFeature(i8 zeroext %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @menuFeature(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @keyFeature(i8 zeroext %2, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ congratulateStudents(char *, char *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, const char *argv[]) {
  congratulateStudents("Jamal", "CS201", 30);
  sleep(2);
  congratulateStudents("Tareq", "CS201", 40);
  sleep(2);
  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)
lea    0xec3(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x1e,%edx
call   1030 <congratulateStudents@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xead(%rip),%rdi
lea    0xea0(%rip),%rsi
mov    $0x28,%edx
call   1030 <congratulateStudents@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rbx
mov    %rbx,%rsi
mov    $0x1e,%edx
call   1030 <congratulateStudents@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
mov    $0x28,%edx
call   1030 <congratulateStudents@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Jamal\00"
@.str.1 = [6 x i8] c"CS201\00"
@.str.2 = [6 x i8] c"Tareq\00"
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 @congratulateStudents(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 30)
%7 = call i32 @sleep(i32 2)
%8 = call i32 @congratulateStudents(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 40)
%9 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Jamal\00"
@.str.1 = [6 x i8] c"CS201\00"
@.str.2 = [6 x i8] c"Tareq\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @congratulateStudents(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 30)
%4 = tail call i32 @sleep(i32 2)
%5 = tail call i32 @congratulateStudents(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 40)
%6 = tail call i32 @sleep(i32 2)
ret i32 0
}
void report_barometer_data(struct ssp_data *data, struct sensor_value *baro) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
%struct.sensor_value = type opaque
define void @report_barometer_data(%struct.ssp_data* %0, %struct.sensor_value* %1) {
%3 = alloca %struct.ssp_data*
%4 = alloca %struct.sensor_value*
store %struct.ssp_data* %0, %struct.ssp_data** %3
store %struct.sensor_value* %1, %struct.sensor_value** %4
ret void
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
%struct.sensor_value = type opaque
define void @report_barometer_data(%struct.ssp_data* nocapture %0, %struct.sensor_value* nocapture %1) {
ret void
}
int help(void) {
  printf("%s, %s, %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/"
         "base-usage/make_study/utils.c",
         __func__, 13);
  printf("input 1, 2, 3, 4\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xf81(%rip),%rdx
mov    $0xd,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xf78(%rip),%rdx
mov    $0xd,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf6a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/utils.c\00"
@__func__.help = [5 x i8] c"help\00"
@.str.2 = [18 x i8] c"input 1, 2, 3, 4\0A\00"
define i32 @help() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.help, i64 0, i64 0), i32 13)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/utils.c\00"
@__func__.help = [5 x i8] c"help\00"
@str = [17 x i8] c"input 1, 2, 3, 4\00"
define i32 @help() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.help, i64 0, i64 0), i32 13)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 0;
  int b = 1;
  int c;
  for (int i = 0; i < 30; i++) {
    printf("%i\n", a);
    c = b;
    b = a + b;
    a = c;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jge    1170 <main+0x60>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r15d
xor    %ebp,%ebp
mov    $0x1e,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebp,%eax
add    %r15d,%eax
mov    %r15d,%ebp
mov    %eax,%r15d
add    $0xffffffff,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 0, i32* %5
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 30
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
store i32 %15, i32* %3
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %9
%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* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %8, %2 ]
%4 = phi i32 [ 0, %0 ], [ %5, %2 ]
%5 = phi i32 [ 1, %0 ], [ %7, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = add nsw i32 %4, %5
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 30
br i1 %9, label %1, label %2
}
int j2dow(double j) {
  int i;
  i = (int)(j + 0.5) - 7 * (((int)(j + 0.5) + 1) / 7) + 1;
  return (i);
}


x86 assembly (clang, -O0):
<j2dow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   $0x7,%ecx,%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<j2dow>:
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0xffffffff92492493,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @j2dow(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
%7 = load double, double* %2
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
%10 = add nsw i32 %9, 1
%11 = sdiv i32 %10, 7
%12 = mul nsw i32 7, %11
%13 = sub nsw i32 %6, %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @j2dow(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, 1
%5 = srem i32 %4, 7
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *get_Username(uid_t uid) {
  struct passwd *pwd = getpwuid(uid);
  return pwd->pw_name;
}


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

x86 assembly (clang, -O2):
<get_Username>:
push   %rax
call   1030 <getpwuid@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @get_Username(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.passwd* @getpwuid(i32 %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %6, i32 0, i32 0
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @get_Username(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%4 = load i8*, i8** %3
ret i8* %4
}
int Sum_it(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<Sum_it>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @Sum_it(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *strndup(const char *string, size_t len) {
  char *result;
  result = (char *)malloc(len + 1);
  memcpy(result, string, len);
  result[len] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
%7 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %7
ret i8* %5
}
void xpto_fun() {}


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

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

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

LLVM IR (-O2):
define void @xpto_fun() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void __cyg_profile_func_enter(void *this_fn, void *call_site) {
  printf("enter: addr=%p\n", this_fn);
  return;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"enter: addr=%p\0A\00"
define void @__cyg_profile_func_enter(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 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"enter: addr=%p\0A\00"
define void @__cyg_profile_func_enter(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error1(char const *, int, char *, int, int /*<<< orphan*/);
int __chk_error(const char *filename, int line, int ret) {
  if (ret < 0) {
    error1(filename, line, "%m (ret=%d, errno=%d)", ret, errno);
  }
  return ret;
}


x86 assembly (clang, -O0):
<__chk_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114c <__chk_error+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    0x2ea3(%rip),%rax
mov    (%rax),%r8d
lea    0xeb9(%rip),%rdx
call   1030 <error1@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__chk_error>:
push   %rbx
mov    %edx,%ebx
test   %edx,%edx
jns    112f <__chk_error+0x1f>
mov    0x2ec2(%rip),%rax
mov    (%rax),%r8d
lea    0xed8(%rip),%rdx
mov    %ebx,%ecx
call   1030 <error1@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%m (ret=%d, errno=%d)\00"
@errno = global i32 0
define i32 @__chk_error(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* @errno
%14 = call i32 @error1(i8* %10, i32 %11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %15
15: ; preds = %9, %3
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
@.str = [22 x i8] c"%m (ret=%d, errno=%d)\00"
@errno = global i32 0
define i32 @__chk_error(i8* %0, i32 %1, i32 returned %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @errno
%7 = tail call i32 @error1(i8* %0, i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %6)
br label %8
8: ; preds = %5, %3
ret i32 %2
}
/* Variables and functions */
short *malloc(int);
extern short *ReturnShort() {
  short *i = malloc(sizeof(short));
  *i = 102;
  return i;
}


x86 assembly (clang, -O0):
<ReturnShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movw   $0x66,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnShort>:
push   %rax
mov    $0x2,%edi
call   1030 <malloc@plt>
movw   $0x66,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i16* @ReturnShort() {
%1 = alloca i16*
%2 = call i16* @malloc(i32 2)
store i16* %2, i16** %1
%3 = load i16*, i16** %1
store i16 102, i16* %3
%4 = load i16*, i16** %1
ret i16* %4
}

LLVM IR (-O2):
define noalias i16* @ReturnShort() {
%1 = tail call i16* @malloc(i32 2)
store i16 102, i16* %1
ret i16* %1
}
int test_imm_CEint64_midword_reg(long long val) {
  return ((val >> 16) & (0xCE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CEint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13500416
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_error_has_name(const void *e, const char *name) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_error_has_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_error_has_name>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_error_has_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_error_has_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
void delay(clock_t ticks) {
  clock_t start = clock();
  do
    ;
  while (clock() < start + ticks);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
jmp    112c <delay+0x1c>
mov    $0x0,%al
call   1030 <clock@plt>
mov    -0x10(%rbp),%rcx
add    -0x8(%rbp),%rcx
cmp    %rcx,%rax
jl     1127 <delay+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
add    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rbx,%rax
jl     1130 <delay+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i64 (...) @clock()
store i64 %4, i64* %3
br label %5
5: ; preds = %6, %1
br label %6
6: ; preds = %5
%7 = call i64 (...) @clock()
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = add nsw i64 %8, %9
%11 = icmp slt i64 %7, %10
br i1 %11, label %5, label %12
12: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = tail call i64 (...) @clock()
%3 = add nsw i64 %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call i64 (...) @clock()
%6 = icmp slt i64 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ G_Error(char *, int);
void *G_Z_TagMalloc(int, int, char const *, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *G_Z_Malloc(int size, const char *filename, int fileline) {
  void *buf;
  buf = G_Z_TagMalloc(size, 1, filename, fileline);
  if (!buf)
    G_Error("G_Z_Malloc: failed on allocation of %i bytes", size);
  memset(buf, 0, size);
  return buf;
}


x86 assembly (clang, -O0):
<G_Z_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%esi
call   1030 <G_Z_TagMalloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1174 <G_Z_Malloc+0x44>
mov    -0x4(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1050 <G_Error@plt>
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G_Z_Malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%ebp
mov    $0x1,%esi
call   1030 <G_Z_TagMalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <G_Z_Malloc+0x2a>
lea    0xead(%rip),%rdi
mov    %ebp,%esi
call   1050 <G_Error@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"G_Z_Malloc: failed on allocation of %i bytes\00"
define i8* @G_Z_Malloc(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* @G_Z_TagMalloc(i32 %8, i32 1, i8* %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %3
%15 = load i32, i32* %4
%16 = call i32 @G_Error(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %3
%18 = load i8*, i8** %7
%19 = load i32, i32* %4
%20 = call i32 @memset(i8* %18, i32 0, i32 %19)
%21 = load i8*, i8** %7
ret i8* %21
}

LLVM IR (-O2):
@.str = [45 x i8] c"G_Z_Malloc: failed on allocation of %i bytes\00"
define i8* @G_Z_Malloc(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @G_Z_TagMalloc(i32 %0, i32 1, i8* %1, i32 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @G_Error(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @memset(i8* %4, i32 0, i32 %0)
ret i8* %4
}
char *quotes_around(char *destination, char *s, int c) {
  if (!s) {
    sprintf(destination, "%c%c", c, c);
  } else {
    sprintf(destination, "%c%s%c", c, s, c);
  }
  return destination;
}


x86 assembly (clang, -O0):
<quotes_around>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <quotes_around+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1168 <quotes_around+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quotes_around>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1132 <quotes_around+0x22>
mov    %rsi,%rcx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
mov    %edx,%r8d
xor    %eax,%eax
call   1030 <sprintf@plt>
jmp    1145 <quotes_around+0x35>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    %edx,%ecx
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
@.str.1 = [7 x i8] c"%c%s%c\00"
define i8* @quotes_around(i8* returned writeonly %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %2, i8* %1, i32 %2)
br label %9
9: ; preds = %7, %5
ret i8* %0
}
int begin_raw_message(struct st_ptls_message_emitter_t *_self) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.st_ptls_message_emitter_t = type opaque
define i32 @begin_raw_message(%struct.st_ptls_message_emitter_t* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void gen_exit(int code, char *msg) {
  printf("%s\n", msg);
  exit(code);
}


x86 assembly (clang, -O0):
<gen_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<gen_exit>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @gen_exit(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @exit(i32 %0)
unreachable
}
OP(fd, b0) {
  illegal_1();
  op_b0();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_b0@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_b0()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b0()
ret i32 undef
}
void USBHostRequestIN(unsigned long ulBase, unsigned long ulEndpoint) {
  unsigned long ulRegister;
  ;

  ;
  if (ulEndpoint == 0x00000000) {
    ulRegister = 0x00000102;
  } else {
    ulRegister = 0x00000116 + (ulEndpoint - 0x10);
  }
  (*((volatile unsigned char *)(ulBase + ulRegister))) = 0x00000020;
}


x86 assembly (clang, -O0):
<USBHostRequestIN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <USBHostRequestIN+0x24>
movq   $0x102,-0x18(%rbp)
jmp    1136 <USBHostRequestIN+0x36>
mov    -0x10(%rbp),%rax
sub    $0x10,%rax
add    $0x116,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
movb   $0x20,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostRequestIN>:
lea    0x106(%rsi),%rax
test   %rsi,%rsi
mov    $0x102,%ecx
cmovne %rax,%rcx
movb   $0x20,(%rcx,%rdi,1)
ret

LLVM IR (-O0):
define void @USBHostRequestIN(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 258, i64* %5
br label %13
9: ; preds = %2
%10 = load i64, i64* %4
%11 = sub i64 %10, 16
%12 = add i64 278, %11
store i64 %12, i64* %5
br label %13
13: ; preds = %9, %8
%14 = load i64, i64* %3
%15 = load i64, i64* %5
%16 = add i64 %14, %15
%17 = inttoptr i64 %16 to i8*
store volatile i8 32, i8* %17
ret void
}

LLVM IR (-O2):
define void @USBHostRequestIN(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = add i64 %1, 262
%5 = select i1 %3, i64 258, i64 %4
%6 = add i64 %5, %0
%7 = inttoptr i64 %6 to i8*
store volatile i8 32, i8* %7
ret void
}
/* Variables and functions */
size_t spt_min(size_t a, size_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<spt_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <spt_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <spt_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spt_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @spt_min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
float fromFloat_float(float x) { return x; }


x86 assembly (clang, -O0):
<fromFloat_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @fromFloat_float(float returned %0) {
ret float %0
}