xunge/DecIR huggingface dataset:
unsigned int get_int32_le(void *addr) {
  unsigned char *p = (unsigned char *)addr;
  return (unsigned int)(p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24));
}


x86 assembly (clang, -O0):
<get_int32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int32_le>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_int32_le(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 16
%20 = or i32 %14, %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 24
%26 = or i32 %20, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_int32_le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int product_print_table_footer(void) {
  printf("+--------+---------------------------------+----------"
         "+-----------+-----------+\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [80 x i8] c"+--------+---------------------------------+----------+-----------+-----------+\00"
define i32 @product_print_table_footer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ openlog(char const *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void _popeye_log_open(const char *ident) {
  openlog(ident, LOG_PID, LOG_DAEMON);
  return;
}


x86 assembly (clang, -O0):
<_popeye_log_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_popeye_log_open>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

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

LLVM IR (-O2):
@LOG_PID = global i32 0
@LOG_DAEMON = global i32 0
define void @_popeye_log_open(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_DAEMON
%4 = tail call i32 @openlog(i8* %0, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void output(char c) {
  if ('\0' != c)
    printf("%c", c);
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     113c <output+0x2c>
lea    0xecd(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
test   %dil,%dil
je     1125 <output+0x15>
movsbl %dil,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @output(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 0, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @output(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %5
5: ; preds = %3, %1
ret void
}
int HelpItem5(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem5() {
ret i32 0
}
/* Type definitions */
struct iwl_priv {
  int dummy;
};

/* Variables and functions */
int iwl_legacy_is_rfkill_hw(struct iwl_priv *);
int iwl_legacy_is_rfkill(struct iwl_priv *priv) {
  return iwl_legacy_is_rfkill_hw(priv);
}


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

x86 assembly (clang, -O2):
<iwl_legacy_is_rfkill>:
jmp    1030 <iwl_legacy_is_rfkill_hw@plt>

LLVM IR (-O0):
%struct.iwl_priv = type { i32 }
define i32 @iwl_legacy_is_rfkill(%struct.iwl_priv* %0) {
%2 = alloca %struct.iwl_priv*
store %struct.iwl_priv* %0, %struct.iwl_priv** %2
%3 = load %struct.iwl_priv*, %struct.iwl_priv** %2
%4 = call i32 @iwl_legacy_is_rfkill_hw(%struct.iwl_priv* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.iwl_priv = type { i32 }
define i32 @iwl_legacy_is_rfkill(%struct.iwl_priv* %0) {
%2 = tail call i32 @iwl_legacy_is_rfkill_hw(%struct.iwl_priv* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lua_check_string(int, char *);
int /*<<< orphan*/ pushresult(int);
scalar_t__ remove(int /*<<< orphan*/);
void io_remove(void) { pushresult(remove(lua_check_string(1, "remove")) == 0); }


x86 assembly (clang, -O0):
<io_remove>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xec0(%rip),%rsi
call   1040 <lua_check_string@plt>
mov    %eax,%edi
call   1030 <remove@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <pushresult@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_remove>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1040 <lua_check_string@plt>
mov    %eax,%edi
call   1030 <remove@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1050 <pushresult@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"remove\00"
define void @io_remove() {
%1 = call i32 @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i64 @remove(i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @pushresult(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"remove\00"
define void @io_remove() {
%1 = tail call i32 @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @remove(i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @pushresult(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned char plusccca(unsigned char a, unsigned char b) {
  unsigned char sum = a + b;
  if (sum < a)
    abort();
  return sum;
}


x86 assembly (clang, -O0):
<plusccca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jge    1148 <plusccca+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
movzbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plusccca>:
add    %dil,%sil
jb     1118 <plusccca+0x8>
mov    %esi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define zeroext i8 @plusccca(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %1, %0
%4 = icmp ult i8 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8 %3
}
float absf(float val) {
  if (val > 0)
    return val;
  else
    return -val;
}


x86 assembly (clang, -O0):
<absf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1129 <absf+0x29>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1140 <absf+0x40>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absf>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @absf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %3
store float %7, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %3
%10 = fneg float %9
store float %10, float* %2
br label %11
11: ; preds = %8, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @absf(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %0, float %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ addfield(char *, char *);
char *strrchr(char *, char);
void addsuffix(char *s, char *filename) {
  char *p;
  if (NULL != (p = strrchr(filename, '.')))
    addfield(s, p + 1);
}


x86 assembly (clang, -O0):
<addsuffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     1161 <addsuffix+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1040 <addfield@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addsuffix>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1146 <addsuffix+0x26>
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <addfield@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @addsuffix(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i32 @addfield(i8* %0, i8* %6)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ cond_signaller1();
void *cond_signaller1_wrap(void *v __attribute__((unused))) {
  return (void *)(intptr_t)cond_signaller1();
}


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

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

LLVM IR (-O0):
define i8* @cond_signaller1_wrap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @cond_signaller1()
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @cond_signaller1_wrap(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @cond_signaller1()
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void multiplyfive(void) {
  int x = 2;
  int five_times_x = 0;
  asm("leal (%1,%1,4), %0" : "=r"(five_times_x) : "r"(x));
  printf("x = %d five_times_x = %d\n", x, five_times_x);
}


x86 assembly (clang, -O0):
<multiplyfive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
lea    (%eax,%eax,4),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplyfive>:
mov    $0x2,%eax
lea    (%eax,%eax,4),%edx
lea    0xee0(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"x = %d five_times_x = %d\0A\00"
define void @multiplyfive() {
%1 = alloca i32
%2 = alloca i32
store i32 2, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %1
%4 = call i32 asm "leal ($1,$1,4), $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"x = %d five_times_x = %d\0A\00"
define void @multiplyfive() {
%1 = tail call i32 asm "leal ($1,$1,4), $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 2)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 2, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2CMasterEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long
          *)(((unsigned long)(0x40002000 + 0x00000820) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40002000 + 0x00000820) & 0x000FFFFF) << 5) |
             ((4) << 2)))) = 1;
  (*((volatile unsigned long *)(0x40002000 + 0x00000804))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CMasterEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x42050410,%eax
movq   $0x1,(%rax)
mov    $0x40002804,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterEnable>:
movq   $0x1,0x42050410
movq   $0x1,0x40002804
ret

LLVM IR (-O0):
define void @I2CMasterEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i64 1, i64* inttoptr (i64 1107624976 to i64*)
store volatile i64 1, i64* inttoptr (i64 1073752068 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2CMasterEnable(i32 %0) {
store volatile i64 1, i64* inttoptr (i64 1107624976 to i64*)
store volatile i64 1, i64* inttoptr (i64 1073752068 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void start1() {
  int i = 100;
  while (1) {
    printf("t1 %d\n", i++);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<start1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <start1+0xf>

x86 assembly (clang, -O2):
<start1>:
push   %rbp
push   %rbx
push   %rax
mov    $0x64,%esi
lea    0xed1(%rip),%rbx
nop
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %ebp,%esi
jmp    1130 <start1+0x10>

LLVM IR (-O0):
@.str = [7 x i8] c"t1 %d\0A\00"
define void @start1() {
%1 = alloca i32
store i32 100, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@.str = [7 x i8] c"t1 %d\0A\00"
define void @start1() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 100, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @sleep(i32 1)
br label %1
}
double util_walltime(void) {
  double time_in_secs = 0;
  return (time_in_secs);
}


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

x86 assembly (clang, -O2):
<util_walltime>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @util_walltime() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @util_walltime() {
ret double 0.000000e+00
}
int fun196() { return 196; }


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

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

LLVM IR (-O0):
define i32 @fun196() {
ret i32 196
}

LLVM IR (-O2):
define i32 @fun196() {
ret i32 196
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
off_t bsdiff_patchsize_max(off_t newsize, off_t oldsize) {
  return newsize + oldsize + 102400;
}


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

x86 assembly (clang, -O2):
<bsdiff_patchsize_max>:
lea    (%rdi,%rsi,1),%rax
add    $0x19000,%rax
ret

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

LLVM IR (-O2):
define i64 @bsdiff_patchsize_max(i64 %0, i64 %1) {
%3 = add i64 %0, 102400
%4 = add i64 %3, %1
ret i64 %4
}
void daemon_init(void) {}


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

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

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

LLVM IR (-O2):
define void @daemon_init() {
ret void
}
/* Variables and functions */
void gp2x_sound_frame(void *unused, unsigned char *stream, int samples) {
  int n;
  short *pu;
  pu = stream;
  for (n = 0; n < (samples); n++) {
    *pu++ = 0;
    *pu++ = 0;
  }
}


x86 assembly (clang, -O0):
<gp2x_sound_frame>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <gp2x_sound_frame+0x60>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x20(%rbp)
movw   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x20(%rbp)
movw   $0x0,(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111e <gp2x_sound_frame+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp2x_sound_frame>:
test   %edx,%edx
jle    1129 <gp2x_sound_frame+0x19>
push   %rax
mov    %edx,%edx
shl    $0x2,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @gp2x_sound_frame(i8* nocapture readnone %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
char *getprop(char *);
char *getprop_default(char *name, char *def) {
  char *rv;
  rv = getprop(name);
  if (rv)
    return (rv);
  else
    return (def);
}


x86 assembly (clang, -O0):
<getprop_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getprop@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1145 <getprop_default+0x35>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <getprop_default+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getprop_default>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getprop@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @getprop_default(i8* %0, i8* readnone %1) {
%3 = tail call i8* @getprop(i8* %0)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* %1, i8* %3
ret i8* %5
}
char *hash_plugin_summary(void) {
  return ("mozilla \tmozilla passphrase plugin");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"mozilla \09mozilla passphrase plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [35 x i8] c"mozilla \09mozilla passphrase plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stdout;
__attribute__((visibility("default"))) FILE *get_stdout() { return stdout; }


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

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

LLVM IR (-O0):
@stdout = global i32* null
define i32* @get_stdout() {
%1 = load i32*, i32** @stdout
ret i32* %1
}

LLVM IR (-O2):
@stdout = global i32* null
define i32* @get_stdout() {
%1 = load i32*, i32** @stdout
ret i32* %1
}
void av_des_mac() {}


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

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

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

LLVM IR (-O2):
define void @av_des_mac() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xea() {
  Assert_real((isgraph(234) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1175, ("isgraph should be 0 for 0xea"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xea>:
push   %rax
mov    $0xea,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x497,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xea\00"
define void @t_isgraph_0xea() {
%1 = call i64 @isgraph(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xea\00"
define void @t_isgraph_0xea() {
%1 = tail call i64 @isgraph(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int snd_iprintf(struct snd_info_buffer *buffer, char *fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.snd_info_buffer = type opaque
define i32 @snd_iprintf(%struct.snd_info_buffer* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
void object_constructor(struct m_class_object_instance *p_this) {}


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

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

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

LLVM IR (-O2):
%struct.m_class_object_instance = type opaque
define void @object_constructor(%struct.m_class_object_instance* nocapture %0) {
ret void
}
/* Variables and functions */
int printf(char *, int);
main() {
  int x;
  x = printf("%d\n", x = printf("%d", 890));
  printf("\n%d", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee6(%rip),%rdi
mov    $0x37a,%esi
call   1030 <printf@plt>
mov    %eax,%esi
mov    %esi,-0x4(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeed(%rip),%rdi
mov    $0x37a,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 890)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %2)
ret i32 0
}
int Emoji() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Emoji() {
ret i32 0
}
/* Variables and functions */
int MV_VoicesPlaying();
int FX_SoundsPlaying(void) { return (MV_VoicesPlaying()); }


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

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

LLVM IR (-O0):
define i32 @FX_SoundsPlaying() {
%1 = call i32 (...) @MV_VoicesPlaying()
ret i32 %1
}

LLVM IR (-O2):
define i32 @FX_SoundsPlaying() {
%1 = tail call i32 (...) @MV_VoicesPlaying()
ret i32 %1
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ update_curr_dl(struct rq *);
void task_tick_dl(struct rq *rq, struct task_struct *p, int queued) {
  update_curr_dl(rq);
}


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

x86 assembly (clang, -O2):
<task_tick_dl>:
jmp    1030 <update_curr_dl@plt>

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @task_tick_dl(%struct.rq* %0, %struct.task_struct* %1, i32 %2) {
%4 = alloca %struct.rq*
%5 = alloca %struct.task_struct*
%6 = alloca i32
store %struct.rq* %0, %struct.rq** %4
store %struct.task_struct* %1, %struct.task_struct** %5
store i32 %2, i32* %6
%7 = load %struct.rq*, %struct.rq** %4
%8 = call i32 @update_curr_dl(%struct.rq* %7)
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @task_tick_dl(%struct.rq* %0, %struct.task_struct* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @update_curr_dl(%struct.rq* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mytoupper(char *);
void two2upper(char s[][64], int row) {
  int i = 0;
  for (i = 0; i < row; i++) {
    mytoupper(s[i]);
  }
}


x86 assembly (clang, -O0):
<two2upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <two2upper+0x4b>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x6,%rax
add    %rax,%rdi
call   1030 <mytoupper@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <two2upper+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two2upper>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <two2upper+0x22>
mov    %rdi,%rbx
mov    %esi,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <mytoupper@plt>
add    $0x40,%rbx
add    $0xffffffffffffffff,%r14
jne    1120 <two2upper+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @two2upper([64 x i8]* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %0, i64 %7, i64 0
%9 = tail call i32 @mytoupper(i8* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
unsigned char dec_to_bcd(unsigned char val) {
  return ((val / 10 * 16) + (val % 10));
}


x86 assembly (clang, -O0):
<dec_to_bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
add    %edx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_to_bcd>:
mov    %edi,%eax
imul   $0xcd,%edi,%ecx
shr    $0xb,%ecx
mov    %ecx,%edx
shl    $0x4,%dl
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
or     %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @dec_to_bcd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 10
%6 = mul nsw i32 %5, 16
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = srem i32 %8, 10
%10 = add nsw i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @dec_to_bcd(i8 zeroext %0) {
%2 = udiv i8 %0, 10
%3 = shl i8 %2, 4
%4 = urem i8 %0, 10
%5 = or i8 %3, %4
ret i8 %5
}
/* Variables and functions */
int core11_safe(char const *);
int U_EMRPAINTRGN_safe(const char *record) { return (core11_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRPAINTRGN_safe>:
jmp    1030 <core11_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPAINTRGN_safe(i8* %0) {
%2 = tail call i32 @core11_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ solve();
int main(__attribute__((__unused__)) int argc,
         __attribute__((__unused__)) char *argv[]) {
  printf("solve() = %lu\n", solve());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <solve@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"solve() = %lu\0A\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 (...) @solve()
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"solve() = %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @solve()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void *test_address_space_array(unsigned long slot) {
  return ((void *volatile __attribute__((address_space(256))) *)0)[slot];
}


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

x86 assembly (clang, -O2):
<test_address_space_array>:
mov    %gs:0x0(,%rdi,8),%rax
ret

LLVM IR (-O0):
define i8* @test_address_space_array(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds i8*, i8* addrspace(256)* null, i64 %3
%5 = load volatile i8*, i8* addrspace(256)* %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @test_address_space_array(i64 %0) {
%2 = getelementptr inbounds i8*, i8* addrspace(256)* null, i64 %0
%3 = load volatile i8*, i8* addrspace(256)* %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ signal_sub_int(int *, int *, int *);
int signal_func_int(int *number, int *handler) {
  int status;
  signal_sub_int(number, handler, &status);
  return status;
}


x86 assembly (clang, -O0):
<signal_func_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <signal_sub_int@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_func_int>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <signal_sub_int@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @signal_func_int(i32* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @signal_sub_int(i32* %0, i32* %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ inc();
int main() {
  inc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @inc()
ret i32 0
}
/* Variables and functions */
scalar_t__ lrand48();
int rand(void) { return (int)lrand48(); }


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

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

LLVM IR (-O0):
define i32 @rand() {
%1 = call i64 (...) @lrand48()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand() {
%1 = tail call i64 (...) @lrand48()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
scalar_t__ syscall(int /*<<< orphan*/);
int gettid() { return (int)syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i64 @syscall(i32 %1)
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i64 @syscall(i32 %1)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ sprintf(char *, char *, float);
float fround3(float x) {
  char sbuff[128];
  float y;
  sprintf(sbuff, "%.3f", x);
  y = atof(sbuff);
  return y;
}


x86 assembly (clang, -O0):
<fround3>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x94(%rbp)
ff
movss  -0x94(%rbp),%xmm0
ff
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fround3>:
push   %rbx
sub    $0x80,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.3f\00"
define float @fround3(float %0) {
%2 = alloca float
%3 = alloca [128 x i8]
%4 = alloca float
store float %0, float* %2
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = load float, float* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %6)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = call float @atof(i8* %8)
store float %9, float* %4
%10 = load float, float* %4
ret float %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.3f\00"
define float @fround3(float %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %0)
%5 = call float @atof(i8* %3)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void exibe(int *m, int n) {
  for (int i = 0; i < n; i++)
    printf("Numero %d = %d \n", i, m[i]);
}


x86 assembly (clang, -O0):
<exibe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <exibe+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <exibe+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exibe>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <exibe+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <exibe+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Numero %d = %d \0A\00"
define void @exibe(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
void get_light_sensordata(char *pchRcvDataFrame, int *iDataIdx,
                          struct sensor_value *sensorsdata) {
  return;
}


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

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

LLVM IR (-O0):
%struct.sensor_value = type opaque
define void @get_light_sensordata(i8* %0, i32* %1, %struct.sensor_value* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca %struct.sensor_value*
store i8* %0, i8** %4
store i32* %1, i32** %5
store %struct.sensor_value* %2, %struct.sensor_value** %6
ret void
}

LLVM IR (-O2):
%struct.sensor_value = type opaque
define void @get_light_sensordata(i8* nocapture %0, i32* nocapture %1, %struct.sensor_value* nocapture %2) {
ret void
}
double jn(int n, double x) { return 0.0; }


x86 assembly (clang, -O0):
<jn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jn>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @jn(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @jn(i32 %0, double %1) {
ret double 0.000000e+00
}