xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_usage(const char *prog) {
  printf("Usage: %s [-Db25678e]\n", prog);
  puts("  -t --tty      device to use (default /dev/ttyAMA0)\n"
       "  -j --joystick device to use (default /dev/input/js0\n"
       "  -c --config   joystick mapping file (default /etc/jsmaster.conf)\n"
       "  -b --baud     baud rate (default 9600)\n"
       "  -2            use two stop bits instead of one\n"
       "  -5            bits per word\n"
       "  -6            bits per word\n"
       "  -7            bits per word\n"
       "  -8            bits per word (default)\n"
       "  -e            even parity (default odd)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s [-Db25678e]\0A\00"
@.str.1 = [437 x i8] c" -t --tty device to use (default /dev/ttyAMA0)\0A -j --joystick device to use (default /dev/input/js0\0A -c --config joystick mapping file (default /etc/jsmaster.conf)\0A -b --baud baud rate (default 9600)\0A -2 use two stop bits instead of one\0A -5 bits per word\0A -6 bits per word\0A -7 bits per word\0A -8 bits per word (default)\0A -e even parity (default odd)\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([437 x i8], [437 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s [-Db25678e]\0A\00"
@.str.1 = [437 x i8] c" -t --tty device to use (default /dev/ttyAMA0)\0A -j --joystick device to use (default /dev/input/js0\0A -c --config joystick mapping file (default /etc/jsmaster.conf)\0A -b --baud baud rate (default 9600)\0A -2 use two stop bits instead of one\0A -5 bits per word\0A -6 bits per word\0A -7 bits per word\0A -8 bits per word (default)\0A -e even parity (default odd)\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([437 x i8], [437 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mmx_test();
void __attribute__((no)) do_test(void) { mmx_test(); }


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

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

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

LLVM IR (-O2):
define void @do_test() {
%1 = tail call i32 (...) @mmx_test()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getdelim(char **, size_t *, char, int /*<<< orphan*/ *);
ssize_t getline(char **lineptr, size_t *n, FILE *stream) {
  return getdelim(lineptr, n, '\n', stream);
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0xa,%edx
call   1030 <getdelim@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
mov    %rdx,%rcx
mov    $0xa,%edx
jmp    1030 <getdelim@plt>

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

LLVM IR (-O2):
define i32 @getline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @getdelim(i8** %0, i64* %1, i8 signext 10, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ audio_ic_set_agc();
int /*<<< orphan*/ menu_numeric_toggle(void *, int, int /*<<< orphan*/, int);
void audio_alc_toggle(void *priv, int delta) {
  menu_numeric_toggle(priv, 1, 0, 1);
  audio_ic_set_agc();
}


x86 assembly (clang, -O0):
<audio_alc_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1030 <menu_numeric_toggle@plt>
mov    $0x0,%al
call   1040 <audio_ic_set_agc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_alc_toggle>:
push   %rax
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <menu_numeric_toggle@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <audio_ic_set_agc@plt>

LLVM IR (-O0):
define void @audio_alc_toggle(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @menu_numeric_toggle(i8* %5, i32 1, i32 0, i32 1)
%7 = call i32 (...) @audio_ic_set_agc()
ret void
}

LLVM IR (-O2):
define void @audio_alc_toggle(i8* %0, i32 %1) {
%3 = tail call i32 @menu_numeric_toggle(i8* %0, i32 1, i32 0, i32 1)
%4 = tail call i32 (...) @audio_ic_set_agc()
ret void
}
/* Variables and functions */
int OK;
int PDC_get_font() { return (OK); }


x86 assembly (clang, -O0):
<PDC_get_font>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_get_font>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @PDC_get_font() {
%1 = load i32, i32* @OK
ret i32 %1
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_get_font() {
%1 = load i32, i32* @OK
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fb_write(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void fb_write_str(char *buf) { fb_write(buf, strlen(buf)); }


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

x86 assembly (clang, -O2):
<fb_write_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <fb_write@plt>

LLVM IR (-O0):
define void @fb_write_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @fb_write(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @fb_write_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @fb_write(i8* %0, i32 %2)
ret void
}
void rop3_250_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | T;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_250_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)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %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_250_0_1>:
mov    (%rdi),%al
or     %al,%dl
and    %sil,%dl
or     %al,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_250_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = and i8 %5, %1
%7 = or i8 %4, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int __attribute__((no)) getAnswer(int a, char b) {
  printf(".");
  return 42;
}


x86 assembly (clang, -O0):
<getAnswer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAnswer>:
push   %rax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x2a,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getAnswer(i32 %0, i8 signext %1) {
%3 = tail call i32 @putchar(i32 46)
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
int cmd_ghn_ethboot(int argc, char *argv[]) {
  printw("Ghn ETH Boot command\n");
  return 0;
}


x86 assembly (clang, -O0):
<cmd_ghn_ethboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printw@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"Ghn ETH Boot command\0A\00"
define i32 @cmd_ghn_ethboot(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printw(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Ghn ETH Boot command\0A\00"
define i32 @cmd_ghn_ethboot(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printw(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
init_poly1(poly) double poly[25];
{ bzero(poly, 25 * sizeof(double)); }


x86 assembly (clang, -O0):
<init_poly1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_poly1>:
xorps  %xmm0,%xmm0
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movq   $0x0,0xc0(%rdi)
ret

LLVM IR (-O0):
define i32 @init_poly1(double* %0) {
%2 = alloca i32
%3 = alloca double*
store double* %0, double** %3
%4 = load double*, double** %3
%5 = bitcast double* %4 to i8*
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @init_poly1(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to i8*
tail call void @llvm.memset.p0i8.i64(i8* align 8 dereferenceable(200) %2, i8 0, i64 200, i1 false)
ret i32 undef
}
void gfs2_alloc_put(struct gfs2_inode *ip) { return; }


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

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

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

LLVM IR (-O2):
%struct.gfs2_inode = type opaque
define void @gfs2_alloc_put(%struct.gfs2_inode* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_file(char *);
int main(int argc, char **argv) {
  process_file("test.cho");
  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    0xed3(%rip),%rdi
call   1030 <process_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"test.cho\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 @process_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.cho\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @process_file(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void DH_check(void) {}


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

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

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

LLVM IR (-O2):
define void @DH_check() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ds2770_init();
int /*<<< orphan*/ ds2770_skipROM();
int /*<<< orphan*/ ds2770_writeByte(int);
void ds2770_refresh() {
  ds2770_init();
  ds2770_skipROM();
  ds2770_writeByte(0x63);
}


x86 assembly (clang, -O0):
<ds2770_refresh>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ds2770_init@plt>
mov    $0x0,%al
call   1030 <ds2770_skipROM@plt>
mov    $0x63,%edi
call   1040 <ds2770_writeByte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds2770_refresh>:
push   %rax
xor    %eax,%eax
call   1050 <ds2770_init@plt>
xor    %eax,%eax
call   1030 <ds2770_skipROM@plt>
mov    $0x63,%edi
pop    %rax
jmp    1040 <ds2770_writeByte@plt>

LLVM IR (-O0):
define void @ds2770_refresh() {
%1 = call i32 (...) @ds2770_init()
%2 = call i32 (...) @ds2770_skipROM()
%3 = call i32 @ds2770_writeByte(i32 99)
ret void
}

LLVM IR (-O2):
define void @ds2770_refresh() {
%1 = tail call i32 (...) @ds2770_init()
%2 = tail call i32 (...) @ds2770_skipROM()
%3 = tail call i32 @ds2770_writeByte(i32 99)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((constructor)) void setup(void) {
  fprintf(stderr, "called setup()\n");
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"called setup()\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @setup, i8* null }]
define void @setup() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"called setup()\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @setup, i8* null }]
define void @setup() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(unsigned short *);
unsigned int arithmetic_decimal_add(unsigned short a, unsigned short b,
                                    unsigned short *p_result) {
  assert(p_result);
  unsigned int err_code = 0;
  if (!p_result) {
    err_code = 2;
    goto end;
  }
  *p_result = (a + b);
end:
  return err_code;
}


x86 assembly (clang, -O0):
<arithmetic_decimal_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <arithmetic_decimal_add+0x41>
movl   $0x2,-0x14(%rbp)
jmp    1165 <arithmetic_decimal_add+0x55>
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arithmetic_decimal_add>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %rdx,%rdi
call   1030 <assert@plt>
test   %rbx,%rbx
je     1133 <arithmetic_decimal_add+0x23>
add    %r14d,%ebp
mov    %bp,(%rbx)
xor    %eax,%eax
jmp    1138 <arithmetic_decimal_add+0x28>
mov    $0x2,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @arithmetic_decimal_add(i16 zeroext %0, i16 zeroext %1, i16* %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16*
%7 = alloca i32
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16* %2, i16** %6
%8 = load i16*, i16** %6
%9 = call i32 @assert(i16* %8)
store i32 0, i32* %7
%10 = load i16*, i16** %6
%11 = icmp ne i16* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i32 2, i32* %7
br label %21
13: ; preds = %3
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = load i16, i16* %5
%17 = zext i16 %16 to i32
%18 = add nsw i32 %15, %17
%19 = trunc i32 %18 to i16
%20 = load i16*, i16** %6
store i16 %19, i16* %20
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @arithmetic_decimal_add(i16 zeroext %0, i16 zeroext %1, i16* %2) {
%4 = tail call i32 @assert(i16* %2)
%5 = icmp eq i16* %2, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = add i16 %1, %0
store i16 %7, i16* %2
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 2, %3 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
int digest_is_digest(const char *header_value) {
  if (NULL == header_value) {
    return -1;
  }
  if (0 != strncmp(header_value, "Digest", 6)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<digest_is_digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1134 <digest_is_digest+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <digest_is_digest+0x5a>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1163 <digest_is_digest+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <digest_is_digest+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digest_is_digest>:
test   %rdi,%rdi
je     1131 <digest_is_digest+0x21>
push   %rax
lea    0xee3(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Digest\00"
define i32 @digest_is_digest(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void childAlarm(int sig) {
  printf("\nNumeric value of signal SIGALRM is %d\n", sig);
  printf("Child received the signal\n");
  exit(0);
}


x86 assembly (clang, -O0):
<childAlarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<childAlarm>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0ANumeric value of signal SIGALRM is %d\0A\00"
@.str.1 = [27 x i8] c"Child received the signal\0A\00"
define void @childAlarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0ANumeric value of signal SIGALRM is %d\0A\00"
@str = [26 x i8] c"Child received the signal\00"
define void @childAlarm(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
int __attribute__((no)) foo_protected(void) { return -40; }


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

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

LLVM IR (-O0):
define i32 @foo_protected() {
ret i32 -40
}

LLVM IR (-O2):
define i32 @foo_protected() {
ret i32 -40
}
/* Variables and functions */
int LLI2C_output_clock(int);
int LLI2C_output_data(int);
int send_i2c_stop(void) {
  int err;
  err = LLI2C_output_data(0);
  if (err)
    return err;
  err = LLI2C_output_clock(1);
  if (err)
    return err;
  err = LLI2C_output_data(1);
  if (err)
    return err;
  return 0;
}


x86 assembly (clang, -O0):
<send_i2c_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <LLI2C_output_data@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1147 <send_i2c_stop+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <send_i2c_stop+0x72>
mov    $0x1,%edi
call   1040 <LLI2C_output_clock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1169 <send_i2c_stop+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <send_i2c_stop+0x72>
mov    $0x1,%edi
call   1030 <LLI2C_output_data@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     118b <send_i2c_stop+0x6b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <send_i2c_stop+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_i2c_stop>:
push   %rax
xor    %edi,%edi
call   1030 <LLI2C_output_data@plt>
test   %eax,%eax
jne    113a <send_i2c_stop+0x1a>
mov    $0x1,%edi
call   1040 <LLI2C_output_clock@plt>
test   %eax,%eax
je     113c <send_i2c_stop+0x1c>
pop    %rcx
ret
mov    $0x1,%edi
pop    %rax
jmp    1030 <LLI2C_output_data@plt>

LLVM IR (-O0):
define i32 @send_i2c_stop() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @LLI2C_output_data(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %21
8: ; preds = %0
%9 = call i32 @LLI2C_output_clock(i32 1)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i32, i32* %2
store i32 %13, i32* %1
br label %21
14: ; preds = %8
%15 = call i32 @LLI2C_output_data(i32 1)
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %2
store i32 %19, i32* %1
br label %21
20: ; preds = %14
store i32 0, i32* %1
br label %21
21: ; preds = %20, %18, %12, %6
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @send_i2c_stop() {
%1 = tail call i32 @LLI2C_output_data(i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 @LLI2C_output_clock(i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @LLI2C_output_data(i32 1)
br label %8
8: ; preds = %6, %3, %0
%9 = phi i32 [ %1, %0 ], [ %4, %3 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *malloc_fail(size_t size) {
  void *p = malloc(size);
  if (!p) {
    perror("malloc");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<malloc_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <malloc_fail+0x3e>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_fail>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <malloc_fail+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define i8* @malloc_fail(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @malloc_fail(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ GL_FOG_MODE;
int /*<<< orphan*/ glFogf(int /*<<< orphan*/, int);
int /*<<< orphan*/ glutPostRedisplay();
void fog_select(int fog) {
  glFogf(GL_FOG_MODE, fog);
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<fog_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <glFogf@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fog_select>:
push   %rax
mov    %edi,%esi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <glFogf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>

LLVM IR (-O0):
@GL_FOG_MODE = global i32 0
define void @fog_select(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @GL_FOG_MODE
%4 = load i32, i32* %2
%5 = call i32 @glFogf(i32 %3, i32 %4)
%6 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
@GL_FOG_MODE = global i32 0
define void @fog_select(i32 %0) {
%2 = load i32, i32* @GL_FOG_MODE
%3 = tail call i32 @glFogf(i32 %2, i32 %0)
%4 = tail call i32 (...) @glutPostRedisplay()
ret void
}
int is_digit(char character) {
  int temp_ascii = (int)character;
  if ((temp_ascii >= 48) && (temp_ascii <= 57)) {
    return 3;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x30,-0xc(%rbp)
jl     1131 <is_digit+0x31>
cmpl   $0x39,-0xc(%rbp)
jg     1131 <is_digit+0x31>
movl   $0x3,-0x4(%rbp)
jmp    1138 <is_digit+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
lea    (%rax,%rax,2),%eax
ret

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

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = select i1 %3, i32 3, i32 0
ret i32 %4
}
char *trimSpaces(char *str) { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @trimSpaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @trimSpaces(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
int foo6(void) { return 6; }


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

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

LLVM IR (-O0):
define i32 @foo6() {
ret i32 6
}

LLVM IR (-O2):
define i32 @foo6() {
ret i32 6
}
int test_imm_ECint64_highword_reg(long long val) {
  return ((val >> 32) & (0xEC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ECint64_highword_reg>:
movabs $0xec00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ECint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 236
%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_ECint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1013612281856
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fun537() { return 537; }


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

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

LLVM IR (-O0):
define i32 @fun537() {
ret i32 537
}

LLVM IR (-O2):
define i32 @fun537() {
ret i32 537
}
long int Pow(long int X, unsigned int N) {
  if (N == 0)
    return 1;
  if (N == 1)
    return X;
  if (((N) % 2 == 0))
    return Pow(X * X, N / 2);
  else
    return Pow(X * X, N / 2) * X;
}


x86 assembly (clang, -O0):
<Pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1136 <Pow+0x26>
movq   $0x1,-0x8(%rbp)
jmp    1196 <Pow+0x86>
cmpl   $0x1,-0x14(%rbp)
jne    114d <Pow+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1196 <Pow+0x86>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1179 <Pow+0x69>
mov    -0x10(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
shr    $0x1,%esi
call   1030 <Pow@plt>
mov    %rax,-0x8(%rbp)
jmp    1196 <Pow+0x86>
mov    -0x10(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
shr    $0x1,%esi
call   1030 <Pow@plt>
imul   -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pow>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
test   %esi,%esi
je     1132 <Pow+0x32>
mov    %rdi,%rax
cmp    $0x1,%esi
je     1137 <Pow+0x37>
mov    %esi,%edx
mov    %rax,%rdi
imul   %rax,%rdi
shr    %esi
test   $0x1,%dl
je     1110 <Pow+0x10>
imul   %rax,%rcx
jmp    1110 <Pow+0x10>
mov    $0x1,%eax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @Pow(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 1, i64* %3
br label %34
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i64, i64* %4
store i64 %13, i64* %3
br label %34
14: ; preds = %9
%15 = load i32, i32* %5
%16 = urem i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i64, i64* %4
%20 = load i64, i64* %4
%21 = mul nsw i64 %19, %20
%22 = load i32, i32* %5
%23 = udiv i32 %22, 2
%24 = call i64 @Pow(i64 %21, i32 %23)
store i64 %24, i64* %3
br label %34
25: ; preds = %14
%26 = load i64, i64* %4
%27 = load i64, i64* %4
%28 = mul nsw i64 %26, %27
%29 = load i32, i32* %5
%30 = udiv i32 %29, 2
%31 = call i64 @Pow(i64 %28, i32 %30)
%32 = load i64, i64* %4
%33 = mul nsw i64 %31, %32
store i64 %33, i64* %3
br label %34
34: ; preds = %25, %18, %12, %8
%35 = load i64, i64* %3
ret i64 %35
}

LLVM IR (-O2):
define i64 @Pow(i64 %0, i32 %1) {
br label %3
3: ; preds = %15, %2
%4 = phi i64 [ %16, %15 ], [ 1, %2 ]
%5 = phi i64 [ %13, %15 ], [ %0, %2 ]
%6 = phi i32 [ %14, %15 ], [ %1, %2 ]
br label %7
7: ; preds = %10, %3
%8 = phi i64 [ %5, %3 ], [ %13, %10 ]
%9 = phi i32 [ %6, %3 ], [ %14, %10 ]
switch i32 %9, label %10 [
i32 0, label %17
i32 1, label %18
]
10: ; preds = %7
%11 = and i32 %9, 1
%12 = icmp eq i32 %11, 0
%13 = mul nsw i64 %8, %8
%14 = lshr i32 %9, 1
br i1 %12, label %7, label %15
15: ; preds = %10
%16 = mul nsw i64 %8, %4
br label %3
17: ; preds = %7
br label %18
18: ; preds = %7, %17
%19 = phi i64 [ 1, %17 ], [ %8, %7 ]
%20 = mul nsw i64 %19, %4
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void cr_dump_int_line(int i) { fprintf(stderr, "%i\n", i); }


x86 assembly (clang, -O0):
<cr_dump_int_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cr_dump_int_line>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%i\0A\00"
define void @cr_dump_int_line(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%i\0A\00"
define void @cr_dump_int_line(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void arch_exit_mmap(struct mm_struct *mm) {}


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

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

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

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @arch_exit_mmap(%struct.mm_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int *A, int p, int r) {
  if (p < r) {
    int q = partition(A, p, r);
    quickSort(A, p, (q - 1));
    quickSort(A, (q + 1), r);
  }
}


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

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

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int ft_isspace(int c) {
  unsigned char uc;
  uc = (unsigned char)c;
  if (uc == '\t' || uc == '\n' || uc == '\v' || uc == '\f' || uc == '\r' ||
      uc == ' ')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x9,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0xa,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0xb,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0xc,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0xd,%eax
je     115b <ft_isspace+0x5b>
movzbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jne    1167 <ft_isspace+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <ft_isspace+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110e <ft_isspace+0xe>
ret
cmp    $0x20,%dil
je     110d <ft_isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isspace(i32 %0) {
%2 = trunc i32 %0 to i8
switch i8 %2, label %3 [
i8 32, label %4
i8 13, label %4
i8 12, label %4
i8 11, label %4
i8 10, label %4
i8 9, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
int fun241() { return 241; }


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

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

LLVM IR (-O0):
define i32 @fun241() {
ret i32 241
}

LLVM IR (-O2):
define i32 @fun241() {
ret i32 241
}
int int_compare(unsigned int a, unsigned int b) {
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1122 <int_compare+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <int_compare+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    113a <int_compare+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <int_compare+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_compare>:
xor    %ecx,%ecx
cmp    %esi,%edi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_compare(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = icmp ugt i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void min_caml_border() { puts("=========="); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"==========\00"
define void @min_caml_border() {
%1 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"==========\00"
define void @min_caml_border() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void adiv5_init() {}


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

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

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

LLVM IR (-O2):
define void @adiv5_init() {
ret void
}
unsigned xrop3_76_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_76_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_76_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %esi
and    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_76_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) { puts("Hello, World"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}