xunge/DecIR huggingface dataset:
int longGreaterThan(const void *a, const void *b) {
  long an = *(long *)a;
  long bn = *(long *)b;
  if (an > bn)
    return 1;
  else if (an == bn)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<longGreaterThan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113c <longGreaterThan+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <longGreaterThan+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <longGreaterThan+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <longGreaterThan+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longGreaterThan>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setne  %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @longGreaterThan(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
store i64 %10, i64* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = icmp sgt i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load i64, i64* %6
%20 = load i64, i64* %7
%21 = icmp eq i64 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %3
br label %24
23: ; preds = %18
store i32 -1, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @longGreaterThan(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void unlink_pidfile_cb(void *handler) {
  char *pidfilenam = handler;
  unlink(pidfilenam);
}


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

x86 assembly (clang, -O2):
<unlink_pidfile_cb>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @unlink_pidfile_cb(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_mod_int16_t(int16_t m) { printf("K:=GF(%d);\n", m); }


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

x86 assembly (clang, -O2):
<print_mod_int16_t>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"K:=GF(%d);\0A\00"
define void @print_mod_int16_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"K:=GF(%d);\0A\00"
define void @print_mod_int16_t(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
const char *parse_route_options(struct cnfnode *cn_top, const char *p) {
  return p;
}


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

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

LLVM IR (-O0):
%struct.cnfnode = type opaque
define i8* @parse_route_options(%struct.cnfnode* %0, i8* %1) {
%3 = alloca %struct.cnfnode*
%4 = alloca i8*
store %struct.cnfnode* %0, %struct.cnfnode** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
%struct.cnfnode = type opaque
define i8* @parse_route_options(%struct.cnfnode* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_request_call_context_reset() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_request_call_context_reset>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_reset() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_reset() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
scalar_t__ isalnum(char);
int wIsNonBreakingChar(char c) {
  if (isalnum(c)) {
    return 1;
  }
  switch (c) {
  case '$':
  case '_':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<wIsNonBreakingChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     113d <wIsNonBreakingChar+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1176 <wIsNonBreakingChar+0x66>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x24,%eax
je     1163 <wIsNonBreakingChar+0x53>
jmp    1152 <wIsNonBreakingChar+0x42>
mov    -0xc(%rbp),%eax
sub    $0x5f,%eax
jne    116f <wIsNonBreakingChar+0x5f>
jmp    1163 <wIsNonBreakingChar+0x53>
movl   $0x1,-0x4(%rbp)
jmp    1176 <wIsNonBreakingChar+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wIsNonBreakingChar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x24,%bl
sete   %cl
cmp    $0x5f,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wIsNonBreakingChar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalnum(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %13
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
switch i32 %10, label %12 [
i32 36, label %11
i32 95, label %11
]
11: ; preds = %8, %8
store i32 1, i32* %2
br label %13
12: ; preds = %8
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @wIsNonBreakingChar(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 36
%5 = icmp eq i8 %0, 95
%6 = or i1 %4, %5
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int div(int lho, int rho) { return lho / rho; }


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

x86 assembly (clang, -O2):
<div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int fun563() { return 563; }


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

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

LLVM IR (-O0):
define i32 @fun563() {
ret i32 563
}

LLVM IR (-O2):
define i32 @fun563() {
ret i32 563
}
/* Variables and functions */
int /*<<< orphan*/ sys_call(int, int /*<<< orphan*/, int);
void echoShellON() { sys_call(6, 0, 1); }


x86 assembly (clang, -O0):
<echoShellON>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoShellON>:
mov    $0x6,%edi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define void @echoShellON() {
%1 = call i32 @sys_call(i32 6, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @echoShellON() {
%1 = tail call i32 @sys_call(i32 6, i32 0, i32 1)
ret void
}
void netcdf_SetVerticalDatumSpatial(int VerticalDatumFlag) {}


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

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

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

LLVM IR (-O2):
define void @netcdf_SetVerticalDatumSpatial(i32 %0) {
ret void
}
char *BN_GetVersion(void) { return "1.6.3"; }


x86 assembly (clang, -O0):
<BN_GetVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.6.3\00"
define i8* @BN_GetVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.6.3\00"
define i8* @BN_GetVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ bnd_unbind(char *);
void irc_unbind_event(char *event) { bnd_unbind(event); }


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

x86 assembly (clang, -O2):
<irc_unbind_event>:
jmp    1030 <bnd_unbind@plt>

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

LLVM IR (-O2):
define void @irc_unbind_event(i8* %0) {
%2 = tail call i32 @bnd_unbind(i8* %0)
ret void
}
int test_imm_33int16_mem(short *val) {
  return ((*val) & (-0x33 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_33int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -51
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_E8int8_reg(signed char val) {
  return ((val) & (0xE8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E8int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xe8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E8int8_reg>:
test   $0xe8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E8int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 232
%6 = icmp ne i32 %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_E8int8_reg(i8 signext %0) {
%2 = and i8 %0, -24
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/
__softboundmpx_propagate_metadata_shadow_stack_from(int, int /*<<< orphan*/);
char *rindex(char *, int);
__attribute__((__weak__, __always___)) char *softboundmpx_rindex(char *s,
                                                                 int c) {
  char *ret_ptr = rindex(s, c);
  __softboundmpx_propagate_metadata_shadow_stack_from(1, 0);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_rindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <rindex@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <__softboundmpx_propagate_metadata_shadow_stack_from@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_rindex>:
push   %rbx
call   1040 <rindex@plt>
mov    %rax,%rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <__softboundmpx_propagate_metadata_shadow_stack_from@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundmpx_rindex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @rindex(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = call i32 @__softboundmpx_propagate_metadata_shadow_stack_from(i32 1, i32 0)
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define weak i8* @softboundmpx_rindex(i8* %0, i32 %1) {
%3 = tail call i8* @rindex(i8* %0, i32 %1)
%4 = tail call i32 @__softboundmpx_propagate_metadata_shadow_stack_from(i32 1, i32 0)
ret i8* %3
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strtolower(char *);
int convert_answer_to_int(char *answer) {
  strtolower(answer);
  if (strcmp(answer, "yes") == 0) {
    return 1;
  } else if (strcmp(answer, "no") == 0) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<convert_answer_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strtolower@plt>
mov    -0x10(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    115b <convert_answer_to_int+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1188 <convert_answer_to_int+0x68>
mov    -0x10(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1181 <convert_answer_to_int+0x61>
movl   $0x0,-0x4(%rbp)
jmp    1188 <convert_answer_to_int+0x68>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_answer_to_int>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strtolower@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1153 <convert_answer_to_int+0x33>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @convert_answer_to_int(i8* %0) {
%2 = tail call i32 @strtolower(i8* %0)
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 1, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sfree(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @sfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
double cc_battery_to_voltage(double battery) { return battery / 32767.0 * 5.0; }


x86 assembly (clang, -O0):
<cc_battery_to_voltage>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_battery_to_voltage>:
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @cc_battery_to_voltage(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.276700e+04
%5 = fmul double %4, 5.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @cc_battery_to_voltage(double %0) {
%2 = fdiv double %0, 3.276700e+04
%3 = fmul double %2, 5.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetVolume(void *, int);
int /*<<< orphan*/ printf(char *, unsigned int, char *);
void UPnPRenderingControl_GetVolume(void *upnptoken, unsigned int InstanceID,
                                    char *Channel) {
  printf("Invoke: UPnPRenderingControl_GetVolume(%u,%s);\r\n", InstanceID,
         Channel);
  UPnPResponse_RenderingControl_GetVolume(upnptoken, 250);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetVolume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1040 <UPnPResponse_RenderingControl_GetVolume@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetVolume>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_GetVolume@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Invoke: UPnPRenderingControl_GetVolume(%u,%s);\0D\0A\00"
define void @UPnPRenderingControl_GetVolume(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_RenderingControl_GetVolume(i8* %10, i32 250)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Invoke: UPnPRenderingControl_GetVolume(%u,%s);\0D\0A\00"
define void @UPnPRenderingControl_GetVolume(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @UPnPResponse_RenderingControl_GetVolume(i8* %0, i32 250)
ret void
}
double length(int r) { return 2 * 3.1415926 * r; }


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 0x401921FB4D12D84A, %4
ret double %5
}

LLVM IR (-O2):
define double @length(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x401921FB4D12D84A
ret double %3
}
double get_pi(void) { return 3.14159265359f; }


x86 assembly (clang, -O0):
<get_pi>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pi>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_pi() {
ret double 0x400921FB60000000
}

LLVM IR (-O2):
define double @get_pi() {
ret double 0x400921FB60000000
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int dispaly_results(double gpa) {
  printf("GPA =  %.2lf\n", gpa);
  return 0;
}


x86 assembly (clang, -O0):
<dispaly_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"GPA = %.2lf\0A\00"
define i32 @dispaly_results(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"GPA = %.2lf\0A\00"
define i32 @dispaly_results(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ move_up(int);
void cmd_up(const char *pf, char **args) { move_up(1); }


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

x86 assembly (clang, -O2):
<cmd_up>:
mov    $0x1,%edi
jmp    1030 <move_up@plt>

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

LLVM IR (-O2):
define void @cmd_up(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 @move_up(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_dmb(int);
int /*<<< orphan*/ __builtin_arm_dsb(int);
int /*<<< orphan*/ __builtin_arm_isb(int);
void barriers() {
  __builtin_arm_dmb(1);
  __builtin_arm_dsb(2);
  __builtin_arm_isb(3);
}


x86 assembly (clang, -O0):
<barriers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <__builtin_arm_dmb@plt>
mov    $0x2,%edi
call   1040 <__builtin_arm_dsb@plt>
mov    $0x3,%edi
call   1030 <__builtin_arm_isb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<barriers>:
push   %rax
mov    $0x1,%edi
call   1050 <__builtin_arm_dmb@plt>
mov    $0x2,%edi
call   1040 <__builtin_arm_dsb@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <__builtin_arm_isb@plt>

LLVM IR (-O0):
define void @barriers() {
%1 = call i32 @__builtin_arm_dmb(i32 1)
%2 = call i32 @__builtin_arm_dsb(i32 2)
%3 = call i32 @__builtin_arm_isb(i32 3)
ret void
}

LLVM IR (-O2):
define void @barriers() {
%1 = tail call i32 @__builtin_arm_dmb(i32 1)
%2 = tail call i32 @__builtin_arm_dsb(i32 2)
%3 = tail call i32 @__builtin_arm_isb(i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ANATOP_TAMP_LOW_HIGH_DriverIRQHandler();
__attribute__((weak)) void ANATOP_TAMP_LOW_HIGH_IRQHandler(void) {
  ANATOP_TAMP_LOW_HIGH_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @ANATOP_TAMP_LOW_HIGH_IRQHandler() {
%1 = call i32 (...) @ANATOP_TAMP_LOW_HIGH_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ANATOP_TAMP_LOW_HIGH_IRQHandler() {
%1 = tail call i32 (...) @ANATOP_TAMP_LOW_HIGH_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strdup(char const *);
int vle_compl_put_match(int /*<<< orphan*/);
int vle_compl_add_match(const char match[]) {
  return vle_compl_put_match(strdup(match));
}


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

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

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

LLVM IR (-O2):
define i32 @vle_compl_add_match(i8* %0) {
%2 = tail call i32 @strdup(i8* %0)
%3 = tail call i32 @vle_compl_put_match(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ average(int, double, double, double, double, double);
int /*<<< orphan*/ message(char *, ...);
int main(int argc, char **argv) {
  message("this is message");
  message("average: %lf", average(5, 25.0, 35.7, 50.1, 127.6, 75.0));
  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    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <message@plt>
mov    $0x5,%edi
movsd  0xeaf(%rip),%xmm0
movsd  0xeaf(%rip),%xmm1
movsd  0xeaf(%rip),%xmm2
movsd  0xeaf(%rip),%xmm3
movsd  0xeaf(%rip),%xmm4
call   1040 <average@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <message@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
xor    %eax,%eax
call   1030 <message@plt>
movsd  0xec9(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
movsd  0xec9(%rip),%xmm2
movsd  0xec9(%rip),%xmm3
movsd  0xec9(%rip),%xmm4
mov    $0x5,%edi
call   1040 <average@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <message@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"this is message\00"
@.str.1 = [13 x i8] c"average: %lf\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 (i8*, ...) @message(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @average(i32 5, double 2.500000e+01, double 3.570000e+01, double 5.010000e+01, double 1.276000e+02, double 7.500000e+01)
%8 = call i32 (i8*, ...) @message(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"this is message\00"
@.str.1 = [13 x i8] c"average: %lf\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @message(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @average(i32 5, double 2.500000e+01, double 3.570000e+01, double 5.010000e+01, double 1.276000e+02, double 7.500000e+01)
%5 = tail call i32 (i8*, ...) @message(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_alrm(int signo) { printf("SIGALRM caught\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"SIGALRM caught\0A\00"
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"SIGALRM caught\00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t getpid(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @getpid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getpid() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ u_swap(int *, int, int);
void u_reverse(int *items, int size) {
  for (int i = 0; i < size / 2; i++) {
    u_swap(items, i, (size - 1) - i);
  }
}


x86 assembly (clang, -O0):
<u_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1167 <u_reverse+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
sub    -0x10(%rbp),%edx
call   1030 <u_swap@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <u_reverse+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_reverse>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     1157 <u_reverse+0x47>
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%r15d
shr    $0x1f,%r15d
add    %esi,%r15d
sar    %r15d
add    $0xffffffff,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <u_swap@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %ebp,%r15d
jne    1140 <u_reverse+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @u_reverse(i32* %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = icmp sgt i32 %1, 1
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ 0, %2 ]
%8 = xor i32 %7, -1
%9 = add i32 %8, %1
%10 = tail call i32 @u_swap(i32* %0, i32 %7, i32 %9)
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %3
br i1 %12, label %5, label %6
}
/* Type definitions */
struct queue_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Enqueue(struct queue_s *, int, int);
int random();
void Send_msg(struct queue_s *msg_queues[], int my_rank, int thread_count,
              int msg_number) {
  int mesg = -msg_number;
  int dest = random() % thread_count;
#pragma omp critical
  Enqueue(msg_queues[dest], my_rank, mesg);
}


x86 assembly (clang, -O0):
<Send_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <random@plt>
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <Enqueue@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Send_msg>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%r15
neg    %ebx
xor    %eax,%eax
call   1040 <random@plt>
cltd
idiv   %ebp
movslq %edx,%rax
mov    (%r15,%rax,8),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <Enqueue@plt>

LLVM IR (-O0):
%struct.queue_s = type { i32 }
define void @Send_msg(%struct.queue_s** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.queue_s**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.queue_s** %0, %struct.queue_s*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %8
%12 = sub nsw i32 0, %11
store i32 %12, i32* %9
%13 = call i32 (...) @random()
%14 = load i32, i32* %7
%15 = srem i32 %13, %14
store i32 %15, i32* %10
%16 = load %struct.queue_s**, %struct.queue_s*** %5
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds %struct.queue_s*, %struct.queue_s** %16, i64 %18
%20 = load %struct.queue_s*, %struct.queue_s** %19
%21 = load i32, i32* %6
%22 = load i32, i32* %9
%23 = call i32 @Enqueue(%struct.queue_s* %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
%struct.queue_s = type { i32 }
define void @Send_msg(%struct.queue_s** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 0, %3
%6 = tail call i32 (...) @random()
%7 = srem i32 %6, %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.queue_s*, %struct.queue_s** %0, i64 %8
%10 = load %struct.queue_s*, %struct.queue_s** %9
%11 = tail call i32 @Enqueue(%struct.queue_s* %10, i32 %1, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *basename) {
  fprintf(stderr, "usage: %s [-h] offset\n", basename);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"usage: %s [-h] offset\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
long time(int /*<<< orphan*/ *);
get_time() {
  int seconds;
  long longseconds;
  longseconds = time(NULL);
  seconds = longseconds;
  return (seconds);
}


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

x86 assembly (clang, -O2):
<get_time>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @get_time() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 @time(i32* null)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_time() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ rend_cache_entry_free(void *);
void rend_cache_entry_free_(void *p) { rend_cache_entry_free(p); }


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

x86 assembly (clang, -O2):
<rend_cache_entry_free_>:
jmp    1030 <rend_cache_entry_free@plt>

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

LLVM IR (-O2):
define void @rend_cache_entry_free_(i8* %0) {
%2 = tail call i32 @rend_cache_entry_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) { printf("Usage: brother [-c path/to/config/file]\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: brother [-c path/to/config/file]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Usage: brother [-c path/to/config/file]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg2_16(int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *, int, int,
                              int /*<<< orphan*/);
void MC_avg_x_16_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                        int height) {
  MC_avg2_16(height, dest, ref, stride, 1, 0);
}


x86 assembly (clang, -O0):
<MC_avg_x_16_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <MC_avg2_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_x_16_mmxext>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
jmp    1030 <MC_avg2_16@plt>

LLVM IR (-O0):
define void @MC_avg_x_16_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @MC_avg2_16(i32 %9, i32* %10, i32* %11, i32 %12, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @MC_avg_x_16_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg2_16(i32 %3, i32* %0, i32* %1, i32 %2, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int /*<<< orphan*/);
int blankline(char *str) {
  while (*str) {
    if (!isspace(*str++)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<blankline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <blankline+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1155 <blankline+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1161 <blankline+0x51>
jmp    111c <blankline+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blankline>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1138 <blankline+0x28>
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <blankline+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @blankline(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = tail call i32 @isspace(i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
main() {
  int x[][2] = {
      {0, 0},
      {1, 2},
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.x = [2 x [2 x i32]] [[2 x i32] zeroinitializer, [2 x i32] [i32 1, i32 2]]
define i32 @main() {
%1 = alloca [2 x [2 x i32]]
%2 = bitcast [2 x [2 x i32]]* %1 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
long foo(long a, long b) {
  long ret = 0;
  ret = a / b;
  return ret + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1119 <foo+0x19>
cqto
idiv   %rsi
add    $0x1,%rax
ret
xor    %edx,%edx
div    %esi
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sdiv i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = add nsw i64 %9, 1
ret i64 %10
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = add nsw i64 %3, 1
ret i64 %4
}
int main() {
  printf("pid %d\n", getpid());
  sleep(10);
  asm("int $3");
  printf("Hello World\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1050 <sleep@plt>
int3
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
xor    %eax,%eax
call   1060 <sleep@plt>
int3
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"pid %d\0A\00"
@.str.1 = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 10)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"pid %d\0A\00"
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 10)
tail call void asm sideeffect "int $$3", "~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, size_t, int /*<<< orphan*/ const *);
int setgroups(size_t count, const gid_t list[]) {
  return syscall(81, count, list);
}


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

x86 assembly (clang, -O2):
<setgroups>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x51,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @setgroups(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = load i32*, i32** %4
%7 = call i32 @syscall(i32 81, i64 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @setgroups(i64 %0, i32* %1) {
%3 = tail call i32 @syscall(i32 81, i64 %0, i32* %1)
ret i32 %3
}